wu9007/qrcode_scanner

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

viniciusddrft opened this issue · 9 comments

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

Hi, I get the same error!

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

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

i need solution!
😱😱😱

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

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!