Home > Back-end >  Xamarin project not launching because of reference error
Xamarin project not launching because of reference error

Time:09-22

Recently i was moved to another project in our team, the project is Xamarin desktop, android, ios application.

I installed these visual studio components:

enter image description here

When I launch the project it gives me 'The type or namespace name 'Android' could not be found' error.

enter image description here

I guess error is related to this problem with Mono.Android:

enter image description here

I tried to google this error, but non of solutions helped me. One of them was to add a reference to 'Mono.Android.dll' under C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9, but as a result i get 'this reference is invalid or unsupported'

I looked at the .csproj file and turns out 'Mono.Android.dll' reference 'Hint Path' was under C:\Program Files (x86)\Microsoft Visual Studio\2019\Enterprise\Common7\IDE\ReferenceAssemblies\Microsoft\Framework\MonoAndroid\v9 which is the same directory i was adding reference from.

This means the problem is in this file.

I Have no clue how to solve it.

CodePudding user response:

After install the related components on Visual Studio, you need to setup the Android SDKs.

Follow the steps in the link below about the Android SDK. https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-sdk?tabs=windows

And then setup Android Emulator. https://docs.microsoft.com/en-us/xamarin/android/get-started/installation/android-emulator/

  • Related