我尝试使用gradle文件中的compile 'com.google.android.gms:play-services-maps:11.2.0'
获取地图api的最新版Google Play服务,并将google maven网址放入项目gradle中。
我的问题是,当我尝试同步我的gradle文件时,我得到一个错误并且android studio建议安装存储库和同步项目,但是当我点击它时没有任何反应并且android studio冻结几秒钟
如果我使用compile 'com.google.android.gms:play-services:11.2.0'
我尝试了无效缓存/重启技术,我在sdk管理器中卸载/安装了google play服务,我不知道如何解决此问题。
build.gradle就像这样(它适用于11.0.4版本):
apply plugin: 'com.android.application'
def dbflow_version = "4.0.5"
android {
compileSdkVersion 25
buildToolsVersion "26.0.1"
defaultConfig {
applicationId "not telling"
minSdkVersion 21
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
annotationProcessor "com.github.Raizlabs.DBFlow:dbflow-processor:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow-core:${dbflow_version}"
compile "com.github.Raizlabs.DBFlow:dbflow:${dbflow_version}"
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.squareup.retrofit2:retrofit:2.3.0'
compile 'com.jakewharton:butterknife:8.8.1'
compile 'com.google.android.gms:play-services-maps:11.0.4'
compile 'com.google.android.gms:play-services-location:11.0.4'
compile 'com.google.android.gms:play-services-identity:11.0.4'
testCompile 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
你有办法解决这个问题吗?