gpt4 book ai didi

android - 无法解析 com.google.android.gms :play-services-measurement-base:[18. 0.0]

转载 作者:行者123 更新时间:2023-12-04 23:41:34 31 4
gpt4 key购买 nike

我对 Flutter 比较陌生,该项目在 2 天前开始工作。
当我今天尝试运行它时,我遇到了这个错误。
这是我面临的错误。

FAILURE: Build failed with an exception.

* What went wrong:
Could not determine the dependencies of task ':app:processDebugResources'.
> Could not resolve all task dependencies for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.android.gms:play-services-measurement-base:[18.0.0].
Required by:
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-api:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-sdk:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement:18.0.0 > com.google.android.gms:play-services-measurement-impl:18.0.0
project :app > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-api:18.0.0 > com.google.android.gms:play-services-measurement-sdk-api:18.0.0
> Failed to list versions for com.google.android.gms:play-services-measurement-base.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-measurement-base/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-measurement-base/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-measurement-base/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
这是我的 app\build.gradle 的代码
def localProperties = new Properties()
def localPropertiesFile = rootProject.file('local.properties')
if (localPropertiesFile.exists()) {
localPropertiesFile.withReader('UTF-8') { reader ->
localProperties.load(reader)
}
}

def flutterRoot = localProperties.getProperty('flutter.sdk')
if (flutterRoot == null) {
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
}

def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
if (flutterVersionCode == null) {
flutterVersionCode = '1'
}

def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
flutterVersionName = '1.0'
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'com.google.gms.google-services'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"

android {
compileSdkVersion 29

sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}

lintOptions {
disable 'InvalidPackage'
}

defaultConfig {
applicationId "com.project.project"
minSdkVersion 21
targetSdkVersion 29
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
multiDexEnabled true
}

buildTypes {
release {
signingConfig signingConfigs.debug
}
}
}

flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation platform('com.google.firebase:firebase-bom:26.1.1')
implementation 'com.google.firebase:firebase-analytics'
implementation 'com.android.support:multidex:1.0.3'
}
我尝试更新 firebase-bom 和 google-services 但仍然面临同样的问题。
任何帮助将不胜感激!

最佳答案

在 gradle-wrapper.properties 中将 distributionUrl 更改为
distributionUrl=https://services.gradle.org/distributions/gradle-6.5.1-all.zip

关于android - 无法解析 com.google.android.gms :play-services-measurement-base:[18. 0.0],我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/70285987/

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