Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xamarin Android Build Failed "Invalid value for outputAssembly"

A few days ago my solution seemed to work fine, but today all of the sudden the Android project doesn't build. I get no Error, but I do get the following output:

1>Build started.
1>Project "MyApp.Android.csproj" (Install target(s)):
1>Project "MyApp.csproj" (GetTargetFrameworks target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetTargetFrameworks target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetTargetPath target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetTargetPath target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetNativeManifest target(s)):
1>Done building project "MyApp.csproj".
1>Project "MyApp.csproj" (GetNativeManifest target(s)):
1>Done building project "MyApp.csproj".
1>"obj\Debug\MyApp.Android.dll;obj\Debug\MyApp.Android.dll" is an invalid value for the "OutputAssembly" parameter of the "Csc" task. Multiple items cannot be passed into a parameter of type "Microsoft.Build.Framework.ITaskItem".
1>Done building project "MyApp.Android.csproj" -- FAILED.
1>Build FAILED.

I also tried to delete the bin en obj folders, clean and rebuild the Solution and deleting the MyApp.Android.dll. But after the Rebuild the exact same thing happens again.

I do get the following warning:

Severity    Code    Description Project File    Line    Suppression State
Warning IDE0006 Error encountered while loading the project. Some project features, such as full solution analysis for the failed project and projects that depend on it, have been disabled.   BarApp.Android      1   Active
like image 396
JeroenM Avatar asked Dec 12 '17 10:12

JeroenM


3 Answers

You have to set your Project Linking to Sdk Assemblies Only and set support architecture to armeabi - v7 and x86.

after try to clean and rebuild the project

It work like charm.

like image 77
Harshad Pansuriya Avatar answered Nov 12 '22 08:11

Harshad Pansuriya


If you are using the portable class library (PCL) approach to organize your code between Android and iOS, you can unload the Android project by right-clicking it and selecting menu option "Unload Project" in Visual Studio. Then recompile the PCL project, reload the Android project again (right click -> "Reload Project") and rebuild the solution. This time it should give no error. Now try to run the app again on Android emulator.

You may have to also restart the emulator and uninstall the app from the emulator/device before being able to run it succesfully again.

like image 25
Ulysses Alves Avatar answered Nov 12 '22 08:11

Ulysses Alves


Open project in File Explorer, delete bin and obj file from the solution, go to the solution.

  1. Right click in droid project go to option

  2. Select Android option set your Project Linking to SDK Assemblies Only and click advanced set support architecture to armeabi-v7 and x86.

  3. Finally to clean and rebuild the project.

like image 2
Wonde_Man Avatar answered Nov 12 '22 09:11

Wonde_Man