I have this problem. Plz let me know how to solve this problem..
I got this git code from a lesson made about 2years ago.
Also different errors showed up when I made a flutter project using git code.
-> This is the problem
This app is using a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to migrate this app to the V2 embedding.
4
Answers
This has been answered before here on SO.
Here:
Your Flutter application is created using an older version of the Android embedding
And here: How to Fix Flutter Warning: Your Flutter application is created using an older version
You can also look at the source of how to migrate here:
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
If you are here because of the flutter 2.10, do this:
Change this:
To this:
If the application is very old, you should consult the migration guide that the documentation or fial offers you, just like the other answers recommend.
https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
but if you still have the deprecated application warnning try the following
flutter clean
rm pubspec.lock
flutter pub upgrade --major-versions
(this command will update all the libraries you have, be careful, before evaluating if such an update is necessary in your project).then you must make some changes at the android folder level
change the gradle.zip in
android/gradle/wrapper/gradle-wrapper.properties
to a newer version like:and in
android/build.gradle
update the version tothe kotlin version in :
ext.kotlin_version = '1.6.10'
and if you were using code obfuscation with
proguard-rules.pro
remove any added configurations that reference that file in
android/app/build.gradle
and you should be left with just thisfinally close the code editor or the IDE you use
and in console run
flutter pub get
and run your projectflutter run
Last but not least, do not forget to update the build version of your application to API 33 or higher and have your android studio updated (VERY IMPORTANT FOR UPDATE, )
android-studio
step 1: In android studio go to "android/app/src/main/java/[your/package/name]/MainActivity.java" and remove everything except package at the top paste the following as it is
step 2: Open "android/app/src/main/AndroidManifest.xml", under
<application
changeto
Remove all
<meta-data>
tags with keyandroid:name="io.flutter.app.android.SplashScreenUntilFirstFrame"
and pasteat its place
step 3: Add the following below the end of application tag i.e. below
</application>
step 4: In terminal run
flutter clean