今天Flutter打包apk的时候,Gradle报错;上网一查,好家伙,全是

lintOptions {
disable ‘InvalidPackage’
checkReleaseBuilds false
abortOnError false
}

为什么有错误就非要忽略提示呢?看不见就不存在吗?无语……

于是自己在StackOverFlow上找了一圈,找到了一个可以解决的。
如下,在终端依次执行三个命令:

  1. flutter build apk --debug

  2. flutter build apk --profile

  3. flutter build apk --release

各位可以自行尝试。
我这里是解决了。Flutter Execution failed for task ‘:app:lintVitalRelease‘另一种解决(非修改build.gradle)
答主给的原因是:

With Android plugin 4.0 there may be specific problem either end with debug/libs.jar or profile/libs.jar. This indicates which apk you need to build first. In this case it is debug/libs.jar so building --debug first and then --release worked. In my case, it was profile/libs.jar so building --profile and then --release will work. If you want not to follow all three steps, build signed apk or appbudle with Android Studio, opeing android directory in. – Subair K

或者,你也可以尝试在 /app/build/reports/lint-results-release-fatal.html(or .xml) 找到详细错误原因并修复。

相关文章:

  • 2022-01-20
  • 2021-07-03
  • 2022-12-23
  • 2021-11-19
  • 2021-04-27
  • 2021-03-31
  • 2021-10-05
  • 2021-06-02
猜你喜欢
  • 2021-05-22
  • 2022-12-23
  • 2021-10-01
  • 2021-12-31
  • 2021-07-06
  • 2022-12-23
  • 2021-05-20
相关资源
相似解决方案