// call mandatory live-cycle method of architectView this.architectView.onPostCreate();
try { // load content via url in architectView, ensure '<script src="architect://architect.js"></script>' is part of this HTML file, have a look at wikitude.com's developer section for API references
@Override public boolean onCreateOptionsMenu(Menu menu) { // Inflate the menu; this adds items to the action bar if it is present. getMenuInflater().inflate(R.menu.menu_main, menu); return true; }
@Override 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 == R.id.action_settings) { return true; }
return super.onOptionsItemSelected(item); }
@Override public void onResume() { super.onResume();
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
A
Andreas Fötschl
said
almost 9 years ago
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, Andreas
s
swe anas
said
almost 9 years ago
Hi Andreas Hauser,
Thank you for your reply.
Before I posted the thread, I tried many way to load file as
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
A
Andreas Fötschl
said
almost 9 years ago
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.
I had to put the asset folder into src/main and use .load("something/index.html");.
Thank you very much for the support though!
J
Jerome Bessane
said
over 7 years ago
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 :
java.lang.NullPointerException
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(NativeConstructorAccessorImpl.java:62)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
at java.lang.reflect.Constructor.newInstance(Constructor.java:423)
at org.jetbrains.android.uipreview.ViewLoader.createNewInstance(ViewLoader.java:465)
at org.jetbrains.android.uipreview.ViewLoader.loadClass(ViewLoader.java:172)
at org.jetbrains.android.uipreview.ViewLoader.loadView(ViewLoader.java:105)
at com.android.tools.idea.rendering.LayoutlibCallbackImpl.loadView(LayoutlibCallbackImpl.java:170)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:247)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:171)
...
And this erros in debug on Smart Glasses (Epson BT200) :
FATAL EXCEPTION: main
java.lang.RuntimeException: Unable to start activity ComponentInfo{org.orange.sas.epsonapplication/org.orange.sas.epsonapplication.TestActivity}: android.view.InflateException: Binary XML file line #12: Error inflating class com.wikitude.architect.ArchitectView
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1970)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1995)
at android.app.ActivityThread.access$600(ActivityThread.java:128)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1161)
at android.os.Handler.dispatchMessage(Handler.java:99)
...
Thank you for your help !
A
Andreas Fötschl
said
over 7 years ago
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.
swe anas