Bug 1781 - Exception with [ContentProvider]
Summary: Exception with [ContentProvider]
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 1.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
Depends on:
Reported: 2011-10-29 18:37 UTC by Jonathan Pobst
Modified: 2011-11-02 02:38 UTC (History)
1 user (show)

Is this bug a regression?: ---
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:

Description Jonathan Pobst 2011-10-29 18:37:14 UTC
The content provide attribute causes an exception in packaging:

[ContentProvider (new string[] { "Hello" })]
class MyCP : ContentProvider

System.Exception: The "GenerateJavaStubs" task failed unexpectedly.

System.InvalidCastException: Unable to cast object of type 'Mono.Cecil.CustomAttributeArgument[]' to type 'System.String'.

   at MonoDroid.Utils.JniType.ToJniName(TypeDefinition type)
   at Xamarin.Android.Tasks.JavaTypeInfo..ctor(TypeDefinition type, String outerType)
   at Xamarin.Android.Tasks.Generator.CreateJavaSources(List`1 javaTypes, String outputPath)
   at Xamarin.Android.Tasks.GenerateJavaStubs.Execute()
Comment 2 Atsushi Eno 2011-10-31 03:06:31 UTC
Yes, it is my bug. I'm having a fix at hand, will commit once it's verified.
Comment 3 Atsushi Eno 2011-11-02 02:38:29 UTC
Fixed. (took somewhat longer, the original fix I had was wrong.)