| Issue 9071: | Bug: NullPointerException: Resources.getConfiguration() | |
| 25 people starred this issue and may be notified of changes. | Back to list |
Android 5.1
com.google.android.gms:play-services-base:8.3.0
No additional information as the reports has been received through the Developer console.
The users do have Google Play Services installed, as the code has passed an GoogleApiAvailability.isGooglePlayServicesAvailable check.
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.llamalab.automate/com.llamalab.automate.LocationPickActivity}: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2378)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2440)
at android.app.ActivityThread.access$800(ActivityThread.java:162)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1348)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5422)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:914)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:707)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference
at android.view.SurfaceView.init(SurfaceView.java:231)
at android.view.SurfaceView.<init>(SurfaceView.java:193)
at com.google.maps.api.android.lib6.gmm6.m.cb.<init>(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.m.bw.<init>(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.c.ao.<init>(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.c.ao.a(Unknown Source)
at com.google.maps.api.android.lib6.e.bd.a(Unknown Source)
at com.google.maps.api.android.lib6.e.ev.a(Unknown Source)
at com.google.maps.api.android.lib6.e.af.a(Unknown Source)
at com.google.android.gms.maps.internal.w.onTransact(SourceFile:66)
at android.os.Binder.transact(Binder.java:380)
at com.google.android.gms.maps.a.o.a(Unknown Source)
at com.google.android.gms.maps.h.a(Unknown Source)
at com.google.android.gms.dynamic.d.a(Unknown Source)
at com.google.android.gms.dynamic.c.a(Unknown Source)
at com.google.android.gms.maps.j.f(Unknown Source)
at com.google.android.gms.maps.j.a(Unknown Source)
at com.google.android.gms.dynamic.b.a(Unknown Source)
at com.google.android.gms.dynamic.b.a(Unknown Source)
at com.google.android.gms.maps.MapView.a(Unknown Source)
at com.llamalab.automate.LocationPickActivity.onCreate(Unknown Source)
at android.app.Activity.performCreate(Activity.java:6057)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1106)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2331)
... 10 more
Jan 5, 2016
#1
[email protected]
Jan 5, 2016
Which devices have you received these reports from? (Manufacturer, model and Android OS version would be helpful.) Thanks! Have you been able to replicate this yourself? If so, when does the crash occur? (At startup when the map is loaded for the first time?)
Status:
NeedsMoreInfo
Jan 7, 2016
I am facing the same problem. My app crashes on LG V10. Please if u have any solution, suggest !
Jan 8, 2016
Android 5.1 on LG V10 Android 6.0.1 on OnePlus One A0001 Likely others. Sadly i can replicate the issue myself, nor have i found a workaround since the problem occur so deep inside Android and/or Google maps.
Jan 14, 2016
Thanks for the report, we will take a look.
Status:
Accepted
Labels: Internal-26574455
Jan 14, 2016
(No comment was entered for this change.)
Summary:
Bug: NullPointerException: Resources.getConfiguration()
(was: Bug: NullPointerException )
Feb 24, 2016
this error appears when mapview is on DialogFragment
Feb 27, 2016
Same bug device xiaomi mi4 android version 6.0.1
Feb 27, 2016
#7 is incorrect. The Activity, as seen in the stack trace, in my original post is not using a Fragment.
Feb 29, 2016
#9 +1. this bug appeared after firmware update to 6.0.1 on Xiaomi mi4
Mar 9, 2016
I'm seeing this exact stack trace as well, the last part matches exactly: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'android.content.res.Configuration android.content.res.Resources.getConfiguration()' on a null object reference at android.util.ResolutionOverride.<init>(ResolutionOverride.java:56) at android.view.SurfaceView.init(SurfaceView.java:207) at android.view.SurfaceView.<init>(SurfaceView.java:187) at com.google.maps.api.android.lib6.gmm6.m.cb.<init>(cb.java) at com.google.maps.api.android.lib6.gmm6.m.bw.<init>(bw.java) at com.google.maps.api.android.lib6.gmm6.c.ao.<init>(ao.java) at com.google.maps.api.android.lib6.gmm6.c.ao.a(ao.java) at com.google.maps.api.android.lib6.e.bd.a(bd.java) at com.google.maps.api.android.lib6.e.ev.a(ev.java) at com.google.maps.api.android.lib6.e.af.a(af.java) at com.google.android.gms.maps.internal.w.onTransact(w.java:66) On the following devices: [Brand, model, product, Android version] Sony, E5823, E5823, 6.0 lge, LG-H410, cf_global_com, 5.1.1 htc, HTC One, xenonhd_m7, 6.0.1 docomo, SO-01H, SO-01H, 6.0 It happened relatively recently, I can't find many old stack traces but I haven't looked very hard yet. It seems to affect mostly devices upgraded to 6.0 later, the Nexuses we have here don't have any issues with it. On the where: our LocationPickerActivity.onCreate instantiates a new MapView, then calls MapView.onCreate. The context has resources obviously, but when I breakpoint into SurfaceView.init, the context is an application context (DigiCalApplication in our case). I suspect that some silly ROMs return null on ApplicationContext.getResources(), that would explain the NPE. Only place I found a reference to ResolutionOverride.java is on http://review.cyanogenmod.org/#/c/116122/2/core/java/android/util/ResolutionOverride.java, seems to be a Qualcomm thing.
Mar 9, 2016
I reported this specifically to a specific application developer, with whom I was getting this exact crash after my Z5 Premium went to 6.0. In this application, one map view crashed, and the other one didn't. The one that didn't had "hardware acceleration" disabled. When it was re-enabled, it was fixed.
Mar 14, 2016
We see a huge in increase in number of crashes since sony starts rolling out android 6 to their devices. According to user reports apps crashes when entering mapview. We could not replicate so far as we do not have right device/rom. all devices: LG G4 (p1) Xperia Z5 (E6653) Mi Note (virgo) Xperia Z3+ (E6553) Xperia Z4 Tablet (SGP771) MI 3W (cancro) Xperia Z5 Compact (E5823) Xperia Z5 (E6603)
Mar 16, 2016
Same issues here Xperia Z5 Premium - update to 6.0 and got same exception when trying to use MapFragment...
Mar 16, 2016
I managed to fix the exception : I had android:hardwareAccelerated="false" in my Manifest and just changed it to true. However you need dynamic checks for coarse and fine location permissions, otherwise it crashes again.
Mar 17, 2016
android:hardwareAccelerated="true" fixed the problem. I also had to update maps lib to the newest:
compile 'com.google.android.gms:play-services-maps:8.4.0'
Mar 17, 2016
#16, #17, Yes I verified solution with Xperia Z5. android:hardwareAccelerated="true" compile 'com.google.android.gms:play-services-maps:8.4.0' android:hardwareAccelerated is true for OS level 14 and later, so many of us (developers) are avoiding this critical bug w/o knowing this. Unfortunately my app's minSdkVersion was less than 14 and suffered with this STUPID bug! Given solution saved me w/o setting minSdkVersion=14+. Phone manufacturer should test their product with much broader range of apps.
Mar 17, 2016
Those of you who are creating their MapViews dynamically, please ensure that you are initializing it with an Activity context, not the application context. For some reason I was doing the latter thing, and it resulted in the same stacktrace.
Mar 20, 2016
I can confirm the solution of daniel post #19. We also used the application context and we got the crash on a Z5. After switching to the activity context instead, everything works.
Mar 21, 2016
Can you post the code how to switching to the activity context. thanks
Mar 22, 2016
I am assuming they are talking about MapsInitializer.initialize(Activity) but this didn't work for me nor did compile 'com.google.android.gms:play-services-maps:8.4.0' with api level 15
Mar 29, 2016
#21, #22, you need to use a LayoutInflater that uses your Activity, so something along the lines of MapView mv = (MapView) LayoutInflater.from(myActivity).inflate(R.layout.mapview); This worked for me, at least. Was using the Application context, and switching to the Activity context helped. I assume that new MapView(myActivity) will work if you create your views dynamically, but I haven't tested it myself. |
|
| ► Sign in to add a comment |