Upgraded Xamarin Forms and Essentials to latest version and now app will not build

MikeC 21 Reputation points
2021-02-07T05:07:18.397+00:00

HI all,

I have a Xamarin Forms Android project that I developed a couple of years ago and it was using an older version of Xamarin Esssentials and Forms (can't remember the versions sorry) but now after updating both Xamarin.Essentials to v1.6.1 and Xamarin.Forms to v5.0.0.1931 in both my Forms and Android projects my app will no longer build, because it seems that Forms now requires Android 10. For now I only want to target Android 9 in my project because my phone (Nokia 8.0) will not be getting v10 but now when I try to build my solution I get this:

The $(TargetFrameworkVersion) for <myApp>.Android (v9.0) is less than the minimum required $(TargetFrameworkVersion) for Xamarin.Forms (10.0). You need to increase the $(TargetFrameworkVersion) for <myApp>.Android.

Just to see if it would build if I targeted v10 I changed the target version to 10 in my Android project but when I did it the project properties page crashed straight away and then I just get endless "object not set to an instance" errors and a "Working on it..." rotating icon that never goes away. In other words it's utterly FUBARed my project and/or solution!!!

So what can I do to get my project back to a state it will build? Do I just downgrade to an older version of Forms and Esssentials? If so how do I know what versions to downgrade to? I'm sure there must be a table somewhere showing all this but so far I can't find it.

If anyone could help I'd appreciate it - this is an app I'm revisiting to do a major revision on but right now I can't do anything because of these errors.

Xamarin
Xamarin
A Microsoft open-source app platform for building Android and iOS apps with .NET and C#.
5,293 questions
0 comments No comments
{count} votes

Accepted answer
  1. JessieZhang-MSFT 7,706 Reputation points Microsoft Vendor
    2021-02-08T03:32:10.693+00:00

    Hello,

    Welcome to our Microsoft Q&A platform!

    For now I only want to target Android 9 in my project

    As long as you do not install nuget Xamarin Forms 5.0 or higher, your app does not need Target 10.

    For example,when I Installed the following nuget, my app works properly, and the Target Framework is android 9.0.

    65118-image.png

    And when we check the Xamarin.Forms 5.0.0.1874 (5.0.0) Release Notes,we will find the Dependency Requirements:

    • Android 10 or greater should be your Target Framework
    • AndroidX is now the default for Xamarin.Forms. For guidance migrationg from Android Support to AndroidX, visit our documentation here.

    Hope it can help you.

    Best Regards,

    Jessie Zhang


    If the response is helpful, please click "Accept Answer" and upvote it.

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.


0 additional answers

Sort by: Most helpful