// I'm currently trying to start the defaul map provided in android // studio. I added the API key to the xml file and start using the AVD // device by default and get the following error (says that my application stops working in the emulator)
// logcat:
01-03 19:13:51.647 2399-2399/com.example.user.maptest I/art: Not late-enabling -Xcheck:jni (already on) 01-03 19:13:51.671 2399-2399/com.example.user.maptest W/System: ClassLoader referenced unknown path: /data/app/com.example.user.maptest-2/lib/x86 01-03 19:13:51.675 2399-2399/com.example.user.maptest I/GMPM: App measurement is starting up, version: 8487 01-03 19:13:51.675 2399-2399/com.example.user.maptest I/GMPM: To enable debug logging run: adb shell setprop log.tag.GMPM VERBOSE 01-03 19:13:51.758 2399-2399/com.example.user.maptest I/zzad: Making Creator dynamically 01-03 19:13:51.762 2399-2399/com.example.user.maptest W/System: ClassLoader referenced unknown path: /system/priv-app/PrebuiltGmsCore/lib/x86 01-03 19:13:51.830 2399-2399/com.example.user.maptest D/ChimeraCfgMgr: Reading stored module config 01-03 19:13:51.832 2399-2399/com.example.user.maptest D/ChimeraCfgMgr: Loading module com.google.android.gms.maps from APK /data/user/0/com.google.android.gms/app_chimera/chimera-module-root/module-a3e4fba11e705727c59ff3116ef21fa4834b9f56/MapsModule.apk 01-03 19:13:51.832 2399-2399/com.example.user.maptest D/ChimeraModuleLdr: Loading module APK /data/user/0/com.google.android.gms/app_chimera/chimera-module-root/module-a3e4fba11e705727c59ff3116ef21fa4834b9f56/MapsModule.apk 01-03 19:13:51.864 2399-2399/com.example.user.maptest D/ChimeraFileApk: Primary ABI of requesting process is x86 01-03 19:13:51.864 2399-2399/com.example.user.maptest D/ChimeraFileApk: Classloading successful. Optimized code found. 01-03 19:13:51.865 2399-2399/com.example.user.maptest W/System: ClassLoader referenced unknown path: /data/user/0/com.google.android.gms/app_chimera/chimera-module-root/module-a3e4fba11e705727c59ff3116ef21fa4834b9f56/native-libs/x86 01-03 19:13:51.953 2399-2399/com.example.user.maptest I/Google Maps Android API: Google Play services client version: 8487000 01-03 19:13:51.970 2399-2399/com.example.user.maptest I/Google Maps Android API: Google Play services package version: 8489470 01-03 19:13:52.122 2399-2399/com.example.user.maptest W/ContextImpl: Failed to ensure /sdcard/Android/data/com.example.user.maptest/cache: java.lang.SecurityException: Invalid mkdirs path: /storage/self/primary/Android/data/com.example.user.maptest/cache 01-03 19:13:52.124 2399-2399/com.example.user.maptest D/AndroidRuntime: Shutting down VM 01-03 19:13:52.124 2399-2399/com.example.user.maptest E/AndroidRuntime: FATAL EXCEPTION: main Process: com.example.user.maptest, PID: 2399 java.lang.RuntimeException: Unable to start activity ComponentInfo{com.example.user.maptest/com.example.user.maptest.MapsActivity}: android.view.InflateException: Binary XML file line
// AndroidManfest:
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> <uses-permission android:name="android.permission.INTERNET" /> <application android:allowBackup="true" android:icon="@mipmap/ic_launcher" android:label="@string/app_name" android:supportsRtl="true" android:theme="@style/AppTheme"> <meta-data android:name="com.google.android.geo.API_KEY" android:value="@string/google_maps_key" /> <activity android:name=".MapsActivity" android:label="@string/title_activity_maps"> <intent-filter> <action android:name="android.intent.action.MAIN" /> <category android:name="android.intent.category.LAUNCHER" /> </intent-filter> </activity> </application> </manifest>
// Gradle: apply the plugin: 'com.android.application'
android { compileSdkVersion 23 buildToolsVersion "23.0.2" defaultConfig { applicationId "com.example.user.maptest" minSdkVersion 19 targetSdkVersion 23 versionCode 1 versionName "1.0" } buildTypes { release { minifyEnabled false proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' } } } dependencies { compile fileTree(dir: 'libs', include: ['*.jar']) testCompile 'junit:junit:4.12' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.google.android.gms:play-services:8.4.0' } apply plugin: 'com.google.gms.google-services'
source share