Android embedding v2
Getting this when i'm trying to run my app:
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.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin `appsflyer_sdk` requires your app to be migrated to the Android embedding v2. Follow the steps on https://flutter.dev/go/android-project-migration and re-run this command.
Hi @Theunodb, Thank you for reaching out to us.
I believe that your app was created before Flutter v1.12, and your MainActivity is still extending FlutterActivity imported from io.flutter.app.FlutterActivity.
This class is now deprecated in Flutter, and you have to migrate your project following this guide.
If this message still exists after migrating your project, please check your 3'rd party dependencies and make sure they aren't using the deprecated Android embedding.
hi @Theunodb , thanks for reaching to us.
To remove this problem just follow my steps: Step1: Open Main Activity of Android (JAVA/Kotlin) Replace the main activity with this line of code .......................................................................................................... import io.flutter.embedding.android.FlutterActivity;
class MainActivity: FlutterActivity() {
}
............................................................................................................
Step 2: Open AndroidManifest.xml
Make these changes
.............................................................................
replace this:-
android:name="${applicationName}"
.............................................................................................................................................................
replace meta data with this one
then flutter clean, flutter pub Get, flutter Pub upgrade RUN THE PROGRAM
Hi @Theunodb, Thank you for reaching out to us.
I believe that your app was created before Flutter v1.12, and your
MainActivityis still extendingFlutterActivityimported fromio.flutter.app.FlutterActivity. This class is now deprecated in Flutter, and you have to migrate your project following this guide. If this message still exists after migrating your project, please check your 3'rd party dependencies and make sure they aren't using the deprecatedAndroid embedding.
HI, can you please tell me absolute solution? I don't want to migrate app every time. I would like to not to see this kind of message every time I create flutter application. Thanks in Advance.
@Blacktaler can you mention which version of flutter are you using to create flutter application? I tried creating in version 3.0.2 on stable branch and this error is not present.
That time I was using 2.10.3 - version of flutter and I was having errors like that
On 16 Jun 2022, at 12:13, Srihari Ayapilla @.***> wrote:
@Blacktaler https://github.com/Blacktaler can you mention which version of flutter are you using to create flutter application? I tried creating in version 3.0.2 on stable branch and this error is not present.
— Reply to this email directly, view it on GitHub https://github.com/AppsFlyerSDK/appsflyer-flutter-plugin/issues/192#issuecomment-1157316340, or unsubscribe https://github.com/notifications/unsubscribe-auth/AT5JRJSNYLQLSRVPFKG27HLVPLHYFANCNFSM5LS4NDCQ. You are receiving this because you were mentioned.
Hi I have same error when using open file PDF
he plugin open_file uses a deprecated version of the Android embedding.
To avoid unexpected runtime failures, or future build failures, try to see if
this plugin supports the Android V2 embedding. Otherwise, consider removing it
since a future release of Flutter will remove these deprecated APIs.
If you are plugin author, take a look at the docs for migrating the plugin to
the V2 embedding: https://flutter.dev/go/android-plugi
Only the developers of the plugin can upgrade it to next level or until you how how the plugin is coded
I have followed the following steps but it is still showing the error.
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.
Take a look at the docs for migrating an app: https://github.com/flutter/flutter/wiki/Upgrading-pre-1.12-Android-projects
The plugin firebase_analytics requires your app to be migrated to the Android embedding v2. Follow the steps on the migration doc above and re-run this command.