Bug 35824 - AppCompat.FragmentContainer null exception on activity restart
Summary: AppCompat.FragmentContainer null exception on activity restart
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Android ()
Version: 1.5.2
Hardware: All All
: Normal major
Target Milestone: ---
Assignee: E.Z. Hart [MSFT]
URL:
Depends on:
Blocks:
 
Reported: 2015-11-12 18:39 UTC by Ahmed Hassan
Modified: 2015-11-16 06:20 UTC (History)
2 users (show)

Tags: Android ac
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 FIXED

Description Ahmed Hassan 2015-11-12 18:39:43 UTC
This is a continuation of the following bug that is affecting 1.5.1:
https://bugzilla.xamarin.com/show_bug.cgi?id=35652

This has been fixed in pre2. There is now a public default constructor. However, there is a new bug.

How to reproduce (same as before):

- Use AppCompat
- Send app to the background
- Stop app process (I used Android Device Monitor)
- Start app

Full exception message:

11-12 23:31:29.880: I/MonoDroid(2873): UNHANDLED EXCEPTION:
11-12 23:31:29.888: I/MonoDroid(2873): System.NullReferenceException: Object reference not set to an instance of an object
11-12 23:31:29.888: I/MonoDroid(2873): at Xamarin.Forms.Platform.Android.AppCompat.FragmentContainer.OnCreateView (Android.Views.LayoutInflater,Android.Views.ViewGroup,Android.OS.Bundle) <0x00011>
11-12 23:31:29.888: I/MonoDroid(2873): at Android.Support.V4.App.Fragment.n_OnCreateView_Landroid_view_LayoutInflater_Landroid_view_ViewGroup_Landroid_os_Bundle_ (intptr,intptr,intptr,intptr,intptr) <0x0009b>
11-12 23:31:29.888: I/MonoDroid(2873): at (wrapper dynamic-method) object.9717097e-84d7-42b3-99a5-7091b3f216db (intptr,intptr,intptr,intptr,intptr) <0x0003b>
11-12 23:31:29.892: I/dalvikvm(2873): Could not find method java.lang.Throwable.<init>, referenced from method md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable.<init>
11-12 23:31:29.896: I/MonoDroid(2873): UNHANDLED EXCEPTION:
11-12 23:31:29.900: I/MonoDroid(2873): System.NullReferenceException: Object reference not set to an instance of an object
11-12 23:31:29.900: I/MonoDroid(2873): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00027>
11-12 23:31:29.900: I/MonoDroid(2873): at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr) <0x000ab>
11-12 23:31:29.900: I/MonoDroid(2873): at Android.App.Activity.OnStart () <0x000db>
11-12 23:31:29.900: I/MonoDroid(2873): at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnStart () <0x00013>
11-12 23:31:29.900: I/MonoDroid(2873): at Android.App.Activity.n_OnStart (intptr,intptr) <0x00032>
11-12 23:31:29.900: I/MonoDroid(2873): at (wrapper dynamic-method) object.30c5fd2c-af48-4105-9e66-cc1252bfe251 (intptr,intptr) <0x0001f>
11-12 23:31:29.900: E/AndroidRuntime(2873): FATAL EXCEPTION: main
11-12 23:31:29.900: E/AndroidRuntime(2873): java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:553)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at dalvik.system.NativeStart.main(Native Method)
11-12 23:31:29.900: E/AndroidRuntime(2873): Caused by: java.lang.reflect.InvocationTargetException
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at java.lang.reflect.Method.invokeNative(Native Method)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at java.lang.reflect.Method.invoke(Method.java:511)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:786)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	... 2 more
11-12 23:31:29.900: E/AndroidRuntime(2873): Caused by: md52ce486a14f4bcd95899665e9d932190b.JavaProxyThrowable: System.NullReferenceException: Object reference not set to an instance of an object
11-12 23:31:29.900: E/AndroidRuntime(2873): at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () <0x00027>
11-12 23:31:29.900: E/AndroidRuntime(2873): at Android.Runtime.JNIEnv.CallNonvirtualVoidMethod (intptr,intptr,intptr) <0x000ab>
11-12 23:31:29.900: E/AndroidRuntime(2873): at Android.App.Activity.OnStart () <0x000db>
11-12 23:31:29.900: E/AndroidRuntime(2873): at Xamarin.Forms.Platform.Android.FormsAppCompatActivity.OnStart () <0x00013>
11-12 23:31:29.900: E/AndroidRuntime(2873): at Android.App.Activity.n_OnStart (intptr,intptr) <0x00032>
11-12 23:31:29.900: E/AndroidRuntime(2873): at (wrapper dynamic-method) object.30c5fd2c-af48-4105-9e66-cc1252bfe251 (intptr,intptr) <0x0001f>
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at md5282f1122c1313907b9bf274dd2c2f344.FormsAppCompatActivity.n_onStart(Native Method)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at md5282f1122c1313907b9bf274dd2c2f344.FormsAppCompatActivity.onStart(FormsAppCompatActivity.java:102)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1163)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.app.Activity.performStart(Activity.java:5018)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2032)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2084)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.app.ActivityThread.access$600(ActivityThread.java:130)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1195)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.os.Handler.dispatchMessage(Handler.java:99)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.os.Looper.loop(Looper.java:137)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	at android.app.ActivityThread.main(ActivityThread.java:4745)
11-12 23:31:29.900: E/AndroidRuntime(2873): 	... 5 more
Comment 1 Rui Marinho 2015-11-16 06:20:51 UTC
Should be fixed in 1.5.2-pre3