Ошибка сборки отложенных компонентов FlutterAndroid

Форум для тех, кто программирует под Android
Ответить
Anonymous
 Ошибка сборки отложенных компонентов Flutter

Сообщение Anonymous »

Я пытаюсь создать флаттер-приложение с отложенными компонентами, чтобы реализовать своего рода систему плагинов для моего мобильного приложения. Я выполнил шаги, описанные в https://docs.flutter.dev/perf/deferred-comComponents, и дошел до того, что скопировал все сгенерированные файлы в свой проект, и проверка отложенных компонентов прошла. Но когда я запускаю flutter build appbundle, я получаю следующую ошибку в файле android/build.gradle:

Код: Выделить всё

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:\Users\Nosa\Coding\Bachelorarbeit\app_with_plugins\android\build.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
Я пропустил шаг 1.2, потому что (насколько я понимаю) он необходим только в том случае, если вы хотите использовать Google Play Store в качестве модели распространения, чего я в настоящее время не планирую делать.
Flutter Doctor не показывает ошибок или предупреждений:

Код: Выделить всё

Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, 3.22.2, on Microsoft Windows [Version 10.0.22631.3810], locale de-DE)
[√] Windows Version (Installed version of Windows is version 10 or higher)
[√] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[√] Chrome - develop for the web
[√] Visual Studio - develop Windows apps (Visual Studio Community 2022 17.6.3)
[√] Android Studio (version 2024.1)
[√] IntelliJ IDEA Ultimate Edition (version 2024.1)
[√] Connected device (4 available)
[√] Network resources

• No issues found!
Я предоставляю минимальный воспроизводимый пример на github по адресу https://github.com/nomoruyi/app_with_plugins
РЕДАКТИРОВАТЬ:Теперь я изменил кое-что, в основном методом проб и ошибок, но также получил некоторую информацию из https://github.com/flutter/flutter/wiki ... Components. Я думаю, что я ближе к решению, но теперь получаю другую ошибку:

Код: Выделить всё

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.
C:\Users\Nosa\Coding\Bachelorarbeit\app_with_plugins\android\plugin_one\src\main\AndroidManifest.xml Error:
android:exported needs to be explicitly specified for element . Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
C:\Users\Nosa\Coding\Bachelorarbeit\app_with_plugins\android\plugin_one\src\main\AndroidManifest.xml Error:
android:exported needs to be explicitly specified for element . Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined. See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.
C:\Users\Nosa\Coding\Bachelorarbeit\app_with_plugins\android\plugin_one\src\main\AndroidManifest.xml Error:
android:exported needs to be explicitly specified for element . Apps targeting Android 12 and higher are required to specify an explicit value for `android:exported` when the corresponding component has an intent filter defined.  See https://developer.android.com/guide/topics/manifest/activity-element#exported for details.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':plugin_one:processReleaseMainManifest'.
> Manifest merger failed with multiple errors, see logs

* 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 1s
Running Gradle task 'bundleRelease'...                           2.355ms
Gradle task bundleRelease failed with exit code 1
Я не могу установить для Android SDK значение

Подробнее здесь: https://stackoverflow.com/questions/787 ... ild-failed
Ответить

Быстрый ответ

Изменение регистра текста: 
Смайлики
:) :( :oops: :roll: :wink: :muza: :clever: :sorry: :angel: :read: *x)
Ещё смайлики…
   
К этому ответу прикреплено по крайней мере одно вложение.

Если вы не хотите добавлять вложения, оставьте поля пустыми.

Максимально разрешённый размер вложения: 15 МБ.

Вернуться в «Android»