Create an account

Very important

  • To access the important data of the forums, you must be active in each forum and especially in the leaks and database leaks section, send data and after sending the data and activity, data and important content will be opened and visible for you.
  • You will only see chat messages from people who are at or below your level.
  • More than 500,000 database leaks and millions of account leaks are waiting for you, so access and view with more activity.
  • Many important data are inactive and inaccessible for you, so open them with activity. (This will be done automatically)


Thread Rating:
  • 196 Vote(s) - 3.49 Average
  • 1
  • 2
  • 3
  • 4
  • 5
"Build failed due to use of deprecated Android v1 embedding" when building Flutter app

#1
```
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:

C:\Users\ALI HASSAN\OneDrive\Desktop\New folder\arcore_app\example\android\app\src\main\AndroidManifest.xml uses
`android:name="io.flutter.app.FutterApplication"`
━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━

Build failed due to use of deprecated Android v1 embedding.
```
Reply

#2
You can find the solution by creating a new project with the latest sdk and compare the two project's android\app\src\main\AndroidManifest.xml file.

Reply

#3
**Change the android AndroidManifest.xml file**

<application
android:name="io.flutter.app.FlutterApplication"
...
</application>

**TO**

android:name="${applicationName}"

Also added these two lines

<meta-data
android:name="flutterEmbedding"
android:value="2" />



Reply

#4
You need to change the **android\app\src\main\AndroidManifest.xml** file.

From :

<application
android:name="io.flutter.app.FlutterApplication"
...
To :

<application
android:name="${applicationName}"
...
add this three lines if doesn't exist :


<meta-data
android:name="flutterEmbedding"
android:value="2" />
...

This is used by the Flutter tool to generate GeneratedPluginRegistrant.java.
Reply

#5
in Main Manifest.xml file ,



set android:exported = "false".


other Solution is ,

in app gradle ,

change Targetsdkversion to 30 and Compilesdkversion to 31

worked for me
Reply

#6
Exactly as the error tells you you're using a deprecated embedding version. To upgrade to a newer version please do the following :
1. Navigate to android/app/src/main/java/[your/package/name]/MainActivity.java open MainActivity.java or MainActivity.kt.
2. Delete the following dependencies

import android.os.Bundle;
import io.flutter.app.FlutterActivity;
import io.flutter.plugins.GeneratedPluginRegistrant;
and replace them with the following line

import io.flutter.embedding.android.FlutterActivity;

3. Open android/app/src/main/AndroidManifest.xml.
4. Replace the reference to FlutterApplication in the application tag with ${applicationName} as following

<application
android:name="${applicationName}"
>
<!-- code omitted -->
</application>
5.Remove all <meta-data> tags with key android:name="io.flutter.app.android.SplashScreenUntilFirstFrame".
and Add a new <meta-data> tag under application.

<meta-data
android:name="flutterEmbedding"
android:value="2" />

after that everything should be working fine
Reply

#7
If you left your project a long time ago and returned now, you have a few things to change, but they are simple if you know them:

**Manifest**
Change whatever you have written before here with:

<application android:name="${applicationName}"
add in **<application..**:

<application android:exported="true"...>
<meta-data
android:name="flutterEmbedding"
android:value="2" />..

In the main theme of the Activity main attention to correct with:

<meta-data android:name="io.flutter.embedding.android.NormalTheme" android:resource="your theme" />

Hope you have the **kotlin** class as a reference, so you can go in the case of **MainActivity.kt**:

package com.yourpackage.....
import io.flutter.embedding.android.FlutterActivity
class MainActivity: FlutterActivity() {
//If you have some native code put it back
}

If you have **Java** Activity Main:

package com.yourpackage.....

import io.flutter.embedding.android.FlutterActivity;
public class MainActivity extends FlutterActivity {
// You can keep this empty class or remove it.
}

It is also worth updating **targetSdkVersion** and **compileSdkVersion**, in my case at: **31**
Reply

#8
just remove android platform and re-add android.

remove

rm -r android

add platform

flutter create --platforms=android .
Reply

#9
You need to change the android\app\src\main\AndroidManifest.xml file.

From :

<application
android:name="io.flutter.app.FlutterApplication"
...
To :

<application
android:name="${applicationName}"
...
add this three lines if doesn't exist :

<meta-data
android:name="flutterEmbedding"
android:value="2" />
...
This is used by the Flutter tool to generate GeneratedPluginRegistrant.java.
Reply

#10
maybe not the solution, you are looking for, but the only thing which worked for me is to change tflite dependency to tflite_flutter
Reply



Forum Jump:


Users browsing this thread:
1 Guest(s)

©0Day  2016 - 2023 | All Rights Reserved.  Made with    for the community. Connected through