I’m trying to build a flutter app with deferred components to implement a kind of plugin system for my mobile app. I’ve followed the steps on https://docs.flutter.dev/perf/deferred-components, and I’ve got to the point where I have copied all generated files into my project and the deferred components validation has passed. But when I run flutter build appbundle
I get the following error in the ‘android/build.gradle’:
<code>Deferred components prebuild validation passed.
Shrinking has been disabled for this build due to deferred components. Shrinking is not available for multi-apk applications. This limitation is expected to be removed when Gradle plugin 4.2+ is available in Flutter.
FAILURE: Build failed with an exception.
Build file 'C:UsersNosaCodingBachelorarbeitapp_with_pluginsandroidbuild.gradle' line: 13
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Unable to find matching projects for Dynamic Features: [:plugin_one]
> 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
Running Gradle task 'bundleRelease'... 1.369ms
Gradle task bundleRelease failed with exit code 1
<code>Deferred components prebuild validation passed.
Shrinking has been disabled for this build due to deferred components. Shrinking is not available for multi-apk applications. This limitation is expected to be removed when Gradle plugin 4.2+ is available in Flutter.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:UsersNosaCodingBachelorarbeitapp_with_pluginsandroidbuild.gradle' line: 13
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Unable to find matching projects for Dynamic Features: [:plugin_one]
* 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 739ms
Running Gradle task 'bundleRelease'... 1.369ms
Gradle task bundleRelease failed with exit code 1
</code>
Deferred components prebuild validation passed.
Shrinking has been disabled for this build due to deferred components. Shrinking is not available for multi-apk applications. This limitation is expected to be removed when Gradle plugin 4.2+ is available in Flutter.
FAILURE: Build failed with an exception.
* Where:
Build file 'C:UsersNosaCodingBachelorarbeitapp_with_pluginsandroidbuild.gradle' line: 13
* What went wrong:
A problem occurred evaluating root project 'android'.
> A problem occurred configuring project ':app'.
> Unable to find matching projects for Dynamic Features: [:plugin_one]
* 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 739ms
Running Gradle task 'bundleRelease'... 1.369ms
Gradle task bundleRelease failed with exit code 1
I skipped Step 1.2 because (as far as I understand it) it’s only needed when you want to use the Google Play Store as your distribution model, which I am currently not planning to do.
Flutter doctor shows no errors or warnings:
I am providing a minimal reproducible example on github under https://github.com/nomoruyi/app_with_plugins