Start a new topic

Can't load AR experience in wikitude

Can't load AR experience in wikitude

I need to create AR app to do as in this link:

I wrote a code and tried it, it open a camera, but I think it can't load to use AR experience (index.html)

This is a code:

NOTE: the path of index.html in th project is: assets/miarec/index.hmtl


import android.os.Bundle;
import android.view.Menu;
import android.view.MenuItem;
import android.widget.Toast;
import com.wikitude.architect.ArchitectView;

public class MainActivity extends ActionBarActivity {

ArchitectView architectView;
protected void onCreate(Bundle savedInstanceState) {

this.architectView = (ArchitectView)this.findViewById( );
final ArchitectView.ArchitectConfig config = new ArchitectView.ArchitectConfig( "3Axht4JgkVsnCHOuwl76PM0NDRnpRNL5PwwrPd1kgIN7aAP5sGJxBp3hvA3SIE+zrzwaqvulTUb7hhYz1/iQJiY9M3K8825GHJkssi5nHP8ZhtdoIo0z2fV2PkGUY9DzmVG/z2f3Uu8FKyulXFFegYEQZcvSCVIYvBmI6y0MIAFTYWx0ZWRfX6IIZxx4haqZxXDO5sj4bWkWKn2INx38uRuDKzaF6TVj7NV2MpeQeOvWWWGx7TKLL8DfOO8W4ARCSicBw6Vmejq7WMFQuMvte1y+r6rxZ2irjTBd8IpiAezUX8cxpy26SNbd1Gm+PWdjizE3Yqqr3/mi5NcDWlGm3GICiCeFvDNFgwryW7kPG6JTjhWA3GiUTfUE7AAJI349ZbtisyhP8YLzRvPUIc8t9nKs0aEMCme3e3CNiacl7rAuUWI7YNYD28GQ9EpTwAL8F29tV1n3dcXhxyuKfyptft71DI1SVVQ67/3UNml6bA06R3ZZiwyYD1f9l/Kfz5Q6RaFGXBL6vKHKwSt0vfeul2lmB4N1FJ+6GCSsB8cvIyhq3QtMQhbG9CiihTlsF9WVQdIVtbXFuGo=" /* license key */ );
this.architectView.onCreate( config );


protected void onPostCreate( final Bundle savedInstanceState ) {
super.onPostCreate( savedInstanceState );

if ( this.architectView != null ) {

// call mandatory live-cycle method of architectView

try {
// load content via url in architectView, ensure '<script src="architect://architect.js"></script>' is part of this HTML file, have a look at's developer section for API references

String s= getAssets().open("miarec/index.html").toString();

} catch (IOException e1) {

public boolean onCreateOptionsMenu(Menu menu) {
// Inflate the menu; this adds items to the action bar if it is present.
getMenuInflater().inflate(, menu);
return true;

public boolean onOptionsItemSelected(MenuItem item) {
// Handle action bar item clicks here. The action bar will
// automatically handle clicks on the Home/Up button, so long
// as you specify a parent activity in AndroidManifest.xml.
int id = item.getItemId();

//noinspection SimplifiableIfStatement
if (id == {
return true;

return super.onOptionsItemSelected(item);

public void onResume() {


protected void onPause() {

// call mandatory live-cycle method of architectView
if ( this.architectView != null ) {



protected void onStop() {

protected void onDestroy() {

// call mandatory live-cycle method of architectView
if ( this.architectView != null ) {

public void onLowMemory() {
if ( this.architectView != null ) {

This is a activity_main.xml:


<RelativeLayout xmlns:android=""

<com.wikitude.architect.ArchitectView android:id="@+id/architectView"
android:layout_width="fill_parent" android:layout_height="fill_parent"/>


I get this warning in android studio xml preview:


Rendering Problems The following classes could not be instantiated:
- com.wikitude.architect.ArchitectView (Open Class, Show Exception)
Tip: Use View.isInEditMode() in your custom views to skip code or show
sample data when shown in the IDE Exception Details
java.lang.NullPointerException   at
com.wikitude.architect.ArchitectView.e  at
com.wikitude.architect.ArchitectView.a  at
com.wikitude.architect.ArchitectView.<init>  at
com.wikitude.architect.ArchitectView.<init>  at

Thank you very much

Hi there!

Please have a look at the provided Sample application, which also uses relative paths within the assets folder.
Calling architectView.load("index.html") will load file from application's assets folder and architectView.load("yourpath/index.html") the index html-file in yourpath, relative to the assets root directory, no need to use absolute assets-directory.

Kind regards,


Hi Andreas Hauser,

Thank you for your reply.

Before I posted the thread, I tried many way to load file as 

* this.architectView.load(getAssets().open("miarec/index.html").toString());


* this.architectView.load("miarec/index.html");

and tried to change the folder to another place in project , but with no result.

Please write to me a true code, or if you have a sample project to Image Recognition - MULTIPLE TARGETS Attach it to me.

thank you

Hi again!

I guess there is an errot in your JS code. Have you tried loading it from assets root folder?
Please first try loading a valid sample application and then replace it with your own source code.

Also have a look at Android remote dubugging to find potential JS errors.

Kind regards,

Dear Andreas Hauser,

Thank you very much, your reply gave me near of 80% of solution.

My mistake was with asstes folder, I was create it as normal directory

While I must create it in android studio as this way

 right-click on the  folder and navigate to the new -> Folder-> Assets Folder.

and be sure for this:

Looking inside the .iml file of your project you will see the following line:

<option name="ASSETS_FOLDER_RELATIVE_PATH" value="/src/main/assets" />

Best Regards,


Good to hear that you were able to solve the issue.

Kind regards,

I tried your advice and other things, but I can't get my AR App to display anything.

I am using the html/css/js files and assets from the example app.

This is what I have:

I tried .load("something"), .load("assets/something") and .load("somethign/index.html").

Thank you very much in advance :)

Please have a look at the provided Sample Application.

Using the path to the index.html (which must include the <script src="architect://architect.js"></script> tag)
should solve your issue.

I recomend you to also have a look at remote debugging of the WebView to find out if there are any JS errors in your code.

Kind regards,


Thank you very much for your answer.

I found the error myself this morning.

I had to put the asset folder into src/main and use .load("something/index.html");.

Thank you very much for the support though!

Hi !

I have the same problem but I cannot find a solution. I create the assets folder as described above but it doesn't work !

I have this error on activity preview :


at com.wikitude.architect.ArchitectView.e(Unknown Source)

at com.wikitude.architect.ArchitectView.a(Unknown Source)

at com.wikitude.architect.ArchitectView.<init>(Unknown Source)

at com.wikitude.architect.ArchitectView.<init>(Unknown Source)

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(

at java.lang.reflect.Constructor.newInstance(





at android.view.BridgeInflater.loadCustomView(

at android.view.BridgeInflater.createViewFromTag(



And this erros in debug on Smart Glasses (Epson BT200) :



                                                                                 java.lang.RuntimeException: Unable to start activity ComponentInfo{}: android.view.InflateException: Binary XML file line #12: Error inflating class com.wikitude.architect.ArchitectView





                                                                                     at android.os.Handler.dispatchMessage(



Thank you for your help !




Hi Jerome,

It is quite hard to analyse the obfuscated errors but please have a look at the Epson Sample application provided in the download section. Note that the Epson SDK is behind the Android/iOS SDK and only comes with an Eclipse-based sample project.

Best regards
Login or Signup to post a comment