首页 > 解决方案 > 颤振发布apk错误:任务':app:lintVitalRelease'执行失败

问题描述

我不能再发布我的应用程序了。我正在使用 AndroidStudio 4.0 和颤振 sdk 版本 1.17.5 。我上个月发布了两次我的应用程序,但现在我真的不知道错误的原因是什么。当我输入flutter build apk --release终端时,会出现这些错误:

        Running Gradle task 'assembleRelease'...


FAILURE: Build failed with an exception.



* What went wrong:

Execution failed for task ':app:lintVitalRelease'.

> Could not resolve all artifacts for configuration ':app:profileRuntimeClasspath'.

   > Failed to transform libs.jar to match attributes {artifactType=processed-jar, org.gradle.libraryelements=jar, org.gradle.usage=java-runtime}.

      > Execution failed for JetifyTransform: ....\build\app\intermediates\flutter\profile\libs.jar.

         > Failed to transform '....\build\app\intermediates\flutter\profile\libs.jar' using Jetifier. Reason: FileNotFoundException, message: ....\build\app\intermediates\flutter\profile\libs.jar (The system cannot find the path specified). (Run with --stacktrace for more details.)

           Please file a bug at http://issuetracker.google.com/issues/new?component=460323.



* 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 42s
Running Gradle task 'assembleRelease'...                           43.4s
Gradle task assembleRelease failed with exit code 1

标签: androidfluttergradlebuildrelease

解决方案


如果错误是关于profile/libs.jar,请在终端中执行以下操作:

flutter build apk --profile

进而

flutter build apk --release  

解决了这个问题。

如果错误是关于 debug/libs.jar

flutter build apk --debug

进而

flutter build apk --release  

会解决问题


推荐阅读