尝试在Flutter项目中构建Android应用程序时,我遇到以下错误
What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.stripe:stripe-android:20.4.1.
Required by:
project :app > project :stripe_android
> Could not resolve com.stripe:stripe-android:20.4.1.
> Could not get resource 'https://google.bintray.com/exoplayer/com/stripe/stripe-android/20.4.1/stripe-android-20.4.1.pom'.
> Could not GET 'https://google.bintray.com/exoplayer/com/stripe/stripe-android/20.4.1/stripe-android-20.4.1.pom'. Received status code 502 from server: Bad Gateway
> Could not resolve com.stripe:financial-connections:20.4.1.
Required by:
project :app > project :stripe_android
> Could not resolve com.stripe:financial-connections:20.4.1.
> Could not get resource 'https://google.bintray.com/exoplayer/com/stripe/financial-connections/20.4.1/financial-connections-20.4.1.pom'.
> Could not GET 'https://google.bintray.com/exoplayer/com/stripe/financial-connections/20.4.1/financial-connections-20.4.1.pom'. Received status code 502 from server: Bad Gateway
发布规范.yaml文件
flutter_stripe:
安卓/build.gradle文件
buildscript {
ext.kotlin_version = '1.6.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.10'
}
}
allprojects {
repositories {
google()
mavenCentral()
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
我认为问题与jcentre()
有关,但在我的应用程序中没有使用jcentre()
,或者stripe
也没有使用它,但我仍然得到错误。
构建只是一次又一次地重试,但总是出现相同的错误。
我试过这条线,但没有运气
2条答案
按热度按时间hkmswyz61#
我设法通过操纵第二或第三部分的版本中的错误,无法解决它。
在抖动条纹中:5.0.0我的错误是20.9.+然后将其转换为20.9.0,它工作了。
在抖动条纹中:6.0.0我错误是20.12.+然后将其转换为20.11.0,它可以正常工作,而20.12.0无法正常工作。
nxagd54h2#
我遇到了同样的问题,我通过简单地升级gradel的版本就解决了这个问题。
我在项目级别添加了
classpath 'com.android.tools.build:gradle:7.1.2'
来构建.gradle,并将distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
添加到gradle.wrapper.properties。