当前位置: 首页 > news >正文

解决Flutter运行android提示Deprecated imperative apply of Flutter‘s Gradle plugins

文章目录

  • 出现场景
  • 解决方案
    • 编辑android/settings.gradle
    • 编辑android/build.gradle
      • 重新定义库变量
    • 编辑android/app/build.gradle
      • 删除fluttetRoot和plugin字段
      • 添加plugins块
      • 修改dependencies

出现场景

ado@adodeMacBook-Air app_demo % flutter run --profile
Launching lib/main.dart on SM G977U in profile mode...
You are applying Flutter's app_plugin_loader Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-applyYou are applying Flutter's main Gradle plugin imperatively using the apply script method, which is deprecated and will be removed in a future release. Migrate to applying Gradle plugins with the declarative plugins block: https://flutter.dev/to/flutter-gradle-plugin-applyRunning Gradle task 'assembleProfile'...                           17.7s

运行在安卓时,出现以上的警告.

解决方案

这是因为从Flutter 3.16开始,Android gradle插件使用plugin dsl语法 plugins{}块,

以下是移植方法

编辑

http://www.dtcms.com/a/285664.html

相关文章:

  • 武汉江滩某码头变形及应力自动化监测
  • 麒麟操作系统unity适配
  • java前端基础--HTMLCSS、JavaScript、Vue、Ajax
  • Python网络爬虫实现selenium对百度识图二次开发以及批量保存Excel
  • unity实现梦日记式效果
  • CS课程项目设计3:支持AI人机对战的井字棋游戏
  • 「Java EE开发指南」如何用MyEclipse创建企业应用项目?(一)
  • UniApp -- 小程序自定义导航栏组件
  • 小程序常用api
  • 2025年算法备案发号规律总结与下半年发号预测
  • js中 new Set()实例的各个api使用
  • Http请求中的特殊字符
  • iOS加固工具有哪些?项目场景下的组合策略与实战指南
  • Axios泛型参数解析与使用指南
  • 谷歌地球与ArcGIS Pro查看三维地形
  • Linux操作系统之线程:分页式存储管理
  • VR平台应该具备哪些功能?怎样选择VR平台?
  • RecyclerView与ListView深度对比分析
  • 相机光学(五十)——Depth AF
  • Visual Studio编译WPF项目生成的文件介绍
  • 相机的内外参分别指什么
  • AI生成邮件发送脚本(带附件/HTML排版)与定时爬取网站→邮件通知(价格监控原型)
  • Maven学习总结(62)—— Maven 打包瘦身和提速解决方案
  • [JS逆向] 微信小程序逆向工程实战
  • 7.18 Java基础 |
  • CentOS7/Redhat7破解Root密码(linux)
  • 进阶数据结构:红黑树
  • 解锁 Java 并发编程的奥秘:《Java 并发编程之美》中的技术亮点与难题攻克
  • Java Map 集合详解:从基础语法到实战应用,彻底掌握键值对数据结构
  • 【PTA数据结构 | C语言版】左堆的合并操作