Error: Unexpected task "GenerateJavaStubs"

after installing plugin.media library getting this error

Severity    Code    Description Project File    Line    Suppression State Error     The "GenerateJavaStubs" task failed unexpectedly. System.InvalidOperationException: There can be only one type with an [Application] attribute; found: ,at Xamarin.Android.Tasks.ManifestDocument.CreateApplicationElement(XElement manifest, String applicationClass, List`1 subclasses, List`1 selectedWhitelistAssemblies)at Xamarin.Android.Tasks.ManifestDocument.Merge(List`1 subclasses, List`1 selectedWhitelistAssemblies, String applicationClass, Boolean embed, String bundledWearApplicationName, IEnumerable`1 mergedManifestDocuments)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.<ExecuteInstantiatedTask>d__26.MoveNext() XamarinForms.QbChat.Android 

      

+3


source to share


3 answers


This plugin depends on https://github.com/jamesmontemagno/CurrentActivityPlugin



The current activity plugin adds the application class to your Android project. Make sure you only have one class and application attribute in your android project.

+3


source


Some plugins like plugin.media, DeviceInfo, CurrentActivity, etc. add MainApplication.cs, which contains a conflicting link between MainActivity and MainActivity that already exists.



To allow uninstallation of MainApplication.cs.

+1


source


check the build output of your project. Then you can find this System.IO.PathTooLongException: the specified path, filename, or both are too long. The full file name must be no more than 260 characters, and the directory name must be no more than 248 characters.

change it to shortcut Like C: \ dev \ project

+1


source







All Articles