当试图在Android Studio中的pubspec.yaml中插入tflite插件时,我遇到了这个错误,这会导致构建如何解决此错误。
插件 tflite
使用Android嵌入的弃用版本。
为了避免意外的运行时故障或将来的构建故障,请尝试查看此插件是否支持Android V2嵌入。否则,考虑将其删除,因为
将来的扑来释放将消除这些弃用的API。
如果您是插件作者,请查看将插件迁移到v2嵌入的文档:。
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.
发布评论
评论(3)
//不要忘记更改应用程序的包装名称
//用上述代码替换AndroidManifest.xml
// Don't forget to change the package name of your app
// Replace the androidManifest.xml with the above code
请尝试此 tflite_flutter 通过将此插件添加到您的pubspec.yaml文件
在此处输入图像描述
Please try this tflite_flutter by adding this plugin to your pubspec.yaml file
enter image description here
您需要的只是在Android \ App \ Src \ Main \ AndroidManifest.xml文件中进行一些更改。
我已经回答了这个问题,您可以找到在这里。
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.