我正在尝试基于Google Map创建一个演示项目,为此我使用的是android studio提供的MapsActivity。一切都很好,不包括Google Play服务。 Android工作室无法解决播放服务并抛出错误 -
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:2.2.2'
classpath 'com.google.gms:google-services:3.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Project Gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 24
buildToolsVersion "25.0.0"
defaultConfig {
applicationId "com.example.mymapapplication"
minSdkVersion 15
targetSdkVersion 24
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'
})
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.google.android.gms:play-services:9.4.0'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
App Gradle
void f(string&& s) { f(s); }
我有更新的sdk工具 Google Play服务v-33 和 Google Repository v-36 。 我尝试了很多东西来处理它,但仍面临同样的问题。
答案 0 :(得分:0)
解决了这个问题,这是存储库链接上的一个错误。
"Install Google Repository" failed.
Failed packages:
- Google Repository (extras;google;m2repository)
现在新链接 - https://dl.google.com/android/repository/google_m2repository_gms_v7_rc28_wear_2a3.zip(此时)工作正常,我更新了我的Google存储库和Google Play服务,其工作就像一个魅力。