I am a very new user of the Wikitude SDK 2.0 for Android. I have been trying to use AR with PhoneGap 2.5 and 2.6 with the latest github plugin. For both above PhoneGap versions, and I think 2.6 is mainly bug fixes, I seem to be getting this 'no callAsync' error. A simple 'console.log' could drigger it, if I push the button that calls it 'too fast'. Here is the code that I would like to work:
console.log("Radar Begin");
var r = new AR.ImageResource("radar.png");
console.log("Continue");
AR.radar.background = r;
AR.radar.positionX = 0.1;
AR.radar.positionY = 0.1;
AR.radar.width = 0.4;
AR.radar.centerX = 0.5;
AR.radar.centerY = 0.5;
AR.radar.radius = 0.5;
AR.radar.northIndicator.image = new AR.ImageResource("north_arrow.png");
AR.radar.northIndicator.radius = 0.4;
AR.radar.onClick = function(){ AR.logger.info('radar was clicked');};
var geoLocation = new AR.RelativeLocation(null, 100, 0, 0);
var radarCircle = new AR.Circle(0.05, {style: {fillColor: '#83ff7b'}});
var geoObject = new AR.GeoObject(geoLocation, {drawables: {cam: markerDrawable, radar: radarCircle}});
AR.radar.enabled = true;
console.log(JSON.stringify(AR.radar));
console.log("Radar Loaded");
And here is the Eclipse log starting from when I go into AR from PhoneGap:
04-17 17:30:00.885: E/libEGL(28752): called unimplemented OpenGL ES API
04-17 17:30:18.573: E/Web Console(28752): Uncaught TypeError: Object has no method 'callAsync' at file:///android_asset/world/:41
04-17 17:30:19.915: D/DroidGap(28752): Paused the application!
04-17 17:30:19.915: D/CordovaWebView(28752): Handle the pause
04-17 17:30:19.985: E/libEGL(28752): call to OpenGL ES API with no current context (logged once per thread)
04-17 17:30:20.125: W/IInputConnectionWrapper(28752): showStatusIcon on inactive InputConnection
The code doesn't get past ImageResource creation.
A
Andreas Fötschl
said
about 10 years ago
Hi Pavel,
Please have a look at the provided phoneGap samples first. You find all information around set-up and concept in the *.md files.
Kind regards, Andreas
P
Pavel
said
about 10 years ago
Thanks, I think that's exactly what I did. I started from the 'HelloWorld' sample. My 'AR' is loading from phonegap. I can communicate back to phonegap using the 'architectsdk://'.
What crucial step do you think I am missing in order to generate the 'callAsync' error?
P
Pavel
said
about 10 years ago
Not sure if this is of any relevance, but in Eclipse, going to the res/layout/main.xml generates some errors in 'Graphical Layout':
See the Error Log (Window > Show View) for more details.
Tip: Use View.isInEditMode() in your custom views to skip code when shown in Eclipse
java.lang.NullPointerException
at com.wikitude.architect.ArchitectView.a( at com.wikitude.architect.ArchitectView.a( at com.wikitude.architect.ArchitectView.<init>( at sun.reflect.NativeConstructorAccessorImpl.newInstance0(NativeConstructorAccessorImpl.java:-2)
at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.instantiateClass(ProjectCallback.java:422)
at com.android.ide.eclipse.adt.internal.editors.layout.ProjectCallback.loadView(ProjectCallback.java:179)
at android.view.BridgeInflater.loadCustomView(BridgeInflater.java:207)
at android.view.BridgeInflater.createViewFromTag(BridgeInflater.java:135)
at android.view.LayoutInflater.rInflate_Original(LayoutInflater.java:746)
at android.view.LayoutInflater_Delegate.rInflate(LayoutInflater_Delegate.java:64)
at android.view.LayoutInflater.rInflate(LayoutInflater.java:718)
at android.view.LayoutInflater.inflate(LayoutInflater.java:489)
at android.view.LayoutInflater.inflate(LayoutInflater.java:372)
And the log error is "com.wikitude.architect.ArchitectView failed to instantiate"
It's probably unrelated, because the ArchitectView seems to load fine from phonegap in the actual app.
A
Andreas Fötschl
said
about 10 years ago
Hi again,
Sorry for delayed response.
Maybe I didn't get you right: You are using Wikitude's Android PhoneGap plugin and defining the architectView in a layout.xml?
PhoneGap plugin is here to reduce native implementation to a minimum. Please have a closer look at the provided sample app.
Kind regards, Andreas
P
Pavel
said
about 10 years ago
Hi,
Thanks for replying. No, I'm not using layout.xml for anything. It's just that every Android project has one, and clicking it in Eclipse generated some errors.
I started from the sample project. Having a sample project doesn't help, but I would like to know what is wrong. Could you tell me anything at all about this error? Is it related to internals of wikitude.jar, in what kind of situations would it happen?
A
Andreas Fötschl
said
about 10 years ago
Hi again,
Could you please tell me on which device you're testing and have a look at related forum entries.
Regards, Andreas
P
Pavel
said
about 10 years ago
Thanks for the link, I'll make sure to follow these for radar, however, I think my problem is not radar specific.
My development phone is Nexus 4, Android 4.2.1
R
Ravi Tamada
said
almost 10 years ago
Hi Pavel,
I am getting same error on Nexus 4, Android 4.2.1 Do you got any solution around this. Kindly help me if you find any solution.
Thank You
A
Andreas Fötschl
said
almost 10 years ago
Hi there!
Could you please check if you have latest SDK 3.0 installed? If not ensure your targetSDK version is below 17 due to some changes in the Android SDK (WebView).
Regards, Andreas
R
Ravi Tamada
said
almost 10 years ago
Hi Andreas,
Thanks for the reply. But the sampleARBrowser project which comes with the SDK is working fine in the same device.
Pavel