//我目前正在尝试运行android //studio中提供的默认地图活动。我在xml文件中添加了我的API密钥,并使用默认的AVD//设备运行,得到以下错误(说我的应用程序在仿真器中停止工作)
//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 #1: Binary XML file line #1: Error inflating class fragment
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2416)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #1: Binary XML file line #1: Error inflating class fragment
at android.view.LayoutInflater.inflate(LayoutInflater.java:539)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
at android.app.Activity.setContentView(Activity.java:2166)
at com.example.user.maptest.MapsActivity.onCreate(MapsActivity.java:20)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: android.view.InflateException: Binary XML file line #1: Error inflating class fragment
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:782)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:704)
at android.view.LayoutInflater.inflate(LayoutInflater.java:492)
at android.view.LayoutInflater.inflate(LayoutInflater.java:423)
at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
at com.android.internal.policy.PhoneWindow.setContentView(PhoneWindow.java:393)
at android.app.Activity.setContentView(Activity.java:2166)
at com.example.user.maptest.MapsActivity.onCreate(MapsActivity.java:20)
at android.app.Activity.performCreate(Activity.java:6237)
at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1107)
at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2369)
at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2476)
at android.app.ActivityThread.-wrap11(ActivityThread.java)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1344)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:148)
at android.app.ActivityThread.main(ActivityThread.java:5417)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:726)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:616)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.mkdir()' on a null object reference
at com.google.maps.api.android.lib6.gmm6.m.ad.a(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.c.h.a(Unknown Source)
at com.google.maps.api.android.lib6.gmm6.c.ao.a(Unknown Source)
at com.google.maps.api.android.lib6.e.bd.a(Unknown Source)
at com.google.maps.api.android.lib6.e.ev.a(Unknown Source)
at com.google.maps.api.android.lib6.e.z.a(Unknown Source)
at com.google.maps.api.android.lib6.e.y.a(Unknown Source)
at com.google.android.gms.maps.internal.u.onTransact(SourceFile:107)
at android.os.Binder.transact(Binder.java:387)
at com.google.android.gms.maps.internal.IMapFragmentDelegate$zza$zza.onCreateView(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment$zza.onCreateView(Unknown Source)
at com.google.android.gms.dynamic.zza$4.zzb(Unknown Source)
at com.google.android.gms.dynamic.zza.zza(Unknown Source)
at com.google.android.gms.dynamic.zza.onCreateView(Unknown Source)
at com.google.android.gms.maps.SupportMapFragment.onCreateView(Unknown Source)
at android.support.v4.app.Fragment.performCreateView(Fragment.java:1962)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1036)
at android.support.v4.app.FragmentManagerImpl.moveToState(FragmentManager.java:1226)
at android.support.v4.app.FragmentManagerImpl.addFragment(FragmentManager.java:1328)
at android.support.v4.app.FragmentManagerImpl.onCreateView(FragmentManager.java:2284)
at android.support.v4.app.FragmentController.onCreateView(FragmentController.java:111)
at android.support.v4.app.FragmentActivity.dispatchFragmentsOnCreateView(FragmentActivity.java:314)
at android.support.v4.app.BaseFragmentActivityHoneycomb.onCreateView(BaseFragmentActivityHoneycomb.java:31)
at android.support.v4.app.FragmentActivity.onCreateView(FragmentActivity.java:79)
at android.view.LayoutInflater.createViewFromTag(Layout
Android曼菲斯特:
<!--
The ACCESS_COARSE/FINE_LOCATION permissions are not required to use
Google Maps Android API v2, but you must specify either coarse or fine
location permissions for the 'MyLocation' functionality.
-->
<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">
<!--
The API key for Google Maps-based APIs is defined as a string resource.
(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.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:应用插件:'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'
您问题的底线是日志中的这一行
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'boolean java.io.File.mkdir()' on a null object reference
at com.google.maps.api.android.lib6.gmm6.m.ad.a(Unknown Source)
您需要一张SD卡才能在play-services:8.4.0
中运行您的代码。请查看此内容以获取有关您当前问题的更多信息。
编辑:此问题已修复。将 Google Play 服务升级到 9.0.83 将解决此问题。
C:\users\asd\appdata\local\android\sdk\tools\emulator.exe-avd Nexus_5_API_21_x86-netspeed full-netdelay none创建文件系统并使用参数:大小:69206016块大小:4096块/组:32768 Inode/组:4224 Inode大小:256日志块:1024标签:块:16896块组:1保留块组大
我不明白为什么错误没有消失 我想这是的错误,因为它在我调整清单文件后显示 但我找不到我的错误是什么,你能教我吗?
问题内容: 当我尝试在Chrome中运行测试时出现此错误: 初始化方法AutomationUsingSelenium.SmuladorChrome.MyTestInitialize引发异常。OpenQA.Selenium.DriverServiceNotFoundException:OpenQA.Selenium.DriverServiceNotFoundException 原因是什么? 问题答案
我是Android Studio的新手。我现在使用它是希望获得一些错误消息,以解释为什么我的APK不能在蓝色堆栈中运行。APK是在Unity中建造的。 在安装了Android Studio,一个手机模拟器等之后,我仍然无法运行apk。它说: 在堆栈溢出中已经有一个关于这个错误的帖子。但是,我的AndroidManifest.xml在我看来很好。我也尝试过‘无效缓存/重新启动’但没有效果。当我转到“
文件"C:\Program Data\Anaconda3\Script\tensorboard-script.py",第10行,sys.exit(run_main())文件"C:\Program Data\Anaconda3\lib\site-包\拉伸板\main.py",第57行,run_mainapp.run(tensorboard.main,flags_parser=tensorboard.
尝试模拟Querydsl的SQLQueryFactory进行DAO单元测试。第一次使用Mockito的深存根。下面是失败的最小代码 有以下例外: java.lang.ClassCastException:类com . query DSL . SQL . projectablesql query $ mockito mock $ 1584151766不能转换为类com . query DSL . S