gpt4 book ai didi

android-studio - Android Gradle 无法解决

转载 作者:行者123 更新时间:2023-12-03 17:04:48 26 4
gpt4 key购买 nike

我在 gradle 文件中收到此错误:

Error: Failed to resolve: com.google.android.gms:play-services-measurement:10.2.4

-Install Repository and sync project

-Open File

-Show in Project Structure dialog

但我没有在我的应用中使用 play-services-measurement。另一方面,如果我单击“安装存储库并同步项目”链接,则不会发生任何事情。任何人都可以帮助我吗?我一直在这个问题上浪费时间。

这是我的完整 gradle 文件:

apply plugin: 'com.android.application'    

buildscript {
repositories {
mavenCentral()
}
dependencies {
classpath 'com.google.gms:google-services:3.0.0'
}
}



android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
compileOptions {
encoding "UTF-8"
}


lintOptions {
disable 'MissingTranslation'
abortOnError false
}

defaultConfig {
applicationId "xxx.yyy.zzz"
minSdkVersion 9
targetSdkVersion 25
versionCode 120
versionName "1.20"
multiDexEnabled true
//Enabling multi dex support due to exceeding the 65K methods dex limit imposed by Android: http://stackoverflow.com/questions/29756188/java-finished-with-non-zero-exit-value-2-android-gradle
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
applicationVariants.all { variant ->
variant.outputs.each { output ->
def formattedDate = new Date().format('yyyyMMddHHmmss')
def newName = output.outputFile.name
newName = newName.replace("app-", "MyAppName")
newName = newName.replace("-release", "-release" + formattedDate)
//noinspection GroovyAssignabilityCheck
output.outputFile = new File(output.outputFile.parent, newName)
}
}
}

}
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
compile project(':simple-crop-image-lib')

compile 'com.google.firebase:firebase-core:9.6.1'
compile 'com.google.firebase:firebase-messaging:10.2.4'
compile 'com.google.android.gms:play-services:10.2.4' //8.3.0' 10.2.4' 9.0.0' 9.6.0'

compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:mediarouter-v7:25.3.1'
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.android.support:recyclerview-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:cardview-v7:25.3.1'

//For soap:
compile files('libs/ksoap2-android-assembly-2.5.8-jar-with-dependencies.jar')

}

apply plugin: 'com.google.gms.google-services'

最佳答案

在 Android SDK 中更新 Google 存储库。适用于我的版本 47。

来自火力基地doc :

dependencies {
// ...
compile 'com.google.firebase:firebase-core:10.2.4'
compile 'com.google.firebase:firebase-messaging:10.2.4'
// Getting a "Could not find" error? Make sure you have
// the latest Google Repository in the Android SDK manager
}

关于android-studio - Android Gradle 无法解决,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43723047/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com