Search code examples
c#xamarin.androidwikitudewikitude-sdk

Wikitude crash on Xamarin.Android app No virtual method setLightEstimationMode


I'm running Xamarin.Wikitude.SDK.JS plugin, version 8.6.0 on a Xamarin.Android Project. When loading the Wikitude provided example, the app crashes. The example is https://github.com/Wikitude/wikitude-sdk-samples/tree/master/05_InstantTracking_3_Interactivity

I've added code to check if ARCore is installed. If not an alert is shown so users can install ARCore if the device is supported.

Here is the console Output:

No pending exception expected: java.lang.NoSuchMethodError: No virtual method setLightEstimationMode(Lcom/google/ar/core/Config$LightEstimationMode;)V in class Lcom/google/ar/core/Config; or its super classes (declaration of 'com.google.ar.core.Config' appears in /data/app/XXXXXXXXXXXXXXXX-2o7U_ByKTJBW9vPIXZeXHA==/base.apk) at com.google.ar.core.Config com.wikitude.common.arcore.internal.ArCoreTracker.k() (SourceFile:462) at void com.wikitude.common.arcore.internal.ArCoreTracker.a() (SourceFile:177) at void com.wikitude.common.arcore.internal.NativeArCoreInterface.start() (SourceFile:42) at void com.wikitude.common.camera.internal.NativeCameraInterface.nativeCameraReleased(long) (SourceFile:-2) at void com.wikitude.common.camera.internal.NativeCameraInterface.b() (SourceFile:194) at void com.wikitude.common.camera.internal.DeviceCamera2.l() (SourceFile:368) at void com.wikitude.common.camera.internal.d.b() (SourceFile:85) at void com.wikitude.common.camera.internal.NativeCameraInterface.doStop() (SourceFile:37) at void com.wikitude.architect.PlatformBridge.callAsyncImplInternal(long, java.lang.String) (SourceFile:-2) at void com.wikitude.architect.PlatformBridge.callAsyncImpl(java.lang.String) (SourceFile:134) at void com.wikitude.architect.PlatformBridge$a.a(java.util.List, int) (SourceFile:66) at void com.wikitude.architect.PlatformBridge$a.run() (SourceFile:40)

I've tried another example without AR (ImageOnTarget) and it's working so I suppose Wikitude is correctly configured.


Solution

  • I've found out! The problem was the package Xamarin.Google.ARCore used to check if device supports AR and user had installed ARCore. This plugin conflicts with Wikitude SDK so after removing it, Wikitude AR started working