我正在使用Visual Studio上的xamarin开发Android应用程序。从API 26和API进行目标和编译21分钟。我的应用程序在调试中运行良好,但在发布模式下打开启动画面之前崩溃。我得到以下错误。我已经清理,重建和构建应用程序并重新启动VS.
06-08 16:18:16.494 E/AndroidRuntime(24175): FATAL EXCEPTION: main
06-08 16:18:16.494 E/AndroidRuntime(24175): Process: com.es.responsemaster, PID: 24175
06-08 16:18:16.494 E/AndroidRuntime(24175): java.lang.RuntimeException: Unable to get provider com.google.firebase.provider.FirebaseInitProvider: android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f060008
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.app.ActivityThread.installProvider(ActivityThread.java:6334)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.app.ActivityThread.installContentProviders(ActivityThread.java:5923)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5862)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.app.ActivityThread.-wrap3(ActivityThread.java)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1718)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.os.Handler.dispatchMessage(Handler.java:102)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.os.Looper.loop(Looper.java:154)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.app.ActivityThread.main(ActivityThread.java:6688)
06-08 16:18:16.494 E/AndroidRuntime(24175): at java.lang.reflect.Method.invoke(Native Method)
06-08 16:18:16.494 E/AndroidRuntime(24175): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
06-08 16:18:16.494 E/AndroidRuntime(24175): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
06-08 16:18:16.494 E/AndroidRuntime(24175): Caused by: android.content.res.Resources$NotFoundException: Unable to find resource ID #0x7f060008
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.content.res.ResourcesImpl.getResourcePackageName(ResourcesImpl.java:248)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.content.res.Resources.getResourcePackageName(Resources.java:2783)
06-08 16:18:16.494 E/AndroidRuntime(24175): at com.google.android.gms.common.internal.zzbz.<init>(Unknown Source)
06-08 16:18:16.494 E/AndroidRuntime(24175): at com.google.firebase.FirebaseOptions.fromResource(Unknown Source)
06-08 16:18:16.494 E/AndroidRuntime(24175): at com.google.firebase.FirebaseApp.initializeApp(Unknown Source)
06-08 16:18:16.494 E/AndroidRuntime(24175): at com.google.firebase.provider.FirebaseInitProvider.onCreate(Unknown Source)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.content.ContentProvider.attachInfo(ContentProvider.java:1758)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.content.ContentProvider.attachInfo(ContentProvider.java:1733)
06-08 16:18:16.494 E/AndroidRuntime(24175): at com.google.firebase.provider.FirebaseInitProvider.attachInfo(Unknown Source)
06-08 16:18:16.494 E/AndroidRuntime(24175): at android.app.ActivityThread.installProvider(ActivityThread.java:6331)
06-08 16:18:16.494 E/AndroidRuntime(24175): ... 10 more
非常感谢任何帮助。我已经花了几个小时试图谷歌问题,大部分结果都在讨论android studio的使用和编辑build.gradle。我没有build.gradle文件。请帮助我迷路了。
更新:
所以在更新了Plugins.Firebase,Xamarin.Forms以及一些清理和重建之后,我现在可以在发布模式下部署Linking但是如果我尝试将链接设置为“仅限Sdk Assemblies”,我会在构建时遇到以下错误:
Severity Code Description Project File Line Suppression State
Error The "LinkAssemblies" task failed unexpectedly.
Mono.Linker.MarkException: Error processing method: 'System.Void Plugin.FirebasePushNotification.DefaultPushNotificationHandler::OnReceived(System.Collections.Generic.IDictionary`2<System.String,System.Object>)' in assembly: 'Plugin.FirebasePushNotification.dll' ---> Mono.Cecil.ResolutionException: Failed to resolve System.Void Android.Support.V4.App.NotificationCompat/Builder::.ctor(Android.Content.Context,System.String)
at Mono.Linker.Steps.MarkStep.HandleUnresolvedMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkMethod(MethodReference reference)
at Mono.Linker.Steps.MarkStep.MarkInstruction(Instruction instruction)
at Mono.Linker.Steps.MarkStep.MarkMethodBody(MethodBody body)
at Mono.Linker.Steps.MarkStep.ProcessMethod(MethodDefinition method)
at Mono.Linker.Steps.MarkStep.ProcessQueue()
--- End of inner exception stack trace ---
at Mono.Linker.Steps.MarkStep.ProcessQueue()
at Mono.Linker.Steps.MarkStep.ProcessEntireQueue()
at Mono.Linker.Steps.MarkStep.Process()
at Mono.Linker.Steps.MarkStep.Process(LinkContext context)
at Mono.Linker.Pipeline.Process(LinkContext context)
at MonoDroid.Tuner.Linker.Process(LinkerOptions options, LinkContext& context)
at Xamarin.Android.Tasks.LinkAssemblies.Execute(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.LinkAssemblies.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() ResponseMaster.Droid