LoginSignup
3
4

More than 5 years have passed since last update.

[Xamarin.Forms] 「"GenerateJavaStubs" タスクが予期せずに失敗しました。」というビルドエラーが発生

Last updated at Posted at 2016-04-20

問題

VSでXamarin.FormsアプリをPCLで開発しています。
GPSのプラグインXam.Plugin.GeolocatorをnuGetで導入したところ、
下記のビルドエラーが発生しました。

"GenerateJavaStubs" タスクが予期せずに失敗しました。
System.InvalidOperationException: There can be only one type with an [Application] attribute; found: , ,

原因

Xam.Plugin.Geolocatorを導入すると同時に下記のプラグインも入ります。

  • Plugin.CurrentActivity
  • Plugin.Permissions

このPlugin.CurrentActivityが自動生成するMainApplicationクラスの中にある[Application]属性がもともとある[Application]属性と重複したのが原因です

この属性を消すか、自動追加されたクラスを削除すれば問題は解消されます。

P3PPPさんありがとう

3
4
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
4