Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The plugin qrscan uses a deprecated version of the Android embedding. #123

Open
viniciusddrft opened this issue Oct 11, 2021 · 9 comments
Open

Comments

@viniciusddrft
Copy link

when I'm going to use the plugin I get this msg.

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-plugin-migration.
exit code 0

@chuck2098
Copy link

Hi, I get the same error!

@viveeeeeek
Copy link

Is this plugin abandoned? There is no update to plugin. Did you guys find any other solutions?

@rabihmb
Copy link

rabihmb commented Nov 4, 2021

I'm getting the same issue, any solution on this, please!

@HarryJhin
Copy link

i need solution!
😱😱😱

@tayfunuyar
Copy link

You can use https://pub.dev/packages/barcode_scan2

@imamhossain94
Copy link

place
tools:replace="android:icon"
in the AndroidManifest.xml tag

@rabihmb
Copy link

rabihmb commented Jan 7, 2022 via email

@imamhossain94
Copy link

imamhossain94 commented Jan 7, 2022

The android studio IDE suggested me to do that.

When I use drawable/ic_launcher.png
Instead of mipmap/ic_launcher.png

The IDE throws an error.

Launching lib\main.dart on SM A305F in debug mode...
Running Gradle task 'assembleDebug'...
D:\FlutterProjects\qr_code_scanner\android\app\src\debug\AndroidManifest.xml:14:9-45 Error:
	Attribute application@icon value=(@drawable/ic_launcher) from AndroidManifest.xml:14:9-45
	is also present at [:qrscan] AndroidManifest.xml:22:9-43 value=(@mipmap/ic_launcher).
	Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:12:4-57:19 to override.

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugMainManifest'.
> Manifest merger failed : Attribute application@icon value=(@drawable/ic_launcher) from AndroidManifest.xml:14:9-45
  	is also present at [:qrscan] AndroidManifest.xml:22:9-43 value=(@mipmap/ic_launcher).
  	Suggestion: add 'tools:replace="android:icon"' to <application> element at AndroidManifest.xml:12:4-57:19 to override.

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

BUILD FAILED in 4s
Exception: Gradle task assembleDebug failed with exit code 1

Here is my AndroidMenifest.xml file

<manifest xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    package="com.newagedevs.qr_code_scanner.qr_code_scanner">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.CAMERA"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
        tools:ignore="ScopedStorage" />
    <uses-permission android:name="android.permission.READ_EXTERNAL_STORAGE"/>

   <application
        android:label="@string/app_name"
        android:icon="@drawable/ic_launcher"
        android:roundIcon="@drawable/ic_launcher_round"
        android:allowBackup="true"
        tools:replace="android:icon"
        android:fullBackupContent="true">

        <!--Activities-->

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

</manifest>

Adding

tools:replace="android:icon"

this line inside tag fix this issue. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

8 participants