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

后端 未结 5 803
旧时难觅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:05

    Delete ProjectName/Build folder it has resolved issue for me.

    0 讨论(0)
  • 2021-02-02 10:21

    I had the same issue and following @Peter Haddad answer, I copy and replaced the code in settings.gradle (all of it) and I had errors resolving symbol for properties and file.

    TO FIX IT: go to Tools -> Flutter -> Open for editing in Android Studio

    In the Android Studio window go to File -> Invalidate Cache and Restart

    This seemed to fix it for me.

    0 讨论(0)
  • 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.

    0 讨论(0)
  • 2021-02-02 10:24

    add in your flutter app -> android -> settings.gradle

    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
    }
    

    as seen here

    more info about the issue here

    0 讨论(0)
  • 2021-02-02 10:26

    Fix for users having facebook flipper installed

    I would have added this as a comment, but let me post it as an answer to have proper code formatting.

    If you have facebook's flipper installed, with the relative flutter_flipperkit plugin, then your settings.gradle should be already modified.

    To use the fix suggested by @Peter Haddad & @Paulo Belo, you will need to keep flipper's plugin loading and add the other condition:

    plugins.each { name, path ->
        def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile()
        if (name == 'flutter_flipperkit') {
            // flipper loading
            include ':flipper-no-op'
            project(':flipper-no-op').projectDir = new File(pluginDirectory, 'flipper-no-op')
        }
        else {
            // location_web not found fix
            include ":$name"
            project(":$name").projectDir = pluginDirectory
        }
    }
    

    Hope this helps somebody.

    0 讨论(0)
提交回复
热议问题