jamesmontemagno / Xamarin.Plugins

Cross-platform Native API Access from Shared Code!
MIT License
1.3k stars 380 forks source link

Plugin adds MainApplication class to a library project, breaking build. #234

Closed kwaclaw closed 8 years ago

kwaclaw commented 8 years ago

This is a

Which plugin does this impact:

Version Number of Plugin: 3.0.4

Expected Behavior

Builds in Visual Studio 2013

Actual Behavior

Build fails with error: The "GenerateJavaStubs" task failed unexpectedly. System.InvalidOperationException: There can be only one type with an [Application] attribute; found: ,

Steps to reproduce the Behavior

Install the plugin in a Xamarin.Android library project which is used by a Xamarin.Android application.

Note: The plugin should not add the MainApplication class to the library project!, since the application project will already have one.

jamesmontemagno commented 8 years ago

The library brings in the MainApplication.cs for the Permissions plugin:

See: https://github.com/jamesmontemagno/Xamarin.Plugins/tree/master/CurrentActivity

You can comment out this class if you already have it and implement the required interfaces like I co in MainApplication.

Sorry this is required.