【问题标题】:Error when attempting to build a release apk for flutter app - Could not resolve project :flutter_image_compress尝试为颤振应用程序构建发布 apk 时出错 - 无法解析项目:flutter_image_compress
【发布时间】:2019-07-11 11:34:35
【问题描述】:

我正在尝试为我的应用构建发布 apk。我收到以下错误

flutter build apk --release
$ flutter build apk --release
Initializing gradle...                                       2.8s
Resolving dependencies...                                    8.8s

FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:dynamicProfileRuntimeClasspath'.
   > Could not resolve project :flutter_image_compress.
     Required by:
         project :app
      > Could not select value from candidates [null, debug, release] using AlternateDisambiguationRule.BuildTypeRule.
         > java.lang.NullPointerException (no error message)

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

关于为什么会发生此问题的任何建议?

【问题讨论】:

    标签: android gradle flutter


    【解决方案1】:

    这个插件“flutter_image_compression”给你一个问题。这可能是由于插件和您的项目不兼容造成的。

    你可以尝试一些事情:

    1. 在您的 android/build.gradle 中添加以下行

    lintOptions {
            disable 'InvalidPackage'
            checkReleaseBuilds false
    }
    1. 再次在 build.gradle 中检查您的 kotlin 版本

    2. 如果问题仍然存在,我建议尝试使用 build gradle 版本等。如果一切都失败了,请尝试在 github 上向作者提交问题。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-12-30
      • 2020-03-22
      • 2021-08-24
      • 1970-01-01
      • 2022-10-08
      • 1970-01-01
      • 2020-05-11
      • 2022-01-01
      相关资源
      最近更新 更多