#StackBounty: #c# #android #xamarin #visual-studio-2017 #android-9.0-p Xamarin Android App Project Building Issue after Visual Studio 2…

Bounty: 50

After the upgrade of Visual Studio 2017 to 15.8.1 and with the Android SDK version 28 (supporting Android 9.0 P), we are facing issue in building our Xamarin based Android App C# project with the below error:

_LinkAssembliesNoShrink:
  Creating "obj\ObReleaseMonoAndroid90link.flag" because "AlwaysCreate" was specified.
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning : Failed to read 'D:MyAndroidAppobjObReleaseMonoAndroid90androidassetsMono.Android.dll' with debugging symbols. Retrying to load it without it. Error details are logged below. [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning : Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning : Failed to read 'D:MyAndroidAppobjObReleaseMonoAndroid90androidassetsSystem.dll' with debugging symbols. Retrying to load it without it. Error details are logged below. [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning : Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning : Failed to read 'D:MyAndroidAppobjObReleaseMonoAndroid90androidassetsSystem.Xml.dll' with debugging symbols. Retrying to load it without it. Error details are logged below. [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning : Mono.Cecil.Cil.SymbolsNotMatchingException: Symbols were found but are not matching the assembly [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadSymbols(ISymbolReader reader, Boolean throwIfSymbolsAreNotMaching) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleReader.ReadSymbols(ModuleDefinition module, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleReader.CreateModule(Image image, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadModule(Disposable`1 stream, String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.ModuleDefinition.ReadModule(String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Mono.Cecil.AssemblyDefinition.ReadAssembly(String fileName, ReaderParameters parameters) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): warning :    at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.ReadAssembly(String file) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018: The "GenerateJavaStubs" task failed unexpectedly. [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018: System.NullReferenceException: Object reference not set to an instance of an object. [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.<>c.<ToJniNameFromAttributes>b__42_0(CustomAttribute a) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at System.Linq.Enumerable.WhereSelectEnumerableIterator`2.MoveNext() [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source, Func`2 predicate) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniNameFromAttributes(TypeDefinition type) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName[T](T type, Func`2 decl, Func`2 name, Func`2 ns, Func`2 overrideName, Func`2 shouldUpdateName) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName(TypeDefinition type, ExportParameterKind exportKind) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Java.Interop.Tools.TypeNameMappings.JavaNativeTypeManager.ToJniName(TypeDefinition type) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator.GetTypeMapping(Func`2 skipType, Func`2 key, Func`2 value) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Java.Interop.Tools.JavaCallableWrappers.TypeNameMapGenerator.WriteJavaToManaged(Stream output) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Xamarin.Android.Tasks.GenerateJavaStubs.UpdateWhenChanged(String path, Action`1 generator) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Xamarin.Android.Tasks.GenerateJavaStubs.WriteTypeMappings(List`1 types) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res) [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Xamarin.Android.Tasks.GenerateJavaStubs.Execute() [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute() [D:MyAndroidApp.csproj]
C:Program Files (x86)Microsoft Visual Studio2017ProfessionalMSBuildXamarinAndroidXamarin.Android.Common.targets(2153,3): error MSB4018:    at Microsoft.Build.BackEnd.TaskBuilder.<ExecuteInstantiatedTask>d__26.MoveNext() [D:MyAndroidApp.csproj]
Done Building Project "D:MyAndroidApp.csproj" (default targets) -- FAILED.

Any clues OR any solutions OR any workarounds?

UPDATE: Even after the update of Visual Studio 2017 to 15.8.2, the issue is still there.


Get this bounty!!!

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.