我在Android中使用谷歌地图,当我重新安装Android Studio工具时。然后Googlemap无法正常显示,尽管它没有问题。
我已经检查了AndroidManifest.xml和build.gradle文件,看到它仍然正常,这是我的依赖项添加:
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "24.0.1"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.totoroads.android.app"
minSdkVersion 15
targetSdkVersion 24
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:24.1.1'
compile 'org.apache.httpcomponents:httpcore:4.4.1'
compile 'com.googlecode.json-simple:json-simple:1.1'
compile 'com.android.volley:volley:1.0.0'
compile 'com.mcxiaoke.volley:library-aar:1.0.0'
compile 'com.android.support:design:24.1.1'
compile 'com.android.support:gridlayout-v7:24.1.1'
compile 'com.android.support:mediarouter-v7:24.1.1'
compile 'com.android.support:palette-v7:24.1.1'
compile 'com.android.support:recyclerview-v7:24.1.1'
compile 'com.android.support:support-annotations:24.0.1'
compile 'com.loopj.android:android-async-http:1.4.4'
compile 'com.android.support:support-v13:24.1.1'
compile 'com.android.support:support-v4:24.1.1'
compile 'com.google.android.gms:play-services:8.3.0'
compile 'com.etsy.android.grid:library:1.0.5'
compile 'com.android.support:cardview-v7:24.1.1'
compile 'com.android.support.constraint:constraint-layout:1.0.0-alpha9'
compile 'com.ncapdevi:frag-nav:1.0.3'
compile 'com.roughike:bottom-bar:1.3.9'
compile 'com.google.android.gms:play-services:8.4.0'
compile 'com.google.maps.android:android-maps-utils:0.4+'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.squareup.retrofit2:retrofit:2.0.0'
compile 'com.squareup.retrofit2:converter-gson:2.0.0'
}
但是当我构建项目时,我收到了一个错误:
E/DynamiteModule: Failed to load DynamiteLoader: java.lang.ClassNotFoundException: Didn't find class "com.google.android.gms.dynamite.DynamiteModule$DynamiteLoaderClassLoader" on path: DexPathList[[zip file "/data/app/com.totoroads.android.app-2/base.apk"],nativeLibraryDirectories=[/data/app/com.totoroads.android.app-2/lib/x86, /vendor/lib, /system/lib]]
GoogleMap不会显示。如何解决问题?非常感谢你!
答案 0 :(得分:0)
使用下面的地图
com.google.android.gms:play-services-maps:10.0.1
这只包括来自播放服务的地图模块。