You are applying Flutter‘s app_plugin_loader Gradle plugin imperatively using the apply script metho

这个一般会同时出现两个提示:

一:
原文: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/go/flutter-gradle-plugin-apply

翻译:您正在使用apply-script方法强制应用Flutter的app_plugin_loader Gradle插件,该方法已被弃用,将在未来的版本中删除。迁移到使用声明性插件块应用Gradle插件:https://flutter.dev/go/flutter-gradle-plugin-apply

二:
原文:You 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/go/flutter-gradle-plugin-apply

翻译:您正在使用applyscript方法强制应用Flutter的主要Gradle插件,该方法已被弃用,并将在未来的版本中删除。迁移到使用声明性插件块应用Gradle插件:https://flutter.dev/go/flutter-gradle-plugin-apply

解决方法:

1,直接删除项目里的android文件夹
2,flutter new 出来一个新的项目。
3,复制新项目里的android 粘贴到有问题的项目中
-----他说Gradle插件使用方式太过老土不让用了,但是flutter SDK 是新的,新创建的肯定按照他最新规范生成吧,所以这样搞没问题兄弟们!!!

换上之后应该就不再提示了,我的就好了,有问题的话再找找吧。

不过后面这个是没事了还有一个报错:不过这个报错看着很酷:

原文:
┌─ Flutter Fix ────────────────────────────────────────────────────────────────────────────────────┐
│ [!] Your project requires a newer version of the Kotlin Gradle plugin. │
│ Find the latest version on https://kotlinlang.org/docs/releases.html#release-details, then │
│ update │
│ D:\ecom_startup_code_yindu\ecom_startup_code\ecom_startup_code\client_side\flutter_ecommerce_sta │
│ rt\android\build.gradle: │
│ ext.kotlin_version = ‘’ │
└────────────────────────────────────────────────

翻译:

┌─ Flutter Fix────────────────────────────────────────────────────────────────────────────────────┐
│ [!]您的项目需要更新版本的Kotlin-Gradle插件。│
│ 在上查找最新版本https://kotlinlang.org/docs/releases.html#release-详细信息,然后
│ 更新←
│ D: \ecom_startup_code_yindu\ecom_startup_code\ecom_start up_code\client_side\flag_ecommerce_sta
│ rt\android\build.grade:
│ ext.kotlin_version=‘<最新版本>’
└────────────────────────────────────────────────
去这个地方看最新版本: https://kotlinlang.org/docs/releases.html#update-to-a-new-release

官方例子:
plugins {
// Replace <...> with the plugin name appropriate for your target environment
kotlin(“<…>”) version “2.0.0”
// For example, if your target environment is JVM:
// kotlin(“jvm”) version “2.0.0”
// If you target is Kotlin Multiplatform
// kotlin(“multiplatform”) version “2.0.0”
}

这个就是有错误的文件:
D: \ecom_startup_code_yindu\ecom_startup_code\ecom_start up_code\client_side\flag_ecommerce_sta
│ rt\android\build.grade:
但是最新的Gradle规则是吧东西放到【settings.gradle】中了

至此,谢谢 kotlin 给了个这么鲜明的例子,傻子都看懂了

  • 28
    点赞
  • 12
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值