我最近回到了我以前的flutter项目,更新了一大堆东西,因为我得到了错误。现在我得到了下面的错误。我已经在上面至少3天了,尝试了一堆不同的东西,但我似乎仍然找不到解决办法。任何帮助都非常感谢。我还包含了下面的build.gradle
文件:
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not resolve com.google.android.gms:play-services-location:16.+.
Required by:
project :app > project :location
> Failed to list versions for com.google.android.gms:play-services-location.
> Unable to load Maven meta-data from https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml.
> Could not get resource 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'.
> Could not GET 'https://google.bintray.com/exoplayer/com/google/android/gms/play-services-location/maven-metadata.xml'. Received status code 502 from server: Bad Gateway
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
* Get more help at https://help.gradle.org
BUILD FAILED in 18s
[!] Gradle threw an error while downloading artifacts from the network. Retrying to download...
Exception: Gradle task assembleDebug failed with exit code 1
下面是我的android\build.gradle
:
buildscript {
ext.kotlin_version = '1.4.20'
repositories {
google()
//jcenter()
mavenCentral()
maven { url "https://maven.google.com/"}
}
dependencies {
classpath 'com.google.gms:google-services:4.3.10'
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'org.jetbrains.kotlin:kotlin-gradle-plugin:' + String.valueOf(kotlin_version)
}
}
allprojects {
repositories {
google()
//jcenter()
mavenCentral()
maven { url "https://maven.google.com/"}
}
}
rootProject.buildDir = '../build'
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(':app')
}
task clean(type: Delete) {
delete rootProject.buildDir
}
这是我的app\build。格雷德尔
:
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 FileNotFoundException("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: 'com.google.gms.google-services'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
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 "[id here]"
minSdkVersion 21
targetSdkVersion 30
versionCode flutterVersionCode.toInteger()
versionName flutterVersionName
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
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.debug
}
}
}
flutter {
source '../..'
}
dependencies {
implementation 'com.google.firebase:firebase-analytics:20.0.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.4.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.google.android.gms:play-services-ads:20.5.0'
}
bintray
存储库似乎再次出现问题,为了解决这个问题,我采用了这个非常有用的解决方案:https://stackoverflow.com/a/70319873/13843688
一切都按预期进行。
我在运行flutter应用程序时遇到此错误。 出了什么问题:任务': app: eck DebugAarMetdata'执行失败。 执行 com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction 时失败 依赖项的 AAR 元数据 (META-INF/com/android/build/gradle/aar-metadata
我是个新手,我试着发布我的应用程序。 颤振正在调试模式下构建apk } 当我把它改成这样的版本 } 它是这样显示的 PS C:\用户\Ravi\FlutterProjects\ticrectoe 正在运行Gradle任务'assembleRelase'...失败:构建失败,有一个异常。正在运行Gradle任务'assembleRelase'... 正在运行Gradle任务'assembleRela
我不能再发布我的应用程序了。我使用的是AndroidStudio 4.0和FlatterSDK版本1.17。5.上个月我已经发布了两次我的应用程序,但现在我真的不知道错误的原因是什么。当我在终端中键入时,会出现以下错误:
我得到这些错误,当我运行我的代码。请任何想法,我怎么能修复这些?我升级了颤振,pubspeck.lock.我提到代码是旧的,我试图升级 > 尝试:使用--stacktrace选项运行以获取堆栈跟踪。使用--info或--debug选项运行以获得更多日志输出。运行--扫描以获得完整的见解。 获取更多帮助https://help.gradle.org
当我要构建apk时,我收到此错误。 执行任务“app:transformClassesWithDexForDebug”失败。 这是错误的截图
null 请访问https://help.gradle.org获取更多帮助 生成在3M 12s中失败异常:Gradle task assembleDebug失败,退出代码为%1