FAILURE: Build failed with an exception.
DizzyDuan opened this issue · 8 comments
Android Studio 4.2.1
classpath 'com.android.tools.build:gradle:4.2.1'
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
Flutter SDK 2.2.1
使用命令打包:flutter build apk
FAILURE: Build failed with an exception.
-
Where:
Build file '*****/alipay_kit-2.2.0-nullsafety/android/build.gradle' line: 22 -
What went wrong:
A problem occurred evaluating root project 'alipay_kit'.
Project with path ':alipay_kit' could not be found in root project 'alipay_kit'.
-
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 4s
The plugin alipay_kit could not be built due to the issue above.
rootProject.allprojects {
repositories {
google()
jcenter()
// 私仓
flatDir {
dirs project(':alipay_kit').file('libs') // 错误位置
}
}
}
日志不全
FAILURE: Build failed with an exception.
- What went wrong:
Execution failed for task ':vibrate:verifyReleaseResources'.
A failure occurred while executing com.android.build.gradle.tasks.VerifyLibraryResourcesTask$Action
Android resource linking failed
ERROR:**/.gradle/caches/transforms-2/files-2.1/74857e92e62238cc628ade6c3cd5b4d2/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontStyle not found.
ERROR:**/.gradle/caches/transforms-2/files-2.1/74857e92e62238cc628ade6c3cd5b4d2/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/font not found.
ERROR:**/.gradle/caches/transforms-2/files-2.1/74857e92e62238cc628ade6c3cd5b4d2/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontWeight not found.
ERROR:**/.gradle/caches/transforms-2/files-2.1/74857e92e62238cc628ade6c3cd5b4d2/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/fontVariationSettings not found.
ERROR:**/.gradle/caches/transforms-2/files-2.1/74857e92e62238cc628ade6c3cd5b4d2/core-1.1.0/res/values/values.xml:142:5-173:25: AAPT: error: resource android:attr/ttcIndex not found.
-
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 3m 14s
把Android Studio更新到最新版
classpath 'com.android.tools.build:gradle:4.2.1'
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
使用命令flutter build apk 就会出现问题
这就与我无关了,你需要做的事升级 android/app/build.gradle 里的 compileSdkVersion
我自己的已经是
compileSdkVersion 30
我修改alipay_kit的compileSdkVersion 30也是build失败的
建议作者可以升级测试一下:
classpath 'com.android.tools.build:gradle:4.2.1'
其实把
classpath 'com.android.tools.build:gradle:4.2.1'
降到
classpath 'com.android.tools.build:gradle:4.1.2'
就可以正常build了
我升级了 com.android.tools.build:gradle:4.2.1 和 https://services.gradle.org/distributions/gradle-6.7.1-bin.zip,一切都正常 ...
而且我翻看了 com.android.tools.build:gradle:4.2.1 里的 flatDir,和 4.1.2 版本木有区别 ...
Android Studio:
classpath 'com.android.tools.build:gradle:4.2.2'
distributionUrl=https://services.gradle.org/distributions/gradle-6.7.1-bin.zip
使用命令打包
flutter build apk
flutter build apk --no-shrink
FAILURE: Build failed with an exception.
-
Where:
Build file '/Users/*****/flutter/.pub-cache/hosted/pub.flutter-io.cn/alipay_kit-2.2.0-nullsafety/android/build.gradle' line: 22 -
What went wrong:
A problem occurred evaluating root project 'alipay_kit'.
Project with path ':alipay_kit' could not be found in root project 'alipay_kit'.
-
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 5s
The plugin alipay_kit could not be built due to the issue above.
诸位,最后怎么解决的,我也出现了这个问题