Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #532

Closed
Greeeeyyyss opened this issue Jul 15, 2019 · 31 comments · Fixed by #731 or #856
Closed

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #532

Greeeeyyyss opened this issue Jul 15, 2019 · 31 comments · Fixed by #731 or #856
Assignees
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. released on @chris/fix/858 released type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Milestone

Comments

@Greeeeyyyss
Copy link
Contributor

Greeeeyyyss commented Jul 15, 2019

Summary:

The map randomly crashes while setting up the cluster manager and rendering the clusters.

Steps to reproduce:
This is happening intermittently so it is hard to reproduce. See logs for more details.

Crashlytics Logs

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f08005e at android.content.res.ResourcesImpl.getValueForDensity + 240(ResourcesImpl.java:240) at android.content.res.Resources.getDrawableForDensity + 885(Resources.java:885) at android.content.res.Resources.getDrawable + 828(Resources.java:828) at android.content.res.Resources.getDrawable + 803(Resources.java:803) at com.google.maps.android.ui.BubbleDrawable.(BubbleDrawable.java:3) at com.google.maps.android.ui.IconGenerator.(IconGenerator.java:3) at com.google.maps.android.clustering.view.DefaultClusterRenderer.(DefaultClusterRenderer.java:12) at com.google.maps.android.clustering.ClusterManager.(ClusterManager.java:9) at com.google.maps.android.clustering.ClusterManager.(ClusterManager.java:9) at com.ojoelectric.ojo.ui.map.ScooterMapFragment.onMapReady + 179(ScooterMapFragment.java:179) at com.google.android.gms.maps.zzak.zza(zzak.java:1) at com.google.android.gms.maps.internal.zzaq.dispatchTransaction(zzaq.java:1) at com.google.android.gms.internal.maps.zzb.onTransact + 22(zzb.java:22) at android.os.Binder.transact + 656(Binder.java:656) at hq.b + 14(hq.java:14) at com.google.android.gms.maps.internal.be.a + 4(be.java:4) at com.google.maps.api.android.lib6.impl.bj.run + 4(bj.java:4) at android.os.Handler.handleCallback + 790(Handler.java:790) at android.os.Handler.dispatchMessage + 99(Handler.java:99) at android.os.Looper.loop + 175(Looper.java:175) at android.app.ActivityThread.main + 6724(ActivityThread.java:6724) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run + 438(RuntimeInit.java:438) at com.android.internal.os.ZygoteInit.main + 810(ZygoteInit.java:810)

Device and Android version:

  • LG Premiere Pro and LG Stylo 4 (8.1.0)

  • Galaxy J7 Crown (8.0) and Galaxy S8+ (7.1.2) and Galaxy Tab E 8.0 (7.1.1)

  • ZTE ZFive C LTE (7.1.1) and Z999 (7.1.2)

  • OnePlus 5T and OnePlus 6 (9.0)

  • Pixel XL (9.0)

  • AlcatelOneTouch (7.0)

  • XiaoMi 5 (8.0)

  • Coolpad Legacy (9.0)

I am using the following google map dependencies:

ext.googlePlayServicesVersion = "16.0.0"

implementation "com.google.android.gms:play-services-location:$googlePlayServicesVersion"
implementation "com.google.android.gms:play-services-maps:$googlePlayServicesVersion"
kapt "com.google.android.gms:play-services-maps:$googlePlayServicesVersion"
implementation 'com.google.maps.android:android-maps-utils:0.5'
@stale
Copy link

stale bot commented Oct 3, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the status: will not fix Invalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap. label Oct 3, 2019
@jpoehnelt jpoehnelt removed the status: will not fix Invalid (untrue/unsound/erroneous), inconsistent with product, not on roadmap. label Oct 3, 2019
@Greeeeyyyss
Copy link
Contributor Author

Any update?

@dmitriisoloviof
Copy link

still receiving this error:
Nexus 6 (Android 7.1)
OnePlus GM1910 (Android 9)

@Greeeeyyyss
Copy link
Contributor Author

It also occurs in these devices.

Nexus 4 (Android 8.10)
Moto E4 (Android 7.1.1)

@SangeetaNG
Copy link

Any Updates on this? Even I'm getting the same crash in VIVO devices

Any solution available?

@barbeau barbeau added the priority: p0 Highest priority. Critical issue. P0 implies highest priority. label Oct 31, 2019
@barbeau
Copy link
Collaborator

barbeau commented Oct 31, 2019

It looks like the root cause of this may be that in BubbleDrawable, the shadow and mask PNG resources are only defined in the drawable-xhdpi and drawable-xxhdpi folders:
https://github.com/googlemaps/android-maps-utils/tree/master/library/src/main/res

The Android resources docs say:

Caution: When defining an alternative resource, make sure you also define the resource in a default configuration. Otherwise, your app might encounter runtime exceptions when the device changes a configuration. For example, if you add a string to only values-en and not values, your app might encounter a Resource Not Found exception when the user changes the default system language.

I'm guessing in some cases Android is trying to load the resources at densities other than xhdpi or xxhdpi, and as a result there isn't a default resource to load, and therefore it throws the Resources$NotFoundException.

A counter argument to this theory is that further down the docs also say:

There is one exception to this rule: If your app's minSdkVersion is 4 or greater, you don't need default drawable resources when you provide alternative drawable resources with the screen density qualifier. Even without default drawable resources, Android can find the best match among the alternative screen densities and scale the bitmaps as necessary. However, for the best experience on all types of devices, you should provide alternative drawables for all three types of density.

A potential complicating factor is that Drawable getDrawable (int id) was deprecated in API level 22, with getDrawable(int, Theme) replacing it. There is also ContextCompat.getDrawable() in the Android X library.

So, perhaps the deprecated implementation isn't properly handling resource scaling in all cases, even though the Android docs say it should work?

Instead of adding additional PNGs in the default folder which would increase the size of the library, I'm going to try fixing this at first by changing to using ContextCompat.getDrawable().

I'll open a PR with this fix shortly. If this doesn't fix it, we can add the PNGs in the default resource directory.

@barbeau barbeau added the type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns. label Oct 31, 2019
pauminku added a commit to pauminku/android-maps-utils that referenced this issue Nov 26, 2019
* googleOrigin/master: (107 commits)
  Remove unnecessary interface method public modifiers. (googlemaps#587)
  Remove unnecessary primitives boxing. (googlemaps#586)
  Fix googlemaps#575 - Change Travis config, use matrix of API emulators (googlemaps#585)
  Retain the bitmap cache (googlemaps#381)
  Made GeoJsonParser with parseGeometry public to use the parser standalone. (googlemaps#492)
  Fix googlemaps#570 - Use project GitHub URL for remote KML loading demo (googlemaps#581)
  Bump Gradle plugin for Android Studio v3.5.2 (googlemaps#574)
  Fix googlemaps#575 - Use API 26 emulator instead of API 28 (googlemaps#576)
  Fix googlemaps#371 - Run emulator-based unit tests on Travis (googlemaps#573)
  Fix googlemaps#371 - Run emulator-based unit tests on Travis (googlemaps#573)
  Fix googlemaps#532 - Use ContextCompat to load drawable resources for scaling (googlemaps#571)
  Change test methods visibility (googlemaps#569)
  Release 0.6.2 (googlemaps#568)
  Demo clustering with ViewModel (googlemaps#506)
  Differentiate between initial start and configuration change restore (googlemaps#567)
  Fix wrapping around IDL (googlemaps#564)
  Update Gradle wrapper to 5.6.3 (googlemaps#566)
  Add MaxIntensity functionality for user defined intensities on HeatMapTiles (googlemaps#499)
  Use float zoom to calculate visible bounds (googlemaps#483)
  Remove apklib publishing (googlemaps#563)
  ...

# Conflicts:
#	library/src/androidTest/java/com/google/maps/android/PolyUtilTest.java
@arriolac arriolac added this to the 1.0 milestone Feb 24, 2020
@Greeeeyyyss
Copy link
Contributor Author

Greeeeyyyss commented May 20, 2020

Hi @barbeau ! This issue occurred again on one of our user using Galaxy S10e (7.1.2) even though we are using the latest version. I think the log is almost similar to the previous one I posted. See:

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f080060 at android.content.res.ResourcesImpl.getValue(ResourcesImpl.java:190) at android.content.res.Resources.getDrawable(Resources.java:770) at android.content.Context.getDrawable(Context.java:525) at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:455) at com.google.maps.android.ui.BubbleDrawable.<init>(BubbleDrawable.java:43) at com.google.maps.android.ui.IconGenerator.<init>(IconGenerator.java:60) at com.google.maps.android.clustering.view.DefaultClusterRenderer.<init>(DefaultClusterRenderer.java:132) at com.google.maps.android.clustering.ClusterManager.<init>(ClusterManager.java:76) at com.google.maps.android.clustering.ClusterManager.<init>(ClusterManager.java:68) at com.ojoelectric.ojo.ui.map.ScooterMapFragment.onMapReady(ScooterMapFragment.java:199) at com.google.android.gms.maps.zzak.zza(zzak.java:2) at com.google.android.gms.maps.internal.zzaq.dispatchTransaction(zzaq.java:12) at com.google.android.gms.internal.maps.zzb.onTransact(zzb.java:12) at android.os.Binder.transact(Binder.java:499) at ck.b(ck.java:2) at com.google.maps.api.android.lib6.impl.be.run(be.java:2) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6131) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:892) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:782)

@barbeau
Copy link
Collaborator

barbeau commented May 20, 2020

@Greeeeyyyss Thanks for the update, I'm re-opening.

@arriolac Do you have any insight on this issue? See my notes in #532 (comment) - Android docs say we shouldn't have to provide a default drawable resource if minSdkVersion is 4 or greater, but it seems that without one (and even with the latest compat libraries) we're getting a Resources$NotFoundException in some cases.

My next steps for fixing would be to add a copy of the PNGs drawables in the default resource folder, although I was trying to avoid this if possible given it will increase the size of the library. So any other ideas are welcome!

@barbeau barbeau reopened this May 20, 2020
@barbeau barbeau added priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. and removed priority: p0 Highest priority. Critical issue. P0 implies highest priority. labels May 20, 2020
@arriolac
Copy link
Contributor

@barbeau the solution you proposed would be how I'd fix this as well although you are correct that the system should be able to find the resource even w/o providing a default drawable resource by using either the xhdpi or xxhdpi asset and scaling it to match the device's density.

@Greeeeyyyss is the app distributed as an aab? Looks like there are some cases where this exception might be thrown as outlined in the Android App Bundle docs Known issues.

@Greeeeyyyss
Copy link
Contributor Author

@arriolac yes we are using Android App Bundle when publishing our app

barbeau added a commit that referenced this issue May 21, 2020
This should avoid Resources$NotFoundException, possibly due to app being distributed as an Android App Bundle.

Fixes #532
barbeau added a commit that referenced this issue May 27, 2020
This should avoid Resources$NotFoundException, possibly due to app being distributed as an Android App Bundle.

Fixes #532
googlemaps-bot pushed a commit that referenced this issue May 27, 2020
## [1.3.2](v1.3.1...v1.3.2) (2020-05-27)

### Bug Fixes

* Copy xhdpi resources into default drawable folder ([#731](#731)) ([469ccb7](469ccb7)), closes [#532](#532)
@googlemaps-bot
Copy link
Contributor

🎉 This issue has been resolved in version 1.3.2 🎉

The release is available on GitHub release

Your semantic-release bot 📦🚀

@seventhmoon
Copy link

seventhmoon commented May 27, 2020

Want to confirm something here. For the reported issue, is the app installed by Google Play?

You mentioned you are publishing using AAB
There are some website providing APK files, those provided APK files are extracted from devices and may not fit the installing machine, result as ResourceNotFoundException.

Want to make sure it is not the case.

And, yes. Default resource for drawable is not required. And this is common for Android TV applications. (only providing images in 2 dpi levels)

@arriolac
Copy link
Contributor

I'm seeing some issues with publishing the .aar for this version. Will update here once it's live.

@arriolac
Copy link
Contributor

arriolac commented May 27, 2020

Changes introduced in PR #731 is live on version 1.3.3 on Maven.

@Greeeeyyyss
Copy link
Contributor Author

@seventhmoon this issue happened on production and we are only distributing it in Google Play.

@barbeau @arriolac I have pointed our app's map library version to 1.3.3. Thank you for the fix!

@GuilhE
Copy link

GuilhE commented Nov 17, 2020

Found this today in a Pixel 3A (Android 11 API 30) using play_services_maps 17.0.0 and android_maps_utils 2.1.0:

android.content.res.Resources$NotFoundException: Resource ID #0x7f060016 type #0x3 is not valid
        at android.content.res.Resources.getDimensionPixelSize(Resources.java:827)
        at com.google.maps.api.android.lib6.impl.av.n(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):5)
        at com.google.maps.api.android.lib6.impl.fd.<init>(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):6)
        at com.google.maps.api.android.lib6.impl.bm.ay(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):14)
        at com.google.maps.api.android.lib6.impl.cx.c(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):2)
        at com.google.android.gms.maps.internal.q.aW(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):15)
        at dn.onTransact(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):4)
        at android.os.Binder.transact(Binder.java:1043)
        at com.google.android.gms.internal.maps.zza.zzb(Unknown Source:20)
        at com.google.android.gms.maps.internal.zzk.onCreate(Unknown Source:17)
        at com.google.android.gms.maps.MapView$zza.onCreate(Unknown Source:8)
        at com.google.android.gms.dynamic.zad.zaa(com.google.android.gms:play-services-base@@17.3.0:3)
        at com.google.android.gms.dynamic.zab.onDelegateCreated(com.google.android.gms:play-services-base@@17.3.0:4)
        at com.google.android.gms.maps.MapView$zzb.createDelegate(Unknown Source:16)
        at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaa(com.google.android.gms:play-services-base@@17.3.0:18)
        at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(com.google.android.gms:play-services-base@@17.3.0:22)
        at com.google.android.gms.maps.MapView.onCreate(Unknown Source:26)

First time ever happened, same use case as the author.
Build > Clean Project fixed the issue (so far).

@gpouzerate
Copy link

Got this exception today in firebase on a Galaxy S21 Ultra 5G.
App distributed on Google Play with an app bundle.

Using following dependencies:

  • com.google.android.gms:play-services-maps:17.0.0
  • com.google.maps.android:android-maps-utils:2.2.0

Stack:

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f07005c
at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:290)
at android.content.res.Resources.getDrawableForDensity(Resources.java:1045)
at android.content.res.Resources.getDrawable(Resources.java:985)
at android.content.Context.getDrawable(Context.java:697)
at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:455)
at com.google.maps.android.ui.BubbleDrawable.(BubbleDrawable.java:43)
at com.google.maps.android.ui.IconGenerator.(IconGenerator.java:60)
at com.google.maps.android.clustering.view.DefaultClusterRenderer.(DefaultClusterRenderer.java:138)
at com.google.maps.android.clustering.ClusterManager.(ClusterManager.java:78)
at com.google.maps.android.clustering.ClusterManager.(ClusterManager.java:70)
at no.ok.it.oslonokkel.ui.map.MapFragment.onMapReady(MapFragment.java:76)
at com.google.android.gms.maps.zzak.zza(zzak.java:2)
at com.google.android.gms.maps.internal.zzaq.dispatchTransaction(zzaq.java:12)
at com.google.android.gms.internal.maps.zzb.onTransact(zzb.java:12)
at android.os.Binder.transact(Binder.java:1079)
at dp.aZ(dp.java:2)
at com.google.maps.api.android.lib6.impl.bk.run(bk.java:1)
at android.os.Handler.handleCallback(Handler.java:938)
at android.os.Handler.dispatchMessage(Handler.java:99)
at android.os.Looper.loop(Looper.java:246)
at android.app.ActivityThread.main(ActivityThread.java:8456)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:596)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1130)

@barbeau
Copy link
Collaborator

barbeau commented Apr 15, 2021

Thanks for the report @gpouzerate, re-opening.

Given the above crash happened on a Galaxy S21 Ultra 5G, which should be an xxxhdpi display, we could try the same approach as PR #731 and copy the icons into the drawable-xxxhdpi folder as well.

@arriolac Any thoughts or wisdom on this?

It looks like the App Bundles page has changed since your comment in #532 (comment), and the "Known Issues" section is now "Other considerations":
https://developer.android.com/guide/app-bundle/#other_considerations

...and it looks like partial installs of sideloaded apps using AABs should now fail on Android 10 and higher, which would include the Galaxy S21 Ultra 5G. So a side-loaded app shouldn't be the cause of this exception.

@barbeau barbeau reopened this Apr 15, 2021
@arriolac
Copy link
Contributor

@barbeau can't think of another workaround for this—the approach to create a drawable-xxxhdpi makes sense to me.

barbeau added a commit that referenced this issue Apr 15, 2021
barbeau added a commit that referenced this issue Apr 15, 2021
@barbeau
Copy link
Collaborator

barbeau commented Apr 15, 2021

👍 PR at #856

barbeau added a commit that referenced this issue Apr 16, 2021
googlemaps-bot pushed a commit that referenced this issue Apr 28, 2021
## [2.2.3](v2.2.2...v2.2.3) (2021-04-28)

### Bug Fixes

* Copy drawables to drawable-xxxhdpi ([#856](#856)) ([8b55e18](8b55e18)), closes [#532](#532)
* Fix MultipleArtifactsNotFoundException ([1d0e062](1d0e062))
@googlemaps-bot
Copy link
Contributor

🎉 This issue has been resolved in version 2.2.3 🎉

The release is available on:

Your semantic-release bot 📦🚀

@Andy-Cuong
Copy link

Hello, I also encountered this exception when trying to setting up cluster manager. I was running the app on emulator Pixel 4 API 31. After that, I tried to remove all the part of the clustering stuff and only animate the camera to a random location, but this still happened although I did not touch anything regarding cluster manager

android.content.res.Resources$NotFoundException: Resource ID #0x7f070016 type #0x3 is not valid
    at android.content.res.Resources.getDimensionPixelSize(Resources.java:827)
    at com.google.maps.api.android.lib6.impl.ax.d(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):5)
    at com.google.maps.api.android.lib6.impl.fh.<init>(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):6)
    at com.google.maps.api.android.lib6.impl.bo.az(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):16)
    at com.google.maps.api.android.lib6.impl.cr.o(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):2)
    at com.google.android.gms.maps.internal.o.aX(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):19)
    at dx.onTransact(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):4)
    at android.os.Binder.transact(Binder.java:1064)
    at com.google.android.gms.internal.maps.zza.zzH(com.google.android.gms:play-services-maps@@18.0.0:2)
    at com.google.android.gms.maps.internal.zzk.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:5)
    at com.google.android.gms.maps.zzau.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:7)
    at com.google.android.gms.dynamic.zad.zab(com.google.android.gms:play-services-base@@18.0.1:2)
    at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.0.1:1)
    at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreateView(com.google.android.gms:play-services-base@@18.0.1:2)
    at com.google.android.gms.maps.SupportMapFragment.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:1)
    at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
    at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
    at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
    at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
    at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
    at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
    at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
    at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
    at android.app.Activity.performStart(Activity.java:8076)
    at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3660)
    at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
    at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7839)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

@Blast9u
Copy link

Blast9u commented Jun 21, 2022

Hello, I also encountered this exception when trying to setting up cluster manager. I was running the app on emulator Pixel 4 API 31. After that, I tried to remove all the part of the clustering stuff and only animate the camera to a random location, but this still happened although I did not touch anything regarding cluster manager

android.content.res.Resources$NotFoundException: Resource ID #0x7f070016 type #0x3 is not valid
    at android.content.res.Resources.getDimensionPixelSize(Resources.java:827)
    at com.google.maps.api.android.lib6.impl.ax.d(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):5)
    at com.google.maps.api.android.lib6.impl.fh.<init>(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):6)
    at com.google.maps.api.android.lib6.impl.bo.az(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):16)
    at com.google.maps.api.android.lib6.impl.cr.o(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):2)
    at com.google.android.gms.maps.internal.o.aX(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):19)
    at dx.onTransact(:com.google.android.gms.dynamite_mapsdynamite@214218120@21.42.18 (190800-0):4)
    at android.os.Binder.transact(Binder.java:1064)
    at com.google.android.gms.internal.maps.zza.zzH(com.google.android.gms:play-services-maps@@18.0.0:2)
    at com.google.android.gms.maps.internal.zzk.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:5)
    at com.google.android.gms.maps.zzau.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:7)
    at com.google.android.gms.dynamic.zad.zab(com.google.android.gms:play-services-base@@18.0.1:2)
    at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.0.1:1)
    at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreateView(com.google.android.gms:play-services-base@@18.0.1:2)
    at com.google.android.gms.maps.SupportMapFragment.onCreateView(com.google.android.gms:play-services-maps@@18.0.0:1)
    at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
    at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
    at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
    at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
    at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
    at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
    at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
    at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
    at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
    at androidx.appcompat.app.AppCompatActivity.onStart(AppCompatActivity.java:246)
    at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1455)
    at android.app.Activity.performStart(Activity.java:8076)
    at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3660)
    at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
    at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
    at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2210)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loopOnce(Looper.java:201)
    at android.os.Looper.loop(Looper.java:288)
    at android.app.ActivityThread.main(ActivityThread.java:7839)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1003)

Hey man, I found the solution in this video. Thanks to the youtuber :)
https://www.youtube.com/watch?v=1WBMnhrimKM&t=132s&ab_channel=CodingTony

@WeaChris
Copy link

Found this today in a Pixel 3A (Android 11 API 30) using play_services_maps 17.0.0 and android_maps_utils 2.1.0:

android.content.res.Resources$NotFoundException: Resource ID #0x7f060016 type #0x3 is not valid
        at android.content.res.Resources.getDimensionPixelSize(Resources.java:827)
        at com.google.maps.api.android.lib6.impl.av.n(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):5)
        at com.google.maps.api.android.lib6.impl.fd.<init>(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):6)
        at com.google.maps.api.android.lib6.impl.bm.ay(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):14)
        at com.google.maps.api.android.lib6.impl.cx.c(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):2)
        at com.google.android.gms.maps.internal.q.aW(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):15)
        at dn.onTransact(:com.google.android.gms.dynamite_mapsdynamite@204215097@20.42.15 (150400-0):4)
        at android.os.Binder.transact(Binder.java:1043)
        at com.google.android.gms.internal.maps.zza.zzb(Unknown Source:20)
        at com.google.android.gms.maps.internal.zzk.onCreate(Unknown Source:17)
        at com.google.android.gms.maps.MapView$zza.onCreate(Unknown Source:8)
        at com.google.android.gms.dynamic.zad.zaa(com.google.android.gms:play-services-base@@17.3.0:3)
        at com.google.android.gms.dynamic.zab.onDelegateCreated(com.google.android.gms:play-services-base@@17.3.0:4)
        at com.google.android.gms.maps.MapView$zzb.createDelegate(Unknown Source:16)
        at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaa(com.google.android.gms:play-services-base@@17.3.0:18)
        at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(com.google.android.gms:play-services-base@@17.3.0:22)
        at com.google.android.gms.maps.MapView.onCreate(Unknown Source:26)

First time ever happened, same use case as the author. Build > Clean Project fixed the issue (so far).

Worked for me

@realh
Copy link

realh commented Mar 1, 2023

Please reopen this issue, because I still keep getting this error (the Resource ID #0x7f060016 type #0x3 is not valid version). I'm using Compose, so I commented on googlemaps/android-maps-compose#222 first. I'm not using clustering.

@Semper-Viventem
Copy link

Hello, I can see the same issue in map utils version 2.4.0

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f080096
       at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:249)
       at android.content.res.Resources.getDrawableForDensity(Resources.java:1047)
       at android.content.res.Resources.getDrawable(Resources.java:987)
       at android.content.Context.getDrawable(Context.java:758)
       at androidx.core.content.ContextCompat$Api21Impl.getDrawable(ContextCompat.java:1012)
       at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:522)
       at com.google.maps.android.ui.BubbleDrawable.<init>(BubbleDrawable.java:43)
       at com.google.maps.android.ui.IconGenerator.<init>(IconGenerator.java:60)
       at com.google.maps.android.clustering.view.DefaultClusterRenderer.<init>(DefaultClusterRenderer.java:140)
       at com.google.maps.android.clustering.ClusterManager.<init>(ClusterManager.java:78)
       at com.google.maps.android.clustering.ClusterManager.<init>(ClusterManager.java:70)

@qamarsafadi1
Copy link

Issue still happening in Compose,

Last version 2.11.4

FATAL EXCEPTION: main Process: com.selsela.food, PID: 2140 android.content.res.Resources$NotFoundException: Resource ID #0x7f070016 type #0x3 is not valid at android.content.res.Resources.getDimensionPixelSize(Resources.java:875) at com.google.maps.api.android.lib6.impl.ay.d(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):5) at com.google.maps.api.android.lib6.impl.fc.<init>(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):6) at com.google.maps.api.android.lib6.impl.bk.aD(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):15) at com.google.maps.api.android.lib6.impl.cu.d(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):2) at com.google.android.gms.maps.internal.q.bb(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):21) at ff.onTransact(:com.google.android.gms.dynamite_mapsdynamite@231613044@23.16.13 (190400-0):4) at android.os.Binder.transact(Binder.java:1169) at com.google.android.gms.internal.maps.zza.zzc(com.google.android.gms:play-services-maps@@18.1.0:2) at com.google.android.gms.maps.internal.zzl.onCreate(com.google.android.gms:play-services-maps@@18.1.0:3) at com.google.android.gms.maps.zzag.onCreate(com.google.android.gms:play-services-maps@@18.1.0:3) at com.google.android.gms.dynamic.zac.zab(com.google.android.gms:play-services-base@@18.1.0:1) at com.google.android.gms.dynamic.zaa.onDelegateCreated(com.google.android.gms:play-services-base@@18.1.0:3) at com.google.android.gms.maps.zzah.zzb(com.google.android.gms:play-services-maps@@18.1.0:5) at com.google.android.gms.maps.zzah.createDelegate(com.google.android.gms:play-services-maps@@18.1.0:1) at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.1.0:6) at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreate(com.google.android.gms:play-services-base@@18.1.0:1) at com.google.android.gms.maps.MapView.onCreate(com.google.android.gms:play-services-maps@@18.1.0:4) at com.google.maps.android.compose.GoogleMapKt.lifecycleObserver$lambda$11(GoogleMap.kt:204) at com.google.maps.android.compose.GoogleMapKt.$r8$lambda$Vm6abttjyrD0BNPAw0a-nOgtk1E(Unknown Source:0) at com.google.maps.android.compose.GoogleMapKt$$ExternalSyntheticLambda0.onStateChanged(Unknown Source:4) at androidx.lifecycle.LifecycleRegistry$ObserverWithState.dispatchEvent(LifecycleRegistry.kt:314) at androidx.lifecycle.LifecycleRegistry.addObserver(LifecycleRegistry.kt:192) at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:179) at com.google.maps.android.compose.GoogleMapKt$MapLifecycle$1.invoke(GoogleMap.kt:175) at androidx.compose.runtime.DisposableEffectImpl.onRemembered(Effects.kt:82) at androidx.compose.runtime.CompositionImpl$RememberEventDispatcher.dispatchRememberObservers(Composition.kt:1137) at androidx.compose.runtime.CompositionImpl.applyChangesInLocked(Composition.kt:828) at androidx.compose.runtime.CompositionImpl.applyChanges(Composition.kt:849) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:622) at androidx.compose.runtime.Recomposer$runRecomposeAndApplyChanges$2$1.invoke(Recomposer.kt:536) at androidx.compose.ui.platform.AndroidUiFrameClock$withFrameNanos$2$callback$1.doFrame(AndroidUiFrameClock.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher.performFrameDispatch(AndroidUiDispatcher.android.kt:109) at androidx.compose.ui.platform.AndroidUiDispatcher.access$performFrameDispatch(AndroidUiDispatcher.android.kt:41) at androidx.compose.ui.platform.AndroidUiDispatcher$dispatchCallback$1.doFrame(AndroidUiDispatcher.android.kt:69) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1449) at android.view.Choreographer$CallbackRecord.run(Choreographer.java:1459) at android.view.Choreographer.doCallbacks(Choreographer.java:1089) 2140-2140 AndroidRuntime com.selsela.food E at android.view.Choreographer.doFrame(Choreographer.java:998) at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:1431) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:211) at android.os.Looper.loop(Looper.java:300) at android.app.ActivityThread.main(ActivityThread.java:8296) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:559) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:954) Suppressed: kotlinx.coroutines.DiagnosticCoroutineContextException: [androidx.compose.runtime.PausableMonotonicFrameClock@6504c20, androidx.compose.ui.platform.MotionDurationScaleImpl@82259d9, StandaloneCoroutine{Cancelling}@4d68f9e, AndroidUiDispatcher@1517a7f]

@jordan819
Copy link

Same here in library version 3.4.0, the device is Vivo V21 5G(Android 13)

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f070055 at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:353) at android.content.res.Resources.getDrawableForDensity(Resources.java:1078) at android.content.res.Resources.getDrawable(Resources.java:1018) at android.content.Context.getDrawable(Context.java:810) at androidx.core.content.ContextCompat$Api21Impl.getDrawable(ContextCompat.java:864) at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java:483) at com.google.maps.android.ui.BubbleDrawable.<init>(BubbleDrawable.java:42) at com.google.maps.android.ui.IconGenerator.<init>(IconGenerator.java:60) at com.google.maps.android.clustering.view.DefaultClusterRenderer.<init>(DefaultClusterRenderer.java:141) at com.google.maps.android.clustering.ClusterManager.<init>(ClusterManager.java:80) at com.google.maps.android.clustering.ClusterManager.<init>(ClusterManager.java:72) at pl.dominium.base.util.map.presenter.base.ClusterMapPresenter.onMapReady(ClusterMapPresenter.kt:37) at com.google.android.gms.maps.zzaf.zzb(com.google.android.gms:play-services-maps@@18.1.0:1) at com.google.android.gms.maps.internal.zzar.zza(com.google.android.gms:play-services-maps@@18.1.0:6) at com.google.android.gms.internal.maps.zzb.onTransact(com.google.android.gms:play-services-maps@@18.1.0:3) at android.os.Binder.transact(Binder.java:1184) at fe.c(:com.google.android.gms.dynamite_mapsdynamite@232216044@23.22.16 (190400-0):2) at com.google.maps.api.android.lib6.impl.bg.run(:com.google.android.gms.dynamite_mapsdynamite@232216044@23.22.16 (190400-0):2) at android.os.Handler.handleCallback(Handler.java:942) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loopOnce(Looper.java:223) at android.os.Looper.loop(Looper.java:324) at android.app.ActivityThread.main(ActivityThread.java:8486) at java.lang.reflect.Method.invoke(Method.java) at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:582) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1061)

@jruston
Copy link

jruston commented Jul 30, 2023

Also experiencing this on v3.4.0. According to my stats, I am seeing it on Android 10 - 13, with 67% of the crashes being on Xiaomi devices. The rest are Samsung, Huawei and Oppo. The biggest number of crashes is coming from the Redmi Note 8 Pro.

Fatal Exception: android.content.res.Resources$NotFoundException: Resource ID #0x7f0800b1
at android.content.res.ResourcesImpl.getValueForDensity(ResourcesImpl.java:251)
at android.content.res.Resources.getDrawableForDensity(Resources.java:1050)
at android.content.res.Resources.getDrawable(Resources.java:990)
at android.content.Context.getDrawable(Context.java:814)
at androidx.core.content.ContextCompat$Api21Impl.getDrawable(ContextCompat.java)
at androidx.core.content.ContextCompat.getDrawable(ContextCompat.java)
at com.google.maps.android.ui.BubbleDrawable.(BubbleDrawable.java:42)
at com.google.maps.android.ui.IconGenerator.(IconGenerator.java:60)
at com.google.maps.android.clustering.view.DefaultClusterRenderer.(DefaultClusterRenderer.java:141)
at com.google.maps.android.clustering.ClusterManager.(ClusterManager.java:80)

@MRezaNasirloo
Copy link

MRezaNasirloo commented Aug 31, 2023

This issue is not a result of a bug in the map SDK but rather stems from users sideloading your APK. There are a few ways to check whether users have sideloaded your app and guide them to reinstall it from official app stores. You can find more information on this topic here.

@barath-dev
Copy link

I am encountering this error when i try to draw a polyline route in google maps activity

android.content.res.Resources$NotFoundException: Resource ID #0x7f0702e9 type #0x4 is not valid
at android.content.res.Resources.getDimensionPixelSize(Resources.java:836)
at com.google.maps.api.android.lib6.impl.be.d(:com.google.android.gms.policy_maps_core_dynamite@234910201@234910200049.587833741.587833741:41)
at com.google.maps.api.android.lib6.impl.ab.(:com.google.android.gms.policy_maps_core_dynamite@234910201@234910200049.587833741.587833741:65)
at com.google.maps.api.android.lib6.impl.ck.aE(:com.google.android.gms.policy_maps_core_dynamite@234910201@234910200049.587833741.587833741:29)
at com.google.maps.api.android.lib6.impl.dn.p(:com.google.android.gms.policy_maps_core_dynamite@234910201@234910200049.587833741.587833741:21)
at com.google.android.gms.maps.internal.q.bp(:com.google.android.gms.policy_maps_core_dynamite@234910201@234910200049.587833741.587833741:226)
at m.bay.onTransact(:com.google.android.gms.policy_maps_core_dynamite@234910201@234910200049.587833741.587833741:21)
at android.os.Binder.transact(Binder.java:1164)
at com.google.android.gms.internal.maps.zza.zzJ(com.google.android.gms:play-services-maps@@18.2.0:2)
at com.google.android.gms.maps.internal.zzk.onCreateView(com.google.android.gms:play-services-maps@@18.2.0:5)
at com.google.android.gms.maps.zzav.onCreateView(com.google.android.gms:play-services-maps@@18.2.0:7)
at com.google.android.gms.dynamic.zad.zab(com.google.android.gms:play-services-base@@18.3.0:2)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.zaf(com.google.android.gms:play-services-base@@18.3.0:1)
at com.google.android.gms.dynamic.DeferredLifecycleHelper.onCreateView(com.google.android.gms:play-services-base@@18.3.0:2)
at com.google.android.gms.maps.SupportMapFragment.onCreateView(com.google.android.gms:play-services-maps@@18.2.0:1)
at androidx.fragment.app.Fragment.performCreateView(Fragment.java:2963)
at androidx.fragment.app.FragmentStateManager.createView(FragmentStateManager.java:518)
at androidx.fragment.app.FragmentStateManager.moveToExpectedState(FragmentStateManager.java:282)
at androidx.fragment.app.FragmentStore.moveToExpectedState(FragmentStore.java:112)
at androidx.fragment.app.FragmentManager.moveToState(FragmentManager.java:1647)
at androidx.fragment.app.FragmentManager.dispatchStateChange(FragmentManager.java:3128)
at androidx.fragment.app.FragmentManager.dispatchActivityCreated(FragmentManager.java:3072)
at androidx.fragment.app.FragmentController.dispatchActivityCreated(FragmentController.java:251)
at androidx.fragment.app.FragmentActivity.onStart(FragmentActivity.java:502)
at android.app.Instrumentation.callActivityOnStart(Instrumentation.java:1543)
at android.app.Activity.performStart(Activity.java:8330)
at android.app.ActivityThread.handleStartActivity(ActivityThread.java:3670)
at android.app.servertransaction.TransactionExecutor.performLifecycleSequence(TransactionExecutor.java:221)
at android.app.servertransaction.TransactionExecutor.cycleToPath(TransactionExecutor.java:201)
at android.app.servertransaction.TransactionExecutor.executeLifecycleState(TransactionExecutor.java:173)
at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:97)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2307)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loopOnce(Looper.java:201)
at android.os.Looper.loop(Looper.java:288)
at android.app.ActivityThread.main(ActivityThread.java:7872)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:548)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:936)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority: p1 Important issue which blocks shipping the next release. Will be fixed prior to next release. released on @chris/fix/858 released type: bug Error or flaw in code with unintended results or allowing sub-optimal usage patterns.
Projects
None yet