Я пытаюсь создать Android-версию приложения Xamarin.Forms, но выходной apk продолжает падать при инициализации Crashlytics.Похоже, он не может найти класс com.crashlytics.android.core.CrashlyticsCore
.
Основное (и, вероятно, единственное) отличие от сборок отладки заключается в том, что Multidex включен.
Я уже пыталсяИсправьте проблему, добавив следующие две строки:
com/crashlytics/android/Crashlytics.class
com/crashlytics/android/core/CrashlyticsCore.class
В multidex.keep
файл с действием сборки, установленным на MultiDexMainDexList
, но результат не изменился.
Я инициализируюСбои в моем методе MainAcvitity
OnCreate
, например:
Fabric.Fabric.With(this, new Crashlytics.Crashlytics());
Crashlytics.Crashlytics.HandleManagedExceptions();
Трассировка стека:
[MonoDroid] UNHANDLED EXCEPTION:
[MonoDroid] Java.Lang.NoClassDefFoundError: com.crashlytics.android.core.CrashlyticsCore
[MonoDroid] at Java.Interop.JniEnvironment+InstanceMethods.CallNonvirtualVoidMethod (Java.Interop.JniObjectReference instance, Java.Interop.JniObjectReference type, Java.Interop.JniMethodInfo method, Java.Interop.JniArgumentValue* args) [0x00089] in <34f201f6cca4421387fe7278a4375940>:0
[MonoDroid] at Java.Interop.JniPeerMembers+JniInstanceMethods.FinishCreateInstance (System.String constructorSignature, Java.Interop.IJavaPeerable self, Java.Interop.JniArgumentValue* parameters) [0x0004f] in <34f201f6cca4421387fe7278a4375940>:0
[MonoDroid] at Crashlytics.Crashlytics..ctor () [0x00054] in <114e650c181c4522b75b2d021c6a77a9>:0
[MonoDroid] at FollowFun.Droid.MainActivity.OnCreate (Android.OS.Bundle savedInstanceState) [0x00026] in <6c170c583d7f4be9a657f0283b3a6d04>:0
[MonoDroid] at Android.App.Activity.n_OnCreate_Landroid_os_Bundle_ (System.IntPtr jnienv, System.IntPtr native__this, System.IntPtr native_savedInstanceState) [0x00011] in <16a97b0d1e0a45cc9db76f74432e8848>:0
[MonoDroid] at (wrapper dynamic-method) System.Object.16(intptr,intptr,intptr)
[MonoDroid] --- End of managed Java.Lang.NoClassDefFoundError stack trace ---
[MonoDroid] java.lang.NoClassDefFoundError: com.crashlytics.android.core.CrashlyticsCore
[MonoDroid] at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:29)
[MonoDroid] at md509b0a614f9e78774f77a51d8579dfa9f.MainActivity.n_onCreate(Native Method)
[MonoDroid] at md509b0a614f9e78774f77a51d8579dfa9f.MainActivity.onCreate(MainActivity.java:38)
[MonoDroid] at android.app.Activity.performCreate(Activity.java:5231)
[MonoDroid] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
[MonoDroid] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
[MonoDroid] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
[MonoDroid] at android.app.ActivityThread.access$800(ActivityThread.java:135)
[MonoDroid] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
[MonoDroid] at android.os.Handler.dispatchMessage(Handler.java:102)
[MonoDroid] at android.os.Looper.loop(Looper.java:136)
[MonoDroid] at android.app.ActivityThread.main(ActivityThread.java:5001)
[MonoDroid] at java.lang.reflect.Method.invokeNative(Native Method)
[MonoDroid] at java.lang.reflect.Method.invoke(Method.java:515)
[MonoDroid] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
[MonoDroid] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
[MonoDroid] at dalvik.system.NativeStart.main(Native Method)
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: my.app, PID: 1441
[AndroidRuntime] java.lang.NoClassDefFoundError: com.crashlytics.android.core.CrashlyticsCore
[AndroidRuntime] at com.crashlytics.android.Crashlytics.<init>(Crashlytics.java:29)
[AndroidRuntime] at md509b0a614f9e78774f77a51d8579dfa9f.MainActivity.n_onCreate(Native Method)
[AndroidRuntime] at md509b0a614f9e78774f77a51d8579dfa9f.MainActivity.onCreate(MainActivity.java:38)
[AndroidRuntime] at android.app.Activity.performCreate(Activity.java:5231)
[AndroidRuntime] at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1087)
[AndroidRuntime] at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2148)
[AndroidRuntime] at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2233)
[AndroidRuntime] at android.app.ActivityThread.access$800(ActivityThread.java:135)
[AndroidRuntime] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1196)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:102)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:136)
[AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:5001)
[AndroidRuntime] at java.lang.reflect.Method.invokeNative(Native Method)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Method.java:515)
[AndroidRuntime] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:785)
[AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:601)
[AndroidRuntime] at dalvik.system.NativeStart.main(Native Method)
[Process] Sending signal. PID: 1441 SIG: 9
Версия Visual Studio для Mac:
Visual Studio Community 2017 for Mac
Version 7.6.7 (build 49)
Installation UUID: [...]
Runtime:
Mono 5.12.0.301 (2018-02/4fe3280bba1) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Xamarin.Mac 4.4.1.178 (master / eeaeb7e6)
Package version: 512000301
XamarinВерсия Android:
Xamarin.Android
Version: 9.0.0.20 (Visual Studio Community)
Android SDK: /Applications/Utilities/android-sdk
Supported Android versions:
4.0.3 (API level 15)
4.1 (API level 16)
4.4 (API level 19)
5.0 (API level 21)
5.1 (API level 22)
6.0 (API level 23)
7.0 (API level 24)
7.1 (API level 25)
8.1 (API level 27)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 28.0.1
SDK Build Tools Version: 28.0.3
Java SDK: /usr
java version "1.8.0_92"
Java(TM) SE Runtime Environment (build 1.8.0_92-b14)
Java HotSpot(TM) 64-Bit Server VM (build 25.92-b14, mixed mode)
Я установил в свой проект эти пакеты через NuGet: - Xamarin.Android.Crashlytics 2.9.4.1 - Xamarin.Android.Crashlytics.Answers 1.4.2 - Xamarin.Android.Crashlytics.Beta 1.2.9 - Xamarin.Firebase.Core 60.1142.1
Я уже пытался собрать проект как на Mac OS, так и на Windows 10, и в результате произошел тот же сбой.
Я чувствую, что перепробовал все, у кого-нибудь есть предложения, чтобы помочь мне решить эту проблему?