AppCenter Xamarin.Android builds and installs successfully on devices but doesn't run

半城伤御伤魂 提交于 2020-12-04 03:18:35

问题


I'm developing a Xamarin.Forms App (early stages) and have just set up AppCenter to build and distribute it. AppCenter takes the Xamarin.Android project, builds it successfully, signs with the same debug keys and makes the .apk available for download. I've tested in two different devices and the app installs successfully but won't run (opens and closes straightaway), no errors are shown.

If I deploy the app from Visual Studio it works fine.

  • Xamarin.Forms 3.4.0.1008975
  • Mono.Android v4.0.30319 (Xamarin.Android)
  • Minimum Android 4.4 / Target 8.1
  • Tested on Android 6 and 9 (both work if deployed from Visual Studio, and don't work with the distributed release from AppCenter)

Logcat:

Time    Device Name Type    PID Tag Message
03-16 18:13:55.483  Sony D6503  Warning 1326    WindowManager   java.lang.IllegalArgumentException: Requested window android.view.ViewRootImpl$W@8108048 does not exist
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8890)
at com.android.server.wm.WindowManagerService.windowForClientLocked(WindowManagerService.java:8881)
at com.android.server.wm.WindowManagerService.removeWindow(WindowManagerService.java:2766)
at com.android.server.wm.Session.remove(Session.java:187)
at android.view.ViewRootImpl.dispatchDetachedFromWindow(ViewRootImpl.java:3103)
at android.view.ViewRootImpl.doDie(ViewRootImpl.java:5610)
at android.view.ViewRootImpl$ViewRootHandler.handleMessage(ViewRootImpl.java:3413)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:234)
at android.os.HandlerThread.run(HandlerThread.java:61)
at com.android.server.ServiceThread.run(ServiceThread.java:46)
03-16 18:13:55.483  Sony D6503  Warning 1326    WindowManager   Failed looking up window
03-16 18:13:55.474  Sony D6503  Warning 1326    ActivityManager Force removing ActivityRecord{6a47b30 u0 com.companyname/md5dac3b7b583c4c7d6c1c265db80217d7a.MainActivity t28}: app died, no saved state
03-16 18:13:55.424  Sony D6503  Error   27642   monodroid   No assemblies found in '/data/user/0/com.companyname/files/.__override__' or '/storage/emulated/0/Android/data/com.companyname/files/.__override__'. Assuming this is part of Fast Deployment. Exiting...

Any suggestion is strongly appreciated.


回答1:


The solution to this problem was to disable the "Use Shared Runtime" property from the project options.

Instructions:

  1. Right click on the android project
  2. Go to Android Options
  3. Uncheck "Use Shared Runtime"
  4. Commit && push the changes
  5. Trigger a new build on AppCenter


来源:https://stackoverflow.com/questions/55195365/appcenter-xamarin-android-builds-and-installs-successfully-on-devices-but-doesn

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