I need to manually uninstall the app every time I want to deploy on my device

Hi all,

I'm having an issue with Xamarin when deploying on my Android phone.
When I build and deploy a Debug version to my phone, the first time it works fine, but every following times I get this error:

[monodroid] cannot find libmonosgen-2.0.so in override_dir: /data/user/0/{bundleID}/files/.override, app_libdir: /data/app/{bundleID}-vBL7jTS-TWEXElPewrysMQ==/lib/arm64 nor in previously printed locations.
[monodroid] Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported.
[monodroid] Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration).

Then the app crashes on start.
The only way I've found to re-deploy it is to first uninstall the app from my phone like I would with any other app from the PlayStore.
After doing that, it works once but crashes next time, and so on.
Oh, and building without shared runtime doesn't solve the issue, and the android:minSdkVersion is set to "19" in my AndroidManifest.

It is quite a frustrating issue, does anyone knows anything about this? I couldn't find anyone online having the same issue...

Info:
Visual Studio 7.5.3 (build 7) for Mac (tried with few earlier versions)
macOS Mojave 10.14 Beta (18A314h) (tried with latest stable OSX version)
OnePlus 3T w/ Android 8.0.0

Best Answer

  • jobarkejobarke US Xamurai
    Accepted Answer

    What are your settings for the properties in your Android project under Android Options?
    Do you have "Use Shared Runtime" selected?

Answers

  • DarshanJSDarshanJS USMember ✭✭✭✭

    @MadStark said:
    Hi all,

    I'm having an issue with Xamarin when deploying on my Android phone.
    When I build and deploy a Debug version to my phone, the first time it works fine, but every following times I get this error:

    [monodroid] cannot find libmonosgen-2.0.so in override_dir: /data/user/0/{bundleID}/files/.override, app_libdir: /data/app/{bundleID}-vBL7jTS-TWEXElPewrysMQ==/lib/arm64 nor in previously printed locations.
    [monodroid] Do you have a shared runtime build of your app with AndroidManifest.xml android:minSdkVersion < 10 while running on a 64-bit Android 5.0 target? This combination is not supported.
    [monodroid] Please either set android:minSdkVersion >= 10 or use a build without the shared runtime (like default Release configuration).

    Then the app crashes on start.
    The only way I've found to re-deploy it is to first uninstall the app from my phone like I would with any other app from the PlayStore.
    After doing that, it works once but crashes next time, and so on.
    Oh, and building without shared runtime doesn't solve the issue, and the android:minSdkVersion is set to "19" in my AndroidManifest.

    It is quite a frustrating issue, does anyone knows anything about this? I couldn't find anyone online having the same issue...

    Info:
    Visual Studio 7.5.3 (build 7) for Mac (tried with few earlier versions)
    macOS Mojave 10.14 Beta (18A314h) (tried with latest stable OSX version)
    OnePlus 3T w/ Android 8.0.0

    I believe, it may be because of you are trying to install app of same version which is already there in phone , you are not upgrading the version number while installing new build.

  • jobarkejobarke USXamarin Team Xamurai
    Accepted Answer

    What are your settings for the properties in your Android project under Android Options?
    Do you have "Use Shared Runtime" selected?

  • MadStarkMadStark Member
    edited June 2018

    @jobarke said:
    What are your settings for the properties in your Android project under Android Options?
    Do you have "Use Shared Runtime" selected?

    Hi! Under the Android Build tab of the Android project options, I do have "Use Shared Mono Runtime" selected and "Fast Assembly Deployment" in Debug mode too.
    The first time I tried to disable this, I got another error but in a popup this time (forgot to keep record of the error), but after re-building it finally worked, so my issue seems to be solved.
    I do not understand that option, do you recommend keeping it off?

    Thanks!

    Edit

    Well, I don't quite understand... I disabled it, it worked, I re-enabled shared runtime just to try, and it now works like that...

  • jobarkejobarke USXamarin Team Xamurai
    edited June 2018

    Well, I don't quite understand... I disabled it, it worked, I re-enabled shared runtime just to try, and it now works like that...

    @MadStark Given the error that you had - I would recommend keeping it on. I'm glad everything is working for you now! :smile:

  • varyamereonvaryamereon USMember ✭✭

    Hi @jobarke, I'm having exactly the same problem, have been for some time now. As @MadStark commented turning off Use Shared Runtime and turning it on again solves the problem. Trouble is next time the same problem again, so at the moment I either have to turn it off and on again every time or delete the app from the device before deploying.

  • T-PT-P USMember ✭✭

    Encountering the very same problem. Has anyone found a solution meanwhile?

Sign In or Register to comment.