我在Mac上卸载了Xamarin。然后重新安装它。 6.1.4(Build1)。 现在我创建了一个新的解决方案选择了Portable Class Library。然后我编译。然后我安装在同一台机器上运行的模拟器上。但在发布会上,应用程序失败了。然后我检查了应用输出。以下是日志。我无法继续。请帮忙。我查了一下:“Xamarin.Android API-23支持”和“Mono运行时”都安装在模拟器android上。 (卸载这些组件也没有解决)
提前致谢。
以下是日志:
am start -n "in.test.buttonlogger/md50a143af76fade5fdcdfca266ac349d28.MainActivity"
Starting: Intent { cmp=in.test.buttonlogger/md50a143af76fade5fdcdfca266ac349d28.MainActivity }
[art] Not late-enabling -Xcheck:jni (already on)
[art] Unexpected CPU variant for X86 using defaults: x86
[AndroidRuntime] Shutting down VM
[AndroidRuntime] FATAL EXCEPTION: main
[AndroidRuntime] Process: in.kosi.buttonlogger, PID: 6621
[AndroidRuntime] java.lang.RuntimeException: Unable to get provider mono.MonoRuntimeProvider: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_24 or Xamarin.Android.Platform!
[AndroidRuntime] at android.app.ActivityThread.installProvider(ActivityThread.java:5856)
[AndroidRuntime] at android.app.ActivityThread.installContentProviders(ActivityThread.java:5445)
[AndroidRuntime] at android.app.ActivityThread.handleBindApplication(ActivityThread.java:5384)
[AndroidRuntime] at android.app.ActivityThread.-wrap2(ActivityThread.java)
[AndroidRuntime] at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1545)
[AndroidRuntime] at android.os.Handler.dispatchMessage(Handler.java:102)
[AndroidRuntime] at android.os.Looper.loop(Looper.java:154)
[AndroidRuntime] at android.app.ActivityThread.main(ActivityThread.java:6119)
[AndroidRuntime] at java.lang.reflect.Method.invoke(Native Method)
[AndroidRuntime] at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:886)
[AndroidRuntime] at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:776)
[AndroidRuntime] Caused by: java.lang.RuntimeException: Unable to find application Mono.Android.Platform.ApiLevel_24 or Xamarin.Android.Platform!
[AndroidRuntime] at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:38)
[AndroidRuntime] at android.app.ActivityThread.installProvider(ActivityThread.java:5853)
[AndroidRuntime] ... 10 more
[AndroidRuntime] Caused by: android.content.pm.PackageManager$NameNotFoundException: Xamarin.Android.Platform
[AndroidRuntime] at android.app.ApplicationPackageManager.getApplicationInfoAsUser(ApplicationPackageManager.java:345)
[AndroidRuntime] at android.app.ApplicationPackageManager.getApplicationInfo(ApplicationPackageManager.java:327)
[AndroidRuntime] at mono.MonoRuntimeProvider.attachInfo(MonoRuntimeProvider.java:32)
[AndroidRuntime] ... 11 more
答案 0 :(得分:1)
遇到此问题时,通常的解决方案是将AndroidUseLatestPlatformSdk
文件中的.csproj
属性编辑为false
给定项目,如下所示:
<AndroidUseLatestPlatformSdk>False</AndroidUseLatestPlatformSdk>
如果这不起作用,请尝试在Shared Runtime
下的Project Properties
中停用Android Options
。
作为最后一个选项,您还可以尝试减少Target Framework
下Project Properties
下的General
。