AndroidManifest.xml uses `android:name="io.flutter.app.FutterApplication"`

Viewed 15352

After upgrading to Flutter 2.10, I get the following error:

━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
Warning
──────────────────────────────────────────────────────────────────────────────
Your Flutter application is created using an older version of the Android
embedding. It is being deprecated in favor of Android embedding v2. Follow the
steps at

https://flutter.dev/go/android-project-migration

to migrate your project. You may also pass the --ignore-deprecation flag to
ignore this check and continue with the deprecated v1 embedding. However,
the v1 Android embedding will be removed in future versions of Flutter.
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
The detected reason was:

  /android/app/src/main/AndroidManifest.xml uses `android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

I've already upgraded to Flutter embedding 2. How to solve this error?

5 Answers

I was able to solve this by setting android:name to

android:name="${applicationName}" in android/app/src/main/AndroidManifest.xml:

    <application
        android:name="${applicationName}"

Apparently Flutter 2.10 has stricter checks than previous versions.

open your AndroidManifest.xml just remove this lineandroid:name="io.flutter.app.FlutterApplication"

there is two solutions

first solution, you can replace

android:name="io.flutter.app.FutterApplication"

with

android:name="${applicationName}"

the second solution, remove

android:name="io.flutter.app.FutterApplication"

and run your code

may be you are working on an old version of Flutter so you faced this problem and maybe you'll face another problems so let's discuss them

1- in this path

{App Dir}\android\app\src\main\AndroidMainfest.xml

you'll find attribute android:name the problem is in its value so we should change it android:name="io.flutter.app.FlutterApplication" convert it to => android:name="${applicationName}"

2- in this path {App Dir}\android\build.gradle

you will find this line ext.kotlin_version = 'XXXXXX'

so you should update it to the latest version of kotlin

you can find it here so latest version for me in 06 JULY 2022 is 1.7.0

i put it in my project and it was ext.kotlin_version = '1.7.0'

i hope that i helped you

Related