Flutter 報錯:Please update settings.gradle 解決辦法

最後更新於 2021 年 5 月 11 日

錯誤訊息

Plugin project :location_web not found. Please update settings.gradle.

解決辦法

android/settings.gradle的全部內容替換為下方內容:

include ':app'

def flutterProjectRoot = rootProject.projectDir.parentFile.toPath()

def plugins = new Properties()
def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins')
if (pluginsFile.exists()) {
    pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) }
}

plugins.each { name, path ->
    def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
    include ":$name"
    project(":$name").projectDir = pluginDirectory
}

這將創建一個 .flutter-plugin 包含插件及其路徑的文件。

0 0 評分數
Article Rating
訂閱
通知
guest

0 Comments
在線反饋
查看所有評論