Reputation: 3
I got this error when trying to insert TFLite plugin in dependencies in pubspec.yaml in android studio which cause the build to fail how to fix this error.
The plugin tflite
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-plugin-migration.
Upvotes: 0
Views: 12946
Reputation: 814
All you need is to do some changes in the android\app\src\main\AndroidManifest.xml file.
I already answered this question, you can find it here.
Upvotes: 0
Reputation: 11
Please try this tflite_flutter by adding this plugin to your pubspec.yaml file
Upvotes: 1
Reputation: 709
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:tools="http://schemas.android.com/tools"
package="com.example.debugbrains"> // change your package name here
<application
tools:replace="android:label"
android:label="CONNECT"
android:name="${applicationName}"
android:icon="@mipmap/launcher_icon">
<activity
android:name=".MainActivity"
android:exported="true"
android:launchMode="singleTop"
android:theme="@style/LaunchTheme"
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
android:hardwareAccelerated="true"
android:windowSoftInputMode="adjustResize">
<meta-data
android:name="io.flutter.embedding.android.NormalTheme"
android:resource="@style/NormalTheme"
/>
<intent-filter>
<action android:name="android.intent.action.MAIN"/>
<category android:name="android.intent.category.LAUNCHER"/>
</intent-filter>
</activity>
<meta-data
android:name="flutterEmbedding"
android:value="2" />
</application>
</manifest>
// Don't forget to change the package name of your app // Replace the androidManifest.xml with the above code
Upvotes: 1