Android 2.3 Google Maps Missing Resource maps_watermark_dark.png

I have an Android application that minSdkVersion is set to 9. The application compiles and runs, but when it displays a Google map, it is reset using

android.content.res.Resources$NotFoundException: File res/drawable-mdpi-v4/maps_watermark_dark.png from drawable resource ID #0x7f02027c 

Everything indicates the lack of a resource in the library of playback services.

I do not use proguard, shrinkResources or resConfigs.

The device is a Samsung / GT-S5360L / GT-S5360L: 2.3.6 / GINGERBREAD

Here is the relevant part of build.gradle

 apply plugin: 'com.android.application' android { compileSdkVersion 21 buildToolsVersion "21.1.2" defaultConfig { targetSdkVersion 21 minSdkVersion 9 versionCode 476 versionName "4.7.6" } } dependencies { compile fileTree(dir: 'libs', include: '*.jar') compile 'com.android.support:appcompat-v7:21.0.3' compile 'com.google.android.gms:play-services:6.1.71' } 

And here is the stack I get:

 D/AndroidRuntime(10297): Shutting down VM W/dalvikvm(10297): threadid=1: thread exiting with uncaught exception (group=0x40020578) E/AndroidRuntime(10297): FATAL EXCEPTION: main E/AndroidRuntime(10297): java.lang.RuntimeException: Unable to start activity ComponentInfo{com.safertaxi.driver/driver.activities.driving.ActivityDriving}: android.view.InflateException: Binary XML file line #24: Error inflating class fragment E/AndroidRuntime(10297): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1651) E/AndroidRuntime(10297): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:1667) E/AndroidRuntime(10297): at android.app.ActivityThread.access$1500(ActivityThread.java:117) E/AndroidRuntime(10297): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:935) E/AndroidRuntime(10297): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(10297): at android.os.Looper.loop(Looper.java:130) E/AndroidRuntime(10297): at android.app.ActivityThread.main(ActivityThread.java:3687) E/AndroidRuntime(10297): at java.lang.reflect.Method.invokeNative(Native Method) E/AndroidRuntime(10297): at java.lang.reflect.Method.invoke(Method.java:507) E/AndroidRuntime(10297): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:867) E/AndroidRuntime(10297): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:625) E/AndroidRuntime(10297): at dalvik.system.NativeStart.main(Native Method) E/AndroidRuntime(10297): Caused by: android.view.InflateException: Binary XML file line #24: Error inflating class fragment E/AndroidRuntime(10297): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:587) E/AndroidRuntime(10297): at android.view.LayoutInflater.rInflate(LayoutInflater.java:623) E/AndroidRuntime(10297): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626) E/AndroidRuntime(10297): at android.view.LayoutInflater.rInflate(LayoutInflater.java:626) E/AndroidRuntime(10297): at android.view.LayoutInflater.inflate(LayoutInflater.java:408) E/AndroidRuntime(10297): at android.view.LayoutInflater.inflate(LayoutInflater.java:320) E/AndroidRuntime(10297): at android.view.LayoutInflater.inflate(LayoutInflater.java:276) E/AndroidRuntime(10297): at android.support.v7.app.ActionBarActivityDelegateBase.setContentView(ActionBarActivityDelegateBase.java:228) E/AndroidRuntime(10297): at android.support.v7.app.ActionBarActivity.setContentView(ActionBarActivity.java:102) E/AndroidRuntime(10297): at driver.activities.driving.ActivityDriving.onCreate(ActivityDriving.java:109) E/AndroidRuntime(10297): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1047) E/AndroidRuntime(10297): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:1615) E/AndroidRuntime(10297): ... 11 more E/AndroidRuntime(10297): Caused by: android.content.res.Resources$NotFoundException: File res/drawable-mdpi-v4/maps_watermark_dark.png from drawable resource ID #0x7f02027c E/AndroidRuntime(10297): at android.content.res.Resources.loadDrawable(Resources.java:1714) E/AndroidRuntime(10297): at android.content.res.Resources.getDrawable(Resources.java:581) E/AndroidRuntime(10297): at com.google.maps.api.android.lib6.c.cl.<init>(Unknown Source) E/AndroidRuntime(10297): at com.google.maps.api.android.lib6.c.cl.<init>(Unknown Source) E/AndroidRuntime(10297): at com.google.maps.api.android.lib6.c.el.a(Unknown Source) E/AndroidRuntime(10297): at com.google.maps.api.android.lib6.c.ab.a(Unknown Source) E/AndroidRuntime(10297): at com.google.maps.api.android.lib6.c.aa.a(Unknown Source) E/AndroidRuntime(10297): at com.google.android.gms.maps.internal.x.onTransact(SourceFile:107) E/AndroidRuntime(10297): at android.os.Binder.transact(Binder.java:279) E/AndroidRuntime(10297): at com.google.android.gms.maps.internal.IMapFragmentDelegate$a$a.onCreateView(Unknown Source) E/AndroidRuntime(10297): at com.google.android.gms.maps.SupportMapFragment$a.onCreateView(Unknown Source) E/AndroidRuntime(10297): at com.google.android.gms.dynamic.a$4.b(Unknown Source) E/AndroidRuntime(10297): at com.google.android.gms.dynamic.aa(Unknown Source) E/AndroidRuntime(10297): at com.google.android.gms.dynamic.a.onCreateView(Unknown Source) E/AndroidRuntime(10297): at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source) E/AndroidRuntime(10297): at driver.fragments.maps.FragmentMap.onCreateView(FragmentMap.java:37) E/AndroidRuntime(10297): at android.support.v4.app.Fragment.performCreateView(Fragment.java:1786) E/AndroidRuntime(10297): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:920) E/AndroidRuntime(10297): at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1104) E/AndroidRuntime(10297): at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1206) E/AndroidRuntime(10297): at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2159) E/AndroidRuntime(10297): at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:297) E/AndroidRuntime(10297): at android.support.v7.app.ActionBarActivity.onCreateView(ActionBarActivity.java:547) E/AndroidRuntime(10297): at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563) E/AndroidRuntime(10297): ... 22 more E/AndroidRuntime(10297): Caused by: java.io.FileNotFoundException: res/drawable-mdpi-v4/maps_watermark_dark.png E/AndroidRuntime(10297): at android.content.res.AssetManager.openNonAsset 

EDIT. # 1:

The problem still persists after:

  • Updated to targetSdkVersion 21
  • Update to Google Play 6.1.17 services
  • Installed Google Play services by phone: 6.5.87

EDIT # 2:

This is how the map loads:

 <?xml version="1.0" encoding="utf-8"?> <LinearLayout xmlns:android="http://schemas.android.com/apk/res/android" android:layout_width="match_parent" android:layout_height="match_parent" android:orientation="vertical"> ... <fragment android:id="@+id/fragment_map" android:name="driver.fragments.maps.FragmentMap" android:layout_width="fill_parent" android:layout_height="fill_parent" /> </LinearLayout> 

 public final class FragmentMap extends SupportMapFragment { @Override public View onCreateView(LayoutInflater arg0, ViewGroup arg1, Bundle arg2) { View view = super.onCreateView(arg0, arg1, arg2); ... return view; } } 

EDIT No. 3:

Obviously, the problem was resolved by updating the version of Google Play Services installed on the device to 6.5.99. However, I cannot confirm this because the device that experienced the problem has broken. I can’t reproduce the problem, because I can’t reinstall 6.5.87 on the new device, because the latest version of Google Play is 6.5.99.

+6
source share
2 answers

According to the official Google Maps bug tracker, this is an obsolete issue because it no longer runs on newer versions of Google Play services.

For more information, visit:

https://code.google.com/p/gmaps-api-issues/issues/detail?id=7562

0
source

I see a similar problem here . Many explanations are mentioned here, but I suggest checking the screen compatibility mode. This looks more likely since you already took care of the minimum SDK.

+1
source

Source: https://habr.com/ru/post/979949/


All Articles