Bug 17828 - [ART] ActionBarCompat throws NRE
Summary: [ART] ActionBarCompat throws NRE
Status: RESOLVED FIXED
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 4.12.0
Hardware: PC Windows
: Normal normal
Target Milestone: 4.12.3
Assignee: Jonathan Pryor
URL:
Depends on:
Blocks:
 
Reported: 2014-02-17 15:02 UTC by Peter Collins
Modified: 2014-03-26 00:03 UTC (History)
2 users (show)

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


Attachments
Repro sample (60.43 KB, application/octet-stream)
2014-02-17 15:02 UTC, Peter Collins
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 FIXED

Description Peter Collins 2014-02-17 15:02:54 UTC
Created attachment 6075 [details]
Repro sample

This is a possible duplicate of Bug #17630. The attached sample crashes with an NRE at Android.Runtime.JNIEnv.CallNonvirtualBooleanMethod when the ART runtime is enabled, and runs without issue on Dalvik.

Logcat:
https://gist.github.com/pjcollins/bf68c7e787c0b37adb6e

Environment:
Windows 8.1 x64
XA 4.12 - c292a1c2
Nexus 5 v4.4 (ART)
Comment 1 T.J. Purtell 2014-02-23 02:21:12 UTC
I was seeing "No Activity" exception using ActionBarSherlock.  Ported to ActionBarCompat and I see a Null pointer exception similar to this, but not exactly the same.  They were both with ART.  So I still can't launch my app with ART on 4.12 Beta from 2/20 ish.
Comment 2 T.J. Purtell 2014-02-23 02:40:33 UTC
ART + ActionBarCompat

>java.lang.RuntimeException: Unable to start activity ComponentInfo{mobisocial.omlet/app.droid.DeviceRegistrationActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBarActivityDelegate.onTitleChanged(java.lang.CharSequence)' on a null object reference
>	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2215)
>	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2265)
>	at android.app.ActivityThread.access$800(ActivityThread.java:145)
>	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
>	at android.os.Handler.dispatchMessage(Handler.java:102)
>	at android.os.Looper.loop(Looper.java:136)
>	at android.app.ActivityThread.main(ActivityThread.java:5081)
>	at java.lang.reflect.Method.invoke(Native Method)
>	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
>	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
>Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'void android.support.v7.app.ActionBarActivityDelegate.onTitleChanged(java.lang.CharSequence)' on a null object reference
>	at android.support.v7.app.ActionBarActivity.onTitleChanged(ActionBarActivity.java:145)
>	at android.app.Activity.onPostCreate(Activity.java:1016)
>	at android.app.Instrumentation.callActivityOnPostCreate(Instrumentation.java:1150)
>	at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2188)
>	... 9 more
>	
>	
>	
ART + ActionBarSherlock

>java.lang.RuntimeException: Unable to resume activity {mobisocial.omlet/app.droid.DeviceRegistrationActivity}: java.lang.IllegalStateException: No activity
>	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2808)
>	at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:2837)
>	at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2270)
>	at android.app.ActivityThread.access$800(ActivityThread.java:145)
>	at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1206)
>	at android.os.Handler.dispatchMessage(Handler.java:102)
>	at android.os.Looper.loop(Looper.java:136)
>	at android.app.ActivityThread.main(ActivityThread.java:5081)
>	at java.lang.reflect.Method.invoke(Native Method)
>	at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:781)
>	at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:597)
>Caused by: java.lang.IllegalStateException: No activity
>	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1075)
>	at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1070)
>	at android.support.v4.app.FragmentManagerImpl.dispatchResume(FragmentManager.java:1871)
>	at android.support.v4.app.FragmentActivity.onResumeFragments(FragmentActivity.java:455)
>	at android.support.v4.app.FragmentActivity.onPostResume(FragmentActivity.java:444)
>	at com.actionbarsherlock.app.SherlockFragmentActivity.onPostResume(SherlockFragmentActivity.java:69)
>	at android.app.Activity.performResume(Activity.java:5323)
>	at android.app.ActivityThread.performResumeActivity(ActivityThread.java:2798)
>	... 10 more

Device is a Galaxy Nexus, CyanogenMod 4.4.2
Comment 3 Jonathan Pryor 2014-03-26 00:03:09 UTC
This should have been fixed in monodroid-4.12-series/588b8444, aka 4.12.2-2, and is included in 4.12.3.