Xamarin.Android app only finding launcher activity on clean compile

爱⌒轻易说出口 提交于 2019-12-02 16:21:36

问题


I have an Xamarin.Android with the activity marked as MainLauncher called Login.

When I press F5 for first time the app starts ok in the emulator. Then I stop, do some code change, press F5 again I can see the app starting in the emulator and it's UI starting to show when I get this:

Java.Lang.RuntimeException: Unable to instantiate activity ComponentInfo{MyApp.MyApp/md5b14ee1c038eed1ee5328e926d768294f.Login}: java.lang.ClassNotFoundException: Didn't find class "md5b14ee1c038eed1ee5328e926d768294f.Login" on path: DexPathList[[zip file "/data/app/MyApp.MyApp-1/base.apk"],nativeLibraryDirectories=[/data/app/MyApp.MyApp-1/lib/x86, /vendor/lib, /system/lib]]

Then I will get this error on all attempts to start it. The only solution is to delete the bin and obj folders and press F5 again. After that the app will normally start once before I have to remove the folders again.


回答1:


This issue has been fixed and will be included in Visual Studio 15.5.5 or Visual Studio 15.6 Preview 3.

The respective Xamarin.Android version this fix is included in are Xamarin.Android 8.1.5.0 (Stable) and Xamarin.Android 8.2.0.6 (Preview)

Be on the look-out for this release as it will be available soon!

(If you need a workaround today, please follow the steps here: https://bugzilla.xamarin.com/show_bug.cgi?id=61073#c40)



来源:https://stackoverflow.com/questions/48425799/xamarin-android-app-only-finding-launcher-activity-on-clean-compile

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