Bug 34060 - using global:: prefix for managedReturn in Metadata.xml causes Excepton
Summary: using global:: prefix for managedReturn in Metadata.xml causes Excepton
Status: RESOLVED ANSWERED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings ()
Version: unspecified
Hardware: All All
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2015-09-18 11:25 UTC by Miljenko Cvjetko Mel
Modified: 2015-09-18 14:36 UTC (History)
1 user (show)

Tags:
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:
Status:
RESOLVED ANSWERED

Description Miljenko Cvjetko Mel 2015-09-18 11:25:54 UTC
# Xamarin.Android Bindings Project global namespace prefix

Using global:: namespace prefix for managedReturn causes exception.

	<attr
		path="/api/package[@name='com.brightcove.player.event']/class[@name='RegisteringEventEmitter']/method[@name='build']"
		name="managedReturn"
		>
		global::Java.Lang.Object
	</attr>

Code not causing exception:

	<attr
		path="/api/package[@name='com.brightcove.player.event']/class[@name='RegisteringEventEmitter']/method[@name='build']"
		name="managedReturn"
		>
		Java.Lang.Object
	</attr>
	
	
## Exception Details

		Unhandled Exception:
		System.Exception: global::Java.Lang.Object
		  at MonoDroid.Generation.CodeGenerationOptions.GetOutputName (System.String s) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.Method.Generate (System.IO.StreamWriter sw, System.String indent, MonoDroid.Generation.CodeGenerationOptions opt, MonoDroid.Generation.GenBase type, Boolean generate_callbacks) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.ClassGen.GenMethods (System.IO.StreamWriter sw, System.String indent, MonoDroid.Generation.CodeGenerationOptions opt) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.ClassGen.Generate (System.IO.StreamWriter sw, System.String indent, MonoDroid.Generation.CodeGenerationOptions opt, MonoDroid.Generation.GenerationInfo gen_info) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.ClassGen.Generate (MonoDroid.Generation.CodeGenerationOptions opt, MonoDroid.Generation.GenerationInfo gen_info) [0x00000] in <filename unknown>:0 
		  at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options) [0x00000] in <filename unknown>:0 
		  at Xamarin.Android.Binder.CodeGenerator.Main (System.String[] args) [0x00000] in <filename unknown>:0 
		[ERROR] FATAL UNHANDLED EXCEPTION: System.Exception: global::Java.Lang.Object
		  at MonoDroid.Generation.CodeGenerationOptions.GetOutputName (System.String s) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.Method.Generate (System.IO.StreamWriter sw, System.String indent, MonoDroid.Generation.CodeGenerationOptions opt, MonoDroid.Generation.GenBase type, Boolean generate_callbacks) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.ClassGen.GenMethods (System.IO.StreamWriter sw, System.String indent, MonoDroid.Generation.CodeGenerationOptions opt) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.ClassGen.Generate (System.IO.StreamWriter sw, System.String indent, MonoDroid.Generation.CodeGenerationOptions opt, MonoDroid.Generation.GenerationInfo gen_info) [0x00000] in <filename unknown>:0 
		  at MonoDroid.Generation.ClassGen.Generate (MonoDroid.Generation.CodeGenerationOptions opt, MonoDroid.Generation.GenerationInfo gen_info) [0x00000] in <filename unknown>:0 
		  at Xamarin.Android.Binder.CodeGenerator.Run (Xamarin.Android.Binder.CodeGeneratorOptions options) [0x00000] in <filename unknown>:0 
		  at Xamarin.Android.Binder.CodeGenerator.Main (System.String[] args) [0x00000] in <filename unknown>:0 
		 (BindingsMinimalSample)  
	
## Tools affected

all
	
## References/Links

	
	
## Further Information

*	sample
	[https://github.com/moljac/Xamarin.Tools.Tests/tree/master/logs/2015-09-17%5BXamarin.Android%20-%20Bindings%20Project%20attr%20global%20namespace%20preifx%5D](https://github.com/moljac/Xamarin.Tools.Tests/tree/master/logs/2015-09-17%5BXamarin.Android%20-%20Bindings%20Project%20attr%20global%20namespace%20preifx%5D)
*	minimal sample zipped
	[https://github.com/moljac/Xamarin.Tools.Tests/blob/master/logs/2015-09-17%5BXamarin.Android%20-%20Bindings%20Project%20attr%20global%20namespace%20preifx%5D/Archive.zip](https://github.com/moljac/Xamarin.Tools.Tests/blob/master/logs/2015-09-17%5BXamarin.Android%20-%20Bindings%20Project%20attr%20global%20namespace%20preifx%5D/Archive.zip)
Comment 1 Atsushi Eno 2015-09-18 11:29:07 UTC
I don't understand what's your problem...? Just don't specify global:: which is unexpected.
Comment 2 Miljenko Cvjetko Mel 2015-09-18 12:08:15 UTC
For managed types global:: is valid prefix and even tooling is generating types with the same prefix. 

It is not a problem, but it would be nice not to get exception. Only that
Comment 3 Atsushi Eno 2015-09-18 14:36:09 UTC
Adding extraneous feature brings complexity on our product and more chance for bugs that harms customer experiences.