YousicianGit / UnityNativeEdit

Unity Native Input Plugin for both iOS and Android (Unity UI compatible)
44 stars 13 forks source link

NoSuchMethodError com.bkmin.android.UnityPlayerNotOnTop.<init>(UnityPlayerNotOnTop.java:14) #48

Closed raphac closed 6 years ago

raphac commented 7 years ago

Hi

I have problems to build and start the plugin on android. When I use the plugin inside a clean unity project, it works fine, but when I copied the plugin inside my current project, I can't start the app. I have the following error message on android log: `08-23 16:14:32.576 3706-23106/? I/ActivityManager: START u0 {act=android.intent.action.MAIN cat=[android.intent.category.LAUNCHER] flg=0x10200000 cmp=ch.unity.a/com.bkmin.android.UnityPlayerNotOnTopActivity (has extras)} from uid 10029 on display 0 08-23 16:14:32.617 3706-8468/? I/ActivityManager: Start proc 8082:ch.unity.a/u0a245 for activity com.test.unity/com.bkmin.android.UnityPlayerNotOnTopActivity 08-23 16:14:32.619 8082-8082/? I/art: Late-enabling -Xcheck:jni 08-23 16:14:32.642 8082-8089/? I/art: Debugger is no longer active 08-23 16:14:32.642 8082-8089/? I/art: Starting a blocking GC Instrumentation 08-23 16:14:32.753 8082-8082/? D/AndroidRuntime: Shutting down VM --------- beginning of crash 08-23 16:14:32.755 8082-8082/? E/AndroidRuntime: FATAL EXCEPTION: main Process: com.test.unity, PID: 8082 java.lang.Error: FATAL EXCEPTION [main] Unity version : 2017.1.0f3 Device model : Huawei Nexus 6P Device fingerprint: ...:user/release-keys

                                             Caused by: java.lang.NoSuchMethodError: No direct method <init>(Landroid/content/ContextWrapper;)V in class Lcom/unity3d/player/UnityPlayer; or its super classes (declaration of 'com.unity3d.player.UnityPlayer' appears in /data/app/ch.unity.a-2/base.apk)
                                                 at com.bkmin.android.UnityPlayerNotOnTop.<init>(UnityPlayerNotOnTop.java:14)
                                                 at com.bkmin.android.UnityPlayerNotOnTopActivity.onCreate(UnityPlayerNotOnTopActivity.java:16)
                                                 at android.app.Activity.performCreate(Activity.java:6682)
                                                 at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1118)
                                                 at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2619)
                                                 at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2727)
                                                 at android.app.ActivityThread.-wrap12(ActivityThread.java)
                                                 at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1478)
                                                 at android.os.Handler.dispatchMessage(Handler.java:102)
                                                 at android.os.Looper.loop(Looper.java:154)
                                                 at android.app.ActivityThread.main(ActivityThread.java:6121)
                                                 at java.lang.reflect.Method.invoke(Native Method)
                                                 at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
                                                 at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)

08-23 16:14:32.757 3706-2103/? W/ActivityManager: Force finishing activity com.test.unity/com.bkmin.android.UnityPlayerNotOnTopActivity`

Has anyone an idea what I do wrong? When I export the unity project as android project, the jar file was not exported. Is that correct? (I found some similar problem here: https://forum.unity3d.com/threads/classnotfoundexception-on-android-plugin.182482/)

And I use vuforia, could that be the problem? When I don't override UnityPlayerNativeActivity in Manifest.xml, then it works, but the next problem is this one: https://github.com/YousicianGit/UnityNativeEdit/issues/44

Thank you

Hemaolle commented 7 years ago

I think it shouldn't be necessary anymore to use the UnityPlayerNotOnTopActivity workaround as Unity apparently rolled back the stuff that caused the issues that that workaround was fixing. We should update the readme.

Nezz commented 6 years ago

Readme updated