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

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.


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.