【问题标题】:Getting error while trying to build with flutter_local_notification plugin in my flutter app尝试在我的 Flutter 应用程序中使用 flutter_local_notification 插件构建时出错
【发布时间】:2021-02-24 02:40:07
【问题描述】:

在调试模式下在 sdk gphone x86 arm 上启动 lib\main.dart... lib\main.dart

FAILURE:构建失败并出现异常。

  • 出了什么问题: 任务“:app:processDebugResources”执行失败。

执行 com.android.build.gradle.internal.tasks.Workers$ActionFacade 时发生故障 Android资源链接失败 C:\Users\shibl\Desktop\project-3\myTodo\android\app\src\main\AndroidManifest.xml:44:13-51:23: AAPT: error: unexpected element found in.

 C:\Users\shibl\Desktop\project-3\myTodo\android\app\src\main\AndroidManifest.xml:52:12-109: AAPT: error: unexpected element <receiver> found in <manifest><application><activity>.
  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

  • 通过https://help.gradle.org获得更多帮助

在 15 秒内构建失败 构建失败可能是由于插件中的 AndroidX 不兼容。该工具即将尝试使用Jetfier解决不兼容问题。 构建插件flutter_local_notifications...

FAILURE:构建失败并出现异常。

  • 在哪里: 构建文件 'C:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\flutter_local_notifications-3.0.1+2\android\build.gradle' 行:22

  • 出了什么问题: 评估根项目“flutter_local_notifications”时出现问题。

应用插件失败 [id 'com.android.internal.version-check'] 支持的最低 Gradle 版本为 5.6.4。当前版本是 5.6.2。如果使用 gradle 包装器,请尝试将 C:\Flutter\flutter.pub-cache\hosted\pub.dartlang.org\flutter_local_notifications-3.0.1+2\android\gradle\wrapper\gradle-wrapper.properties 中的 distributionUrl 编辑为gradle-5.6.4-all.zip

  • 尝试: 使用 --stacktrace 选项运行以获取堆栈跟踪。使用 --info 或 --debug 选项运行以获得更多日志输出。运行 --scan 以获得完整的见解。

  • 通过https://help.gradle.org获得更多帮助

在 2 秒内构建失败 例外:由于上述问题,无法构建插件 flutter_local_notifications。 退出(sigterm)

【问题讨论】:

    标签: android flutter debugging gradle error-handling


    【解决方案1】:

    我遇到了同样的错误,我通过将接收器语法放在 AndroidManifest.xml 中的应用程序标记内来解决它。

    【讨论】:

      猜你喜欢
      • 2020-07-13
      • 2021-08-27
      • 2015-07-15
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2021-09-11
      • 2019-04-02
      • 2022-11-10
      相关资源
      最近更新 更多