【发布时间】:2016-12-21 06:22:20
【问题描述】:
Error:Execution failed for task ':app:processDebugGoogleServices'.
> Please fix the version conflict either by updating the version of the
google-services plugin (information about the latest version is available
at https://bintray.com/android/android-tools/com.google.gms.google-services/)
or updating the version of com.google.android.gms to 9.6.1.
apply plugin: 'com.android.application'
android {
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE.txt'
exclude 'META-INF/NOTICE.txt'
exclude 'META-INF/LICENSE-FIREBASE.txt'
}
compileSdkVersion 23
buildToolsVersion "23.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.myapp"
minSdkVersion 16
targetSdkVersion 22
versionCode 1
versionName "1.0"
// Enabling multidex support.
multiDexEnabled true
}
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.0.1'
compile 'com.android.support:design:23.0.1'
compile 'com.firebase:firebase-client-android:2.3.1'
compile 'com.google.firebase:firebase-database:9.6.1'
compile 'com.google.firebase:firebase-storage:9.6.1'
//map
compile 'com.google.android.gms:play-services-location:9.0.2'
}
apply plugin: 'com.google.gms.google-services'
当我将它更新到 9.6.1 时,有些类找不到:
- SupportMapFragment 类
- OnMapReadyCallback、GoogleMap.OnMarkerClickListener、GoogleMap.OnInfoWindowClickListener 监听器
- LatLng、LatLngBounds、GoogleMap、标记类
【问题讨论】:
-
对于这些课程,请添加
compile 'com.google.android.gms:play-services-maps:9.6.1' -
当我将其更新到 9.6.1 时,找不到某些类:SupportMapFragment 类 OnMapReadyCallback、GoogleMap.OnMarkerClickListener、GoogleMap.OnInfoWindowClickListener 侦听器 LatLng、LatLngBounds、GoogleMap、Marker 类
-
是的,只要继续使用 9.6.1 版本的 play-services-location 和 play-services-maps,课程就会出现。您缺少 play-services-maps 依赖项
标签: android google-maps firebase