Bug 35744 - Android Support v4 throws Null Reference Exception when set as a ReferenceJar/EmbeddedReferenceJar
Summary: Android Support v4 throws Null Reference Exception when set as a ReferenceJar...
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: Bindings (show other bugs)
Version: 6.0.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Atsushi Eno
URL:
Depends on:
Blocks:
 
Reported: 2015-11-10 13:26 UTC by Jon Douglas [MSFT]
Modified: 2016-03-03 15:58 UTC (History)
2 users (show)

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


Attachments

Description Jon Douglas [MSFT] 2015-11-10 13:26:19 UTC
*Description:

When trying to reference the Android Support v4.jar or the respective Xamarin.Android.Support.v4 NuGet package, the respective Bindings project throws a:

Error	"generator.exe" exited with code -1073741819.	ZendeskSDK.Android	C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.targets Line 380

Further Investigation shows that the Diagnostic Build Output has a NRE:

1>   (TaskId:66)
1>  Unhandled Exception: System.NullReferenceException: Object reference not set to an instance of an object. (TaskId:66)
1>     at MonoDroid.Generation.Parameter.get_Type() (TaskId:66)
1>     at MonoDroid.Generation.GenBase.<AutoDetectEnumifiedOverrideParameters>m__8(Parameter p) (TaskId:66)
1>     at System.Linq.Enumerable.All[TSource](IEnumerable`1 source, Func`2 predicate) (TaskId:66)
1>     at MonoDroid.Generation.GenBase.AutoDetectEnumifiedOverrideParameters(MethodBase method, CodeGenerationOptions opt) (TaskId:66)
1>     at MonoDroid.Generation.GenBase.UpdateEnums(CodeGenerationOptions opt) (TaskId:66)
1>     at MonoDroid.Generation.GenBase.UpdateEnums(CodeGenerationOptions opt) (TaskId:66)
1>     at Xamarin.Android.Binder.CodeGenerator.Run(CodeGeneratorOptions options) (TaskId:66)
1>     at Xamarin.Android.Binder.CodeGenerator.Main(String[] args) (TaskId:66)
1>C:\Program Files (x86)\MSBuild\Xamarin\Android\Xamarin.Android.Bindings.targets(380,5): error MSB6006: "generator.exe" exited with code -1073741819.
1>Done executing task "BindingsGenerator" -- FAILED. (TaskId:66)
1>Done building target "GenerateBindings" in project "ZendeskSDK.Android.csproj" -- FAILED.: (TargetId:43)

Since this error message does not give any insight to the problem at hand, I believe this might be an issue in the actual Binder CodeGenerator.

*Reproduction:

https://www.dropbox.com/s/hyeripkwesd1dw4/ZendeskSDK.Android.zip?dl=0

Note: This reproduction uses the method of using "ReferenceJar/EmbeddedReferenceJar" as the build action with the android.support.v4.jar. This will also occur if you exclude the support.v4 jar from the project and add the Xamarin.Android.Support.v4 NuGet package to the project.

*Version Information:

Microsoft Visual Studio Professional 2015
Version 14.0.23107.0 D14REL
Microsoft .NET Framework
Version 4.6.00079

Installed Version: Professional

NuGet Package Manager   3.0.0
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

Xamarin   4.0.0.1649 (90e1af2)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android   6.0.0.27 (9d7074e)
Visual Studio plugin to enable development for Xamarin.Android.

Xamarin.iOS   9.2.1.21 (9ce9e8b)
Visual Studio extension to enable development for Xamarin.iOS.
Comment 1 Atsushi Eno 2015-11-11 06:06:59 UTC
The crasher is fixed in monodroid master. Thanks.

Though whenever you expose those types in the support libraries via the public members of your libraries, you should immediately stop using EmbeddedReferenceJar and switch to reference to support library binding dlls (basically you always should whenever the Java library depends on those support libs).

[master 08b50e6]
Comment 2 Atsushi Eno 2015-11-16 00:28:07 UTC
(Actually I made mistake and the mentioned commit didn't go to master; it is now [master d655d6b].)
Comment 3 Richard Massé 2016-03-03 15:24:31 UTC
Does the patch is available now, i am still unable to build my binding project.

Thanks
Richard
Comment 4 Atsushi Eno 2016-03-03 15:58:55 UTC
Our Alpha channel release should contain the fix.

Note You need to log in before you can comment on or make changes to this bug.