I\'m getting the following error when trying to preview XAML documents via the Xamarin.Forms Previewer while in Visual Studio.
An Android Application proj
This problem can occur for a number of issues. Main problem is that for some reason Android's project can't build or be run inside Xamarin.
For me, the issue was that the latest JDK was not installed. My JRE was, but not JDK. Once I reinstalled JDK and restarted Visual Studio. All was well.
just check if your project structure fits the file system/ folder structure.
rename the folders to fit the project structure helped in my case.
like if your Android Shared Project name is : "AppBla.Shared" and your folder name is "App4" or something.
Check your android project and make sure the dll of your PCL/.net standard project is reference. In my own case, its referenced but shows a yellow color. I deleted the reference and re-reference by right clicking on the android project>projects>solution>select the PCL/.net standard project > ok
This solved my problem.
Update Xamarin.Forms NuGet Package
i think my solution is help this problem.
it has two problem, one is the solution path, the other one is dll reference.
I'll explain it with the example program Todo(example forum).
first, you have to clean your solution path like below png
secondly, you have to clean your all project (Todo, Todo.android, Todo.ios...)
then, you'll be able to see warning at Todo.dll(in Todo.android referense)
then, you have to delete Todo.dll
and build your Todo project then will create new dll
finally, Add it('new dll') to Todo.anroid project reference and include a Todo project in your Todo.android project(Todo.android reference add-> project -> check Todo).
and restart visual studio
None of the suggestions here worked for me. Upgrading to VS 2019 solved it.