Xamarin java.lang.UnsatisfiedLinkError: No implementation found for void crc64690a6026da756c39.MainApplication.n_onCreate()

无人久伴 提交于 2020-04-16 05:54:07

问题


When we try to run a Xamarin App in Debug mode for android on a real/fake device. Some weird exception is thrown when launching the app.

This is the stacktrace where it begins to go wrong:

01-22 13:40:38.394 E/MonoDroid( 4413): Could not load type 'Packing.App.Droid.MainApplication, Packing.App.Android, Version=1.0.0.0, Culture=nl-NL, PublicKeyToken=null'. Skipping JNI registration of type 'crc64690a6026da756c39/MainApplication'.
01-22 13:40:38.398 D/FirebaseApp( 4413): com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
01-22 13:40:38.424 D/FirebaseApp( 4413): com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
01-22 13:40:38.424 D/FirebaseApp( 4413): com.google.android.gms.measurement.AppMeasurement is not linked. Skipping initialization.
01-22 13:40:38.424 I/FirebaseInitProvider( 4413): FirebaseApp initialization successful
01-22 13:40:38.427 E/en.Packing.App( 4413): No implementation found for void crc64690a6026da756c39.MainApplication.n_onCreate() (tried Java_crc64690a6026da756c39_MainApplication_n_1onCreate and Java_crc64690a6026da756c39_MainApplication_n_1onCreate__)
01-22 13:40:38.427 D/AndroidRuntime( 4413): Shutting down VM
01-22 13:40:38.428 E/AndroidRuntime( 4413): FATAL EXCEPTION: main
01-22 13:40:38.428 E/AndroidRuntime( 4413): Process: nl.Packing.App, PID: 4413
01-22 13:40:38.428 E/AndroidRuntime( 4413): java.lang.UnsatisfiedLinkError: No implementation found for void crc64690a6026da756c39.MainApplication.n_onCreate() (tried Java_crc64690a6026da756c39_MainApplication_n_1onCreate and Java_crc64690a6026da756c39_MainApplication_n_1onCreate__)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at crc64690a6026da756c39.MainApplication.n_onCreate(Native Method)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at crc64690a6026da756c39.MainApplication.onCreate(MainApplication.java:34)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1197)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at android.app.ActivityThread.handleBindApplication(ActivityThread.java:6647)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at android.app.ActivityThread.access$1600(ActivityThread.java:231)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1952)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at android.os.Handler.dispatchMessage(Handler.java:107)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at android.os.Looper.loop(Looper.java:214)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at android.app.ActivityThread.main(ActivityThread.java:7682)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at java.lang.reflect.Method.invoke(Native Method)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:516)
01-22 13:40:38.428 E/AndroidRuntime( 4413):     at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:950)
**Java.Lang.UnsatisfiedLinkError:** 'Loading...'

01-22 13:40:38.843 D/Mono    ( 4413): DllImport searching in: '__Internal' ('(null)').
01-22 13:40:38.844 D/Mono    ( 4413): Searching for 'java_interop_jnienv_call_void_method_a'.
01-22 13:40:38.844 D/Mono    ( 4413): Probing 'java_interop_jnienv_call_void_method_a'.
01-22 13:40:38.844 D/Mono    ( 4413): Found as 'java_interop_jnienv_call_void_method_a'.
01-22 13:40:59.210 E/mono    ( 4413): Full thread dump:

"<unnamed thread>"  at <unknown> <0xffffffff>
 at (wrapper managed-to-native) System.Diagnostics.Debugger.Mono_UnhandledException_internal     (System.Exception) <0x00007>
 at System.Diagnostics.Debugger.Mono_UnhandledException (System.Exception) [0x00000] in /Users/builder/jenkins/workspace/archive-mono/2019-08/android/release/mcs/class/corlib/System.Diagnostics/Debugger.cs:120
 at Android.Runtime.UncaughtExceptionHandler.UncaughtException (Java.Lang.Thread,Java.Lang.Throwable) [0x00006] in <a94a3bd35e1d47b586702ce8c8a1bd75>:0
 at Java.Lang.Thread/IUncaughtExceptionHandlerInvoker.n_UncaughtException_Ljava_lang_Thread_Ljava_lang_Throwable_ (intptr,intptr,intptr,intptr) [0x0001c] in <a94a3bd35e1d47b586702ce8c8a1bd75>:0
 at (wrapper dynamic-method) Android.Runtime.DynamicMethodNameCounter.1 (intptr,intptr,intptr,intptr) [0x0001d] in <a94a3bd35e1d47b586702ce8c8a1bd75>:0
 at (wrapper native-to-managed) Android.Runtime.DynamicMethodNameCounter.1 (intptr,intptr,intptr,intptr) [0x00035] in <a94a3bd35e1d47b586702c
e8c8a1bd75>:0

"Debugger agent"
"Finalizer"

The weird thing here is we can build in and run debug in VS2017 but it does not work in 2019 nor does it work when we release a debug build in Appcenter trough Azure devops.

The app also works in flawlessly UWP ...

I tried also to remove the Base from Base.OnCreate() as suggested in a different stackoverflow question

EDIT: What i eventually did is using VS2017 and using an VS2017 agent pool in Azure Devops. The reason for this is that lifespan off the app is limited and will not be developed further.

来源:https://stackoverflow.com/questions/59860332/xamarin-java-lang-unsatisfiedlinkerror-no-implementation-found-for-void-crc6469

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!