当前位置: 首页 > 知识库问答 >
问题:

如何将flutter_local_notifications添加到我的应用程序?

姬慎之
2023-03-14

我想在我的应用程序中添加带有flatter\u local\u通知的通知,但一旦我将插件添加到我的应用程序中。yaml,我的应用程序不再运行。下面是错误

```D8: Program type already present: android.support.v4.app.INotificationSideChannel

失败:生成失败,出现异常。

>

  • 错误:任务执行失败:app:transformDexArchiveWithExternalLibsDexMergerForDebug'。

    通用域名格式。Android建设者德兴。DexArchiveMergerException:合并dex存档时出错:/Users/macbook/AndroidStudio项目/restaurant/build/app/intermediates/transforms/dexBuilder/debug/2。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/3。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/6。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/7。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/8。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/9。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/10。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/11。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/12。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/13。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/14。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/15。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/16。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/17。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/18。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/19。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/20。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/21。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/22。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/23。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/24。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/25。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/26。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/27。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/28。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/29。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/30。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/31。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/32。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/33。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/34。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/35。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/36。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/37。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/38。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/39。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/40。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/41。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/42。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/43。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/44。jar、/Users/macbook/AndroidStudioProjects/restaurant/build/app/intermediates/transforms/dexBuilder/debug/45。jar了解如何在https://developer.android.com/studio/build/dependencies#duplicate_classes.程序类型已存在:android。支持v4。应用程序。INotificationSideChannel

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

    得到更多的帮助https://help.gradle.org

    建筑29秒后倒塌

    Gradle故障可能是因为此颤振应用程序中的AndroidX不兼容。看见有关该问题以及如何解决该问题的更多信息。

    完成错误:Gradle任务程序集调试失败,退出代码为1"'

    谢谢。

  • 共有1个答案

    郭业
    2023-03-14

    首先,您需要将所有软件包升级到与AndroidX兼容的版本。您可以从变更日志中了解这一点。dart包裹页面上每个包裹的md。接下来,您需要在AndroidStudio中打开flatter的android项目,然后选择Refactor-

     类似资料:
    • 如何添加图像并将其设置为我的应用程序背景 我知道你把你想要的图片粘贴到了drawable文件夹中。这是代码本身的问题,还是我应该创建一个RelativeLayout?或者仅仅是提供的代码中的一行更改? 这是我的代码,没有任何改动。

    • 我在跟踪AWS的文档,这里。除了apply插件之外,我可以将所有内容添加到项目的、和应用程序的中。当我补充:

    • 我已经在OpenShift上创建了Spring快速启动应用程序,它运行良好,显示了一个用户注册的网页,除了重新启动后它不记得新成员。我在想,这是因为我没有真正的数据库。所以我添加了一个PostgreSQL-9.2墨盒。所以我的问题是如何将postgresql准确地配置到OpenSift Spring应用程序中,以便这个web服务器能够存储重启后持续存在的数据。

    • 问题内容: 我正在编写一个应用程序,当用户指示我的应用程序这样做时,该应用程序应该能够将小部件(仅文本框)添加到用户电话的主屏幕。我该怎么做? 我知道我可以添加一个应用小部件,但是如何添加更多呢? 问题答案: 从应用程序无法将小部件放置在主屏幕中。只有主屏幕可以将应用程序小部件添加到主屏幕。 相似链接link 但是您可以提供用户从widgetpicker中选择widget。

    • 我很难知道如何将我的JFXPanel(它是一个mp3播放器)集成到一个现有的Swing应用程序中,该应用程序是一个JFrame,其中添加了几个不同的JPanel。我对JavaFX是一个完全的noob,它与Swing非常不同。 我能够得到下面的代码来运行和做我想做的事情。它将播放mp3文件从一个目录,我有他们包含在。这是某人编写的示例中的代码。我的问题是,这段代码创建了JFrame,有main方法和

    • 我想在我的Quarkus应用程序中添加一个HTTP拦截器,这样我就可以拦截所有HTTP请求。如何实现?