В моем приложении Android используются Карты Google и компилируются как для SDK23, так и для SDK19. Он прекрасно работает на SDK23 (LG G4), но генерирует эту ошибка SDK19 устройства (Samsung Galaxy 4) => java.lang.NoClassDefFoundError: com.google.android.gms.R $ строка
Это моя зависимость: Android Studio Dependencies
Мой файл манифеста:
<?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>
Когда я искал эту ошибку, я не смог найти решение/ответ, почему мое приложение компилируется/прекрасно работает под SDK23, но генерирует этот RUN- временная ошибка в SDK19.
Любая помощь будет оценена!
, пожалуйста, рад помочь. пожалуйста, отметьте свой ответ как правильный ответ, чтобы помочь другому. –