Opening an old Flutter project says: Your Flutter application is created using an older version of the Android embedding
My flutter SDK version : 1.22.4
When opening an old flutter project, you may encounter the following two warnings ( the new project created by FlutterSDK1.22.4 will not have these two problems, so it is easy to find a way to fix the problem by comparing the new project with the old project ):
- Your Flutter application is created using an older version of the Android
- embedding. It's being deprecated in favor of Android embedding v2.
Solution : Open the AndroidManifest.xml file in the app folder in the android directory, and add the following code below the activity tag:
- android:value="2" />
Then when I run the project, I get the following error:
- error: incompatible types: MainActivity cannot be converted to FlutterEngine
Solution: Comment out this line of code and it's ok
- [!] Your app isn't using AndroidX.
- To avoid potential build failures, you can quickly migrate your app by following the steps on https://goo.gl/CP92wY.
Solution : Add the following code to gradle.properties in the android folder: