Hi everyone,
I’m trying to create a custom plugin to get location information in background in Unity for Android.
However, after doing everything both on andorid studio and unity, I get this error in the Build:
AndroidJavaException: java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/app/AppCompatActivity;
java.lang.NoClassDefFoundError: Failed resolution of: Landroidx/appcompat/app/AppCompatActivity;
com.unity3d.player.UnityPlayer.nativeRender(Native Method)
com.unity3d.player.UnityPlayer.access$300(Unknown Source:0)
com.unity3d.player.UnityPlayer$e$1.handleMessage(Unknown Source:95)
android.os.Handler.dispatchMessage(Handler.java:102)
android.os.Looper.loop(Looper.java:214)
com.unity3d.player.UnityPlayer$e.run(Unknown Source:20)
Caused by: java.lang.ClassNotFoundException: Didn’t find class “androidx.appcompat.app.AppCompatActivity” on path: DexPathList[[zip file “/data/app/com.DefaultCompany.TestJavaPlugin-rHVBIXnek9UUuf-e8zhVkA==/base.apk”],nativeLibraryDirectories=[/data/app/com.DefaultCompany.TestJavaPlugin-rHVBIXnek9UUuf-e8zhVkA==/lib/arm, /data/app/com.DefaultCompany.TestJavaPlugin-rHVBIXnek9UUuf-e8zhVkA==/base.apk!/lib/armeabi-v7a, /system/lib, /system/vendor/lib]]
dalvik.system.BaseDexClassLoader.findClass(BaseDexClassLoader.java:134)
java.lang.ClassLoader.loadClass(ClassLoader.java:379)
java.lang.ClassLoader.loadClass(ClassLoader.java:312)
… 6 more
UnityEngine.AndroidJNISafe.CheckException () (at :0)
UnityEngine.AndroidJNISafe.FindClass (System.String name) (at :0)
UnityEngine.AndroidJavaObject._AndroidJavaObject (System.String className, System.Object[ ] args) (at :0)
UnityEngine.AndroidJavaObject…ctor (System.String className, System.Object[ ] args) (at :0)
TestJava.Start () (at :0)
Can anyone tell me a possibile solution or cause of the problem? Thanks!