Targeting an older version of Android

Hi. I am currently working at a project in which is targeting Android 8.1 but I got a request to make it to target version 5.1 of Android. The problem is that after I changed the target framework to 5.1 and I also changed the minimum android version and target android version to 5.1 I ran into a lot of errors.
I will post them here:

Has anyone encountered this problems ? I know that they are a lot of threads open for this kind of problem but I couldn't find an answer to work for me. Thanks

Best Answer

  • PaulNTUPaulNTU US ✭✭✭
    Accepted Answer

    It will be to do with the support libraries that are installed not being backward compatible with Monodroid51. First and most important question is, are you sure you need to target 5.1? Setting the minimum android version to 5.1 will make your application build and run on Android 5.1 devices whilst also supporting all newer devices.

    If you do need to target 5.1
    If you go into Nugget and look at all your installed libraries. For each one you can see their dependencies listed on the right, below the currently installed version. Anything that requires Monodroid above 5.1 will not work and will need to be removed and replaced with the old version that does support 5.1 or below

    Are you using Xamarin forms in your application? If so the solution maybe simply be the following

    1) Before you start, Backup your project /Check in with source repository (Always backup your project before making framework changes or updating nugget packages!)

    2) Go into nugget and uninstall all packages that reference the version 28.0.0.1 in the android support libraries.

    3) Uninstall the Xamarin forms package from your project (You could try downgrading to 2.3.3.180 here but a clean remove might be safer)

    4) Find Xamarin forms again and install it again but this time install version 2.3.3.180. This is the last version that is compatible with Monodroid V5.1

    5) Build and see what happens

Answers

  • PaulNTUPaulNTU USMember ✭✭✭
    Accepted Answer

    It will be to do with the support libraries that are installed not being backward compatible with Monodroid51. First and most important question is, are you sure you need to target 5.1? Setting the minimum android version to 5.1 will make your application build and run on Android 5.1 devices whilst also supporting all newer devices.

    If you do need to target 5.1
    If you go into Nugget and look at all your installed libraries. For each one you can see their dependencies listed on the right, below the currently installed version. Anything that requires Monodroid above 5.1 will not work and will need to be removed and replaced with the old version that does support 5.1 or below

    Are you using Xamarin forms in your application? If so the solution maybe simply be the following

    1) Before you start, Backup your project /Check in with source repository (Always backup your project before making framework changes or updating nugget packages!)

    2) Go into nugget and uninstall all packages that reference the version 28.0.0.1 in the android support libraries.

    3) Uninstall the Xamarin forms package from your project (You could try downgrading to 2.3.3.180 here but a clean remove might be safer)

    4) Find Xamarin forms again and install it again but this time install version 2.3.3.180. This is the last version that is compatible with Monodroid V5.1

    5) Build and see what happens

Sign In or Register to comment.