Issue while updating android target version to 33 in Xamarin

parixita sakhiya 0 Reputation points
2023-09-14T12:57:18.32+00:00

I have to update android target version to 33 so trying to run my project in VS 2022 then it gives below error while in VS 2019 worked fine with android target version 28.

The imported project "/usr/local/share/dotnet/x64/sdk/6.0.414/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets" was not found. Confirm that the expression in the Import declaration "/usr/local/share/dotnet/x64/sdk/6.0.414/Microsoft/Portable/v4.5/Microsoft.Portable.CSharp.targets" is correct, and that the file exists on disk. (MSB4019)

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

1 answer

Sort by: Most helpful
  1. Graham McKechnie 316 Reputation points
    2023-09-16T02:35:37.9566667+00:00

    Going from 28 to 33 is quite a jump. i.e. Android 9 to Android 13. My advice would be to start again making a new project based on the old functionality using VS2022 Community Edition 17.7.4. If it is just Android then I'd suggest starting your new app based on Android's Navigation Component (Google's recommendation for modern Android development), which is basically a single activity with multiple fragments for each new screen. The Navigation Component as its name implies supplies the navigation.

    I've several tutorials (sample projects) on my GitHub page which should get you going in the right direction.

    You've also got to consider that Xamarin.Android development is now finished - it will be maintained till the middle of next year, so to move to Android 14 you will need a conversion path to Net7 and then Net8 (Release Candidate 1 has just been released (VS2022 17.8.0 Preview 2.0.)

    https://github.com/gmck

    0 comments No comments