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
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
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.