12月8日,我开始在运行一个Android项目(使用Flatter框架创建)时遇到问题,该项目已经发布到Google Play上,在编译之前从未出现过问题。
我得到的错误如下:
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 > project :firebase_analytics > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement:18.0.0
project :app > project :firebase_analytics > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-api:18.0.0
project :app > project :firebase_analytics > com.google.firebase:firebase-analytics:18.0.0 > com.google.android.gms:play-services-measurement-sdk:18.0.0
project :app > project :firebase_analytics > 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 > project :firebase_analytics > 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
所以我开始挖掘,发现我最近的变化不是问题所在。Bintray下载中心似乎是12月1日的日落(google.Bintray.com)
由于我使用的是一些Firebase软件包的旧版本,因此此链接似乎已关闭,现在我无法编译我的应用程序。
颤振医生输出:
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel unknown, 2.0.3, on macOS 11.4 20F71 darwin-arm, locale en-GB)
[✓] Android toolchain - develop for Android devices (Android SDK version 32.0.0)
[✓] Xcode - develop for iOS and macOS
[✓] Chrome - develop for the web
[✓] Android Studio (version 2020.3)
[✓] VS Code (version 1.63.1)
[✓] Connected device (3 available)
• No issues found!
这是我的构建。格雷德尔
:
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath 'com.google.gms:google-services:4.3.5'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.5.1'
classpath 'com.android.tools.build:gradle:3.5.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
allprojects {
repositories {
google()
mavenCentral()
jcenter()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我的应用程序/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) {
throw new GradleException("versionCode not found. Define flutter.versionCode in the local.properties file.")
}
def flutterVersionName = localProperties.getProperty('flutter.versionName')
if (flutterVersionName == null) {
throw new GradleException("versionName not found. Define flutter.versionName in the local.properties file.")
}
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.google.firebase.crashlytics'
android {
compileSdkVersion 30
sourceSets {
main.java.srcDirs += 'src/main/kotlin'
}
lintOptions {
disable 'InvalidPackage'
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.reliqium.reliqium"
minSdkVersion 24
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
}
signingConfigs {
release {
if (System.getenv()["CI"]) { // CI=true is exported by Codemagic
storeFile file(System.getenv()["FCI_KEYSTORE_PATH"])
storePassword System.getenv()["FCI_KEYSTORE_PASSWORD"]
keyAlias System.getenv()["FCI_KEY_ALIAS"]
keyPassword System.getenv()["FCI_KEY_PASSWORD"]
} else {
keyAlias System.getenv("RELIQIUM_ANDROID_KEYSTORE_ALIAS")
keyPassword System.getenv("RELIQIUM_ANDROID_KEYSTORE_PRIVATE_KEY_PASSWORD")
storeFile file(System.getenv("HOME") + "/keystores/reliqiumapp.keystore")
storePassword System.getenv("RELIQIUM_ANDROID_KEYSTORE_PASSWORD")
}
}
}
buildTypes {
release {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
signingConfig signingConfigs.release
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'com.android.support:multidex:1.0.3'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'com.facebook.android:facebook-core:7.0.1'
implementation 'com.facebook.android:facebook-login:7.0.1'
implementation "com.airbnb.android:lottie:3.5.0"
implementation "com.android.support.constraint:constraint-layout:2.0.4"
}
Flutter Firebase软件包的版本如下:
我知道,这些都是Firebase软件包的过时版本(出于多种原因,无法将它们升级到下一个版本)
问题似乎与Firebase Analytics(分析)软件包有关。我试图删除它,但后来我得到了一个类似的错误,Firebase Cloud Fi还原包是应用程序所需的。
有人能帮我吗。我已经尝试了多种方法,但似乎没有任何方法可以解决这个问题,我需要编译应用程序以尽快推出新版本!
我通过升级我的Gradle版本到v4.1.0解决了这个问题
android/build。格拉德尔:
dependencies {
...
classpath 'com.android.tools.build:gradle:4.1.0'
...
}
android/gradle/wrapper/gradle wrapper。特性:
...
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
(编辑):你还需要一些东西:
buildscript {
...
repositories {
google()
mavenCentral() // add this
// jcenter() // remove this
}
}
...
allprojects {
repositories {
google()
mavenCentral()// ADD THIS
// jcenter() // REMOVE THIS
}
}
android {
...
buildTypes {
release {
signingConfig signingConfigs.release
minifyEnabled false // ADD THIS
shrinkResources false // ADD THIS
}
}
...
}
基本问题,版本的com.google.android.gms: play-services-metating-base:[18.0.0]没有严格指定和gradle必须找到可能的版本,但google.bintray.com是下降-没有可用的版本列表
解决此问题的基本流程
>
查找版本-这[18.0.0]意味着它有版本范围渐变声明版本和范围
搜索com.google.android.gms的版本:play-services-umating-base,找到可以设置Maven search的版本。我们有版本18.0.0 - 18.0.3
[and ]符号表示只有一个版本的包容性绑定,因此考虑完全采用18.0个级别的html" target="_blank">声明版本和范围。
使用最大可能版本18.0.0约束您的可传递依赖项
编辑您的项目应用程序/生成。格拉德尔:
dependencies {
...
constraints {
implementation('com.google.android.gms:play-services-measurement-base') {
version {
strictly '18.0.0'
}
}
}
}
我对Android的Gradle构建有问题。我尝试了很多方法来解决这个问题,但没有什么不起作用。我需要帮助。 Gradle版本:4.4 Gradle插件:3.0.1 错误:无法解析app@serverDebug /compileClasspath的依赖关系:无法解析项目:vksdk_library。 错误:无法解析“”的依存关系:app@mockDebugAndroidTest/compileCl
我是一名新的Android学习者,我正在为语言翻译制作我的第一个Android应用程序。在添加了一些依赖项之后,我遇到了一些问题。我该怎么解决这个问题? Gradle同步失败:无法解决配置的所有依赖项: app: dedegRuntimeClasspath。无法确定android.arch.lifecycle的工件: livedata: 1.1.1:脱机模式下没有缓存版本有关详细信息,请参阅IDE
我使用的是Maven 3.1.1。当我运行时,我收到以下错误: 我的< code>pom.xml是:
我能看到周围有什么工作示例吗?我从这里下载了这个http://www.it-jw.com/grails/birt-report-test_0.5.ziphttp://grails.org/plugin/birt-report 却一直给我错误 "错误无法解析依赖项" .当我浏览http://repo1.maven.org/maven2/org/它说: 已禁用浏览此目录。改为在 http://sear
问题是gradle找不到依赖项的jar,但gradle找错了地方。Gradle一直在错误的目录(谷歌和Android支持libary的目录)中搜索文件.... 在以下位置搜索:文件:/d://programme/androis-sdks/extras/android/m2repository/org/springframework/android/spring-android-rest-templ