錯誤信息如下
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugRuntimeClasspath'.
> Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.
> Execution failed for JetifyTransform: /Users/lhz/Documents/AndroidProject/hb_unicom_flutter/.android/Flutter/build/intermediates/flutter/debug/libs.jar.
> Transform's input file does not exist: /Users/lhz/Documents/AndroidProject/hb_unicom_flutter/.android/Flutter/build/intermediates/flutter/debug/libs.jar. (See https://issuetracker.google.com/issues/158753935)
這個問題的解決方法就在鏈接https://issuetracker.google.com/issues/158753935 中甩栈,需要翻墻訪問。
結(jié)論就是這是構(gòu)建時的一個BUG,Google應(yīng)該會在新版本gradle中修復(fù)毅访,現(xiàn)在的解決方法就是:
- 如果錯誤信息中是提示缺少 debug/libs.jar, 先執(zhí)行flutter run --debug 成功后蛉加,再執(zhí)行打包操作即可比原。
- 如果錯誤信息中是提示缺少 profile/libs.jar, 先執(zhí)行flutter run --profile 成功后,再執(zhí)行打包操作即可。
其實就是通過執(zhí)行相應(yīng)命令难衰,生產(chǎn)缺少的jar文件巫玻。