Meine Android App verwendet Google Maps und kompiliert sowohl für ein SDK23- als auch ein SDK19-Gerät. Es läuft gut auf dem SDK23 (LG G4) aber erzeugt diesen Fehler SDK19 Gerät (Samsung Galaxy 4) => java.lang.NoClassDefFoundError: com.google.android.gms.R $ string
Das sind meine Abhängigkeiten: Android Studio Dependencies
Meine Manifest-Datei:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.volkerpetersen.sailingrace">
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-feature
android:glEsVersion="0x00020000"
android:required="true"></uses-feature>
<application
android:name=".GlobalParameters"
android:allowBackup="true"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name"
android:theme="@style/Theme.AppCompat">
<activity
android:name=".MainActivity"
android:label="@string/app_name"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
<activity
android:name=".start_timerActivity"
android:label="@string/title_activity_start_timer"
android:parentActivityName=".MainActivity"
android:windowSoftInputMode="stateHidden"
android:screenOrientation="portrait">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.volkerpetersen.sailingrace.MainActivity" />
</activity>
<activity
android:name=".start_raceActivity"
android:label="@string/title_activity_start_race"
android:parentActivityName=".MainActivity"
android:theme="@android:style/Theme.Holo.NoActionBar" >
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.volkerpetersen.sailingrace.MainActivity" />
</activity>
<activity
android:name=".start_mapActivity"
android:label="@string/title_activity_start_map"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.volkerpetersen.sailingrace.MainActivity" />
</activity>
<activity
android:name=".SailingRacePreferences"
android:screenOrientation="portrait"
android:label="@string/title_activity_setting"
android:noHistory="true"
android:parentActivityName=".MainActivity"
android:theme="@android:style/Theme.Holo.Light.DarkActionBar">
<meta-data
android:name="android.support.PARENT_ACTIVITY"
android:value="com.example.volkerpetersen.sailingrace.MainActivity" />
</activity>
<receiver android:name=".SailTimerAPI"></receiver>
<!--
The API key for Google Maps-based APIs is defined as a string resource using the <meta-data> tag
(See the file "res/values/google_maps_api.xml").
Note that the API key is linked to the encryption key used to sign the APK.
You need a different API key for each encryption key, including the release key that is used to
sign the APK for publishing.
You can define the keys for the debug and release targets in src/debug/ and src/release/.
-->
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="AIzaSyDzCAa-hibdRJ-NdOnIRK-IG5uN2U3kv9c" />
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
<!-- original code replaced with above
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
-->
</application>
Als ich für diesen Fehler suchte ich keine Lösung/beantworten, warum mein app kompiliert/läuft gut unter SDK23, aber erzeugt diese Run- finden konnte Zeitfehler unter SDK19.
Jede Hilfe wird geschätzt!
Sie sind herzlich willkommen, froh zu helfen. Bitte markieren Sie Ihre Antwort als die richtige Antwort, um anderen zu helfen. –