web-dev-qa-db-fra.com

Comment corriger l'incompatibilité de flutter AndroidX?

Je viens d'importer le plugin webview_flutter et j'ai constaté que le plugin était incompatible avec mon environnement de flutter. Ensuite, en utilisant Android Studio, je migre mon environnement AndroidX avec l'option "Migrer vers AndroidX".

Je souhaite utiliser le plugin webview_flutter pour afficher la page. Pourriez-vous m'aider? Je vous remercie

Voici le message d'erreur

Lancement de lib/main.Dart sur Andromax B26D2H en mode débogage ... D8: Type de programme déjà présent: Android.support.v4.media.MediaBrowserCompat $ ItemCallback

ÉCHEC: la construction a échoué avec une exception.

  • Problème: l'exécution a échoué pour la tâche ': app: transformDexArchiveWithExternalLibsDexMergerForDebug'.

    com.Android.builder.dexing.DexArchiveMergerException: erreur lors de la fusion des archives dex: /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/22.jar,/Users/tio/Documents/Développement/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/105.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/148.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/133.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/72.jar , /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/128.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug /79.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/88.jar,/Users/tio/Documents/Development/firecek_2019/build/app/inte rmediates/transforms/dexBuilder/debug/110.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/67.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/120.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/91.jar,/Users/tio/Documents/Développement/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/102.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/6.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/118.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/5.jar , /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/52.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug /58.jar , /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/43.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug /127.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/142.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms /dexBuilder/debug/151.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/19.jar,/Users/tio/Documents/Development/firecek_2019/build/app /intermediates/transforms/dexBuilder/debug/34.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/46.jar,/Users/tio/Documents/Development/firecek_2019 /build/app/intermediates/transforms/dexBuilder/debug/63.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/107.jar,/Users/tio/Documents/Développement/firecek _2019/build/app/intermediates/transforms/dexBuilder/debug/9.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/31.jar,/Users/tio/Documents/Développement/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/15.jar, /Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/115.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/70.jar,/Users/tio/Documents/Development/firecek_2019/build/app/intermediates/transforms/dexBuilder/debug/62 .jar, découvrez comment résoudre le problème sur https://developer.Android.com/studio/build/dependencies#duplicate_classes . Type de programme déjà présent: Android.support.v4.media.MediaBrowserCompat $ ItemCallback

  • Essayez: exécutez avec l'option --stacktrace pour obtenir la trace de la pile. Exécutez avec l'option --info ou --debug pour obtenir plus de sortie de journal. Exécutez avec --scan pour obtenir des informations complètes.

  • Obtenez plus d'aide sur https://help.gradle.org

ÉCHEC DE LA CONSTRUCTION en 4m 59s


L'échec de Gradle peut être dû à des incompatibilités AndroidX dans cette application Flutter. Voir https://flutter.dev/docs/development/packages-and-plugins/androidx-compatibility pour plus d'informations sur le problème et comment le résoudre.


La tâche Gradle assembleDebug a échoué avec le code de sortie 1 Exit (sigterm)

3
Wisnu Wijokangko

Créez un nouveau projet Flutter et déplacez-y le code existant: migration Flutter

flutter create --androidx -t <project-type> <new-project-path>

par exemple: flutter create --androidx -t app.

1
Sujith Nair