android - 构建 Flutter 应用时的 "Build failed due to use of deprecated Android v1 embedding"

标签 android flutter

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.

最佳答案

您需要更改 android\app\src\main\AndroidManifest.xml 文件。
从 :

<application
    android:name="io.flutter.app.FlutterApplication"
    ...
至 :
<application
        android:name="${applicationName}"
        ...
如果不存在,添加这三行:
<meta-data
        android:name="flutterEmbedding"
        android:value="2" />
          ...
Flutter 工具使用它来生成 GeneratedPluginRegistrant.java。

关于android - 构建 Flutter 应用时的 "Build failed due to use of deprecated Android v1 embedding",我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/71413851/

相关文章:

android - 我在库模块中有 .aar 文件,如何在应用程序模块中使用它?

android - 如何使用 MediaRecorder 获取每个录音频率?

android - flutter build apk错误

android - 复制操作栏嵌入式选项卡

java - 登录后Android存储用户ID

android - ListView 始终具有相同的 Intent

dart - 如何在 Flutter 中实现滑动到上一页?

firebase - Flutter Firebase Realtime数据库获取单个数据查询结果值null

firebase - Flutter:cloud_firestore 的构建错误:高于版本 "0.7.4"

utf-8 - 文本中出现无效的阿拉伯语/波斯语单词