Plugin project :location_web not found. Please update settings.gradle. How do I fix this?

后端 未结 5 806
旧时难觅i
旧时难觅i 2021-02-02 09:57

I was using the google maps api and location pub,dev package in my android flutter app, and tried to bring up an image using the url from the api. This was the url with some cod

5条回答
  •  北恋
    北恋 (楼主)
    2021-02-02 10:24

    Use the following 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
    }
    

    This will create a .flutter-plugin file which will have the plugin and its path.

提交回复
热议问题