当前位置:   article > 正文

You are applying Flutter‘s app_plugin_loader Gradle plugin imperatively using the apply script metho_you are applying flutter's main gradle plugin impe

you are applying flutter's main gradle plugin imperatively using the apply s

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

一:
原文: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 给了个这么鲜明的例子,傻子都看懂了

声明:本文内容由网友自发贡献,不代表【wpsshop博客】立场,版权归原作者所有,本站不承担相应法律责任。如您发现有侵权的内容,请联系我们。转载请注明出处:https://www.wpsshop.cn/w/空白诗007/article/detail/899850
推荐阅读
相关标签
  

闽ICP备14008679号