MistyD
MistyD

Reputation: 17223

Error when attempting to build a release apk for flutter app - Could not resolve project :flutter_image_compress

I am attempting to build a release apk for my app. And I get the following error

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.

Any suggestions on why this issue might be happening ?

Upvotes: 3

Views: 763

Answers (1)

0xCCY
0xCCY

Reputation: 555

This plugin "flutter_image_compression" is giving you an issue. This might be due to an incompatibility between the plugin and your project.

Few things you could try:

  1. Add the lines below in your android/build.gradle

lintOptions {
        disable 'InvalidPackage'
        checkReleaseBuilds false
}

  1. Check if your kotlin version, again in the build.gradle enter image description here

  2. If the problem still persists I suggest to try playing around with the build gradle version, etc. If all else failed, try submitting an issue on github to the author.

Upvotes: 2

Related Questions