Bug 52879 - System.NullReferenceException: Object reference not set to an instance of an object.
Summary: System.NullReferenceException: Object reference not set to an instance of an ...
Status: RESOLVED NORESPONSE
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.1 (C9)
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2017-02-28 02:12 UTC by Shay
Modified: 2018-02-07 13:45 UTC (History)
5 users (show)

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


Attachments
application output (94.53 KB, text/plain)
2017-02-28 02:12 UTC, Shay
Details


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 NORESPONSE

Description Shay 2017-02-28 02:12:17 UTC
Created attachment 20027 [details]
application output

Dear Xamarin Team,

I am experiencing a system null exception on my Android devices (specifically, on two Motorola devices).
Things used to work in the past, so I suspect something have changed with default configurations?
Ways to reproduce: latest stable Xamarin (details below), create an empty Xamarin Forms project with both iOS and Android.
Compile the Android and deploy to device.
Expected behavior: see the "Welcome to Xamarin Forms!" label.
Actual behavior: Crash on system null exception before label is even shown.

System.NullReferenceException: Object reference not set to an instance of an object.
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.LayoutRootPage (Xamarin.Forms.Page page, System.Int32 width, System.Int32 height) [0x0005d] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:279
  at Xamarin.Forms.Platform.Android.AppCompat.Platform.Xamarin.Forms.Platform.Android.IPlatformLayout.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00003] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\AppCompat\Platform.cs:196
  at Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x0000e] in C:\BuildAgent3\work\ca3766cfc22354a1\Xamarin.Forms.Platform.Android\PlatformRenderer.cs:73
  at Android.Views.ViewGroup.n_OnLayout_ZIIII (System.IntPtr jnienv, System.IntPtr native__this, System.Boolean changed, System.Int32 l, System.Int32 t, System.Int32 r, System.Int32 b) [0x00009] in /Users/builder/data/lanes/4009/9578cdcd/source/monodroid/src/Mono.Android/platforms/android-23/src/generated/Android.Views.ViewGroup.cs:3427
  at at (wrapper dynamic-method) System.Object:2df30f6b-1e2f-4e06-9277-afd5ecf32d8c (intptr,intptr,bool,int,int,int,int)

Possible suspects: Warnings during compilation:

/Users/shayo/Projects/Droid/ClimbTagAppDroid.Droid.csproj: Warning XA0105: The $(TargetFrameworkVersion) for FormsViewGroup.dll (v7.0) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project. (XA0105) (ClimbTagAppDroid.Droid)

/Users/shayo/Projects/Droid/ClimbTagAppDroid.Droid.csproj: Warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.Android.dll (v7.0) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project. (XA0105) (ClimbTagAppDroid.Droid)

/Users/shayo/Projects/Droid/ClimbTagAppDroid.Droid.csproj: Warning XA0105: The $(TargetFrameworkVersion) for Xamarin.Forms.Platform.dll (v7.0) is greater than the $(TargetFrameworkVersion) for your project (v6.0). You need to increase the $(TargetFrameworkVersion) for your project. (XA0105) (ClimbTagAppDroid.Droid)



How do I get rid of those? I tried setting the target framework under Build->General to Android 6.0 Marshmallow, but I still get those. My devices are running 6.0.1 and 5.0 versions.
Minimum Android version is set to 5.0 (API 21).








=== Xamarin Studio Business ===

Version 6.2 (build 1821)
Installation UUID: 07360e74-2c80-443b-94a1-6221c776bc97
Runtime:
	Mono 4.8.0 (mono-4.8.0-branch/e4a3cf3) (64-bit)
	GTK+ 2.24.23 (Raleigh theme)

	Package version: 408000495

=== NuGet ===

Version: 3.5.0.0

=== Xamarin.Profiler ===

Version: 1.2.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler

=== Apple Developer Tools ===

Xcode 8.2.1 (11766.1)
Build 8C1002

=== Xamarin.iOS ===

Version: 10.4.0.123 (Xamarin Business)
Hash: 35d1ccd
Branch: cycle9
Build date: 2017-02-16 17:40:00-0500

=== Xamarin.Mac ===

Version: 3.0.0.393 (Xamarin Business)

=== Xamarin Inspector ===

Version: 1.1.2.0
Hash: cdc01b9
Branch: 1.1-release
Build date: Wed, 22 Feb 2017 23:24:11 GMT

=== Xamarin.Android ===

Version: 7.1.0.41 (Xamarin Business)
Android SDK: /Users/shayo/Library/Android/sdk
	Supported Android versions:
		4.0.3 (API level 15)
		4.4   (API level 19)
		5.0   (API level 21)
		5.1   (API level 22)
		6.0   (API level 23)
		7.1   (API level 25)

SDK Tools Version: 25.2.5
SDK Platform Tools Version: 25.0.3
SDK Build Tools Version: 25.0.1

Java SDK: /usr
java version "1.8.0_112"
Java(TM) SE Runtime Environment (build 1.8.0_112-b16)
Java HotSpot(TM) 64-Bit Server VM (build 25.112-b16, mixed mode)

Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL

=== Xamarin Android Player ===

Version: 0.6.5
Location: /Applications/Xamarin Android Player.app

=== Build Information ===

Release ID: 602001821
Git revision: d41b6e51f3fa46a1943f2e31a778d28a7c73d069
Build date: 2017-02-17 15:18:19-05
Xamarin addins: 1363a8d943bab7700c93a97474060b6734aa7f94
Build lane: monodevelop-lion-cycle9

=== Operating System ===

Mac OS X 10.12.2
Darwin Shays-MacBook-Pro.local 16.3.0 Darwin Kernel Version 16.3.0
    Thu Nov 17 20:23:58 PST 2016
    root:xnu-3789.31.2~1/RELEASE_X86_64 x86_64


--------- 
Application output: attached.
Comment 1 Shay 2017-02-28 02:51:57 UTC
Update: Also happens on emulator (withAndroid 7.1.1, x86_64)
Comment 2 Tom Opgenorth 2017-06-26 19:51:58 UTC
Thank you for taking the time to submit the bug. We are unable to reproduce this issue. Please attach a reproduction to the bug by starting with a clean Xamarin.Android project and adding just the code necessary to demonstrate the issue.
Comment 3 Cody Beyer (MSFT) 2017-08-23 21:08:00 UTC
Because we have not received a reply to our request for more information we are closing this issue. If you are still encountering this issue, please reopen the ticket with the requested information. Thanks!
Comment 4 Jens Eckervogt 2017-10-20 22:14:10 UTC
Hello everyone it is same bug for me

5.20 and 5.40 are bugged :(
Like  this

Unhandled Exception:
System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <2b0ee8d85e684a5bbeab417f2e0e7c82>:0
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <2b0ee8d85e684a5bbeab417f2e0e7c82>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.NullReferenceException: Object reference not set to an instance of an object
  at MakeBundle.QueueAssembly (System.Collections.Generic.List`1[T] files, System.String codebase) [0x000bc] in <2b0ee8d85e684a5bbeab417f2e0e7c82>:0
  at MakeBundle.Main (System.String[] args) [0x00d5f] in <2b0ee8d85e684a5bbeab417f2e0e7c82>:0

I always checked Mono Installation and it is OK. But it always throws errors so bad.

Please fix this! But Windows 10 x64 or x86 too :/

Thanks!