Forum Visual Studio

How can fix "The 'GenerateJavaStubs' task failed unexpectedly." this problem?

Hi everyone, I can't debug my Xamarin Form project. I will try to debug, then comes this error. please help me.

"The "GenerateJavaStubs" task failed unexpectedly.
System.IO.FileNotFoundException: Could not load assembly 'System.ObjectModel, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. Perhaps it doesn't exist in the Mono for Android profile?
File name: 'System.ObjectModel.dll'
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference, ReaderParameters parameters)
at Java.Interop.Tools.Cecil.DirectoryAssemblyResolver.Resolve(AssemblyNameReference reference)
at Mono.Cecil.MetadataResolver.Resolve(TypeReference type)
at Mono.Cecil.TypeReference.Resolve()
at Java.Interop.Tools.Cecil.TypeDefinitionRocks.d__1.MoveNext()
at System.Linq.Enumerable.Any[TSource](IEnumerable1 source, Func2 predicate)
at Java.Interop.Tools.Cecil.TypeDefinitionRocks.IsSubclassOf(TypeDefinition type, String typeName)
at Java.Interop.Tools.JavaCallableWrappers.JavaTypeScanner.AddJavaTypes(List1 javaTypes, TypeDefinition type) at Java.Interop.Tools.JavaCallableWrappers.JavaTypeScanner.GetJavaTypes(IEnumerable1 assemblies, IAssemblyResolver resolver)
at Xamarin.Android.Tasks.GenerateJavaStubs.Run(DirectoryAssemblyResolver res)
at Xamarin.Android.Tasks.GenerateJavaStubs.Execute()
at Microsoft.Build.BackEnd.TaskExecutionHost.Microsoft.Build.BackEnd.ITaskExecutionHost.Execute()
at Microsoft.Build.BackEnd.TaskBuilder.d__26.MoveNext() SQLiteProyecto.Android "




  • MartinedoMartinedo Member ✭✭

    getting the exact same error after updating to Forms ... did you solve it?

  • TakeShikaTakeShika Member ✭✭

    Not sure if this works for everybody but I got around this by the following steps.

    1. Upgrade VS to 15.7.1 (was using 15.6)
    2. Make a new forms project. Forms will be installed by default.
    3. Update to
    4. Bring all of your code into the new project.

    Know it's not a smart way but hope this helps you.

  • MartinedoMartinedo Member ✭✭

    Yes it helped.. But sadly i lost much time :(

Sign In or Register to comment.