Xamarin Android project compilation errors after libraries upgrade

Viewed 112

I'm working on an old Xamarin project because we need to release a new IOS version of the mobile application. This required these library upgrades:

Xamarin Forms: 2.3.3.193 -> 4.8.0.1687
Xamarin Auth: 1.3.0 -> 1.7.0

After that I was forced to update also these libraries in the Android Project:

Xamarin.Android.Support.*: 28.0.0.1 -> 28.0.0.3

Now I have a lot of compilation problems in Android Project. First of all this import:

using Xamarin.Forms.Platform.Android;

now cause this error:

The type or namespace name 'Android' does not exist in the namespace 'Xamarin.Forms.Platform' (are you missing an assembly reference?)

How I can solve the issue? Now the IOS version of the project works fine but the Android version do not compile.

1 Answers

I found the issue: The problem was a double reference to the library Xamarin.Android.Support.CustomTabs (28.0.0.1 and 28.0.0.3 versions) in the .csproj file of the Android project.

I removed the old reference to 28.0.0.1 version and I solved all the build problems. Before that I tried to delete all bin/obj folders and restore all the nuget packages but without success. I don't know if this was the first step to the solution of the problem.

Related