appsflyer-flutter-plugin icon indicating copy to clipboard operation
appsflyer-flutter-plugin copied to clipboard

Android embedding v2

Open Theunodb opened this issue 4 years ago • 8 comments

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.

Theunodb avatar Jan 10 '22 06:01 Theunodb

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.

pazlavi avatar Jan 10 '22 09:01 pazlavi

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 ....................................................................................................................................................................... and after that you might need to upgrade your compileSdkVersion 31,

then flutter clean, flutter pub Get, flutter Pub upgrade RUN THE PROGRAM

KratosOfficial avatar Apr 28 '22 08:04 KratosOfficial

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, 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 avatar May 20 '22 06:05 Blacktaler

@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.

srihariash999 avatar Jun 16 '22 07:06 srihariash999

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.

Blacktaler avatar Jun 16 '22 07:06 Blacktaler

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

hasanhammoudah avatar Nov 29 '22 09:11 hasanhammoudah

Only the developers of the plugin can upgrade it to next level or until you how how the plugin is coded

KratosOfficial avatar Jan 01 '23 05:01 KratosOfficial

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.

ahmed-raza-92 avatar May 19 '23 07:05 ahmed-raza-92