何小豆儿在此 发表于 2024-7-23 03:53:13

You are applying Flutter‘s app_plugin_loader Gradle plugin imperative

这个一样寻常会同时出现两个提示:
一:
原文: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 给了个这么鲜明的例子,傻子都看懂了

免责声明:如果侵犯了您的权益,请联系站长,我们会及时删除侵权内容,谢谢合作!更多信息从访问主页:qidao123.com:ToB企服之家,中国第一个企服评测及商务社交产业平台。
页: [1]
查看完整版本: You are applying Flutter‘s app_plugin_loader Gradle plugin imperative