How to fix the plugin project: location_web not found ??
When we are using the google maps API and location pub.dev package in our android flutter app, it starts throwing errors randomly. So in this article, we will fix the plugin project: location_web not found. Earlier we have learned how to Fix “No pubspec.yaml File Found” In Flutter.
How to fix the plugin project: location_web Not Found ??
Users can use 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 that will have the plugin and its path.
You can also give try to below code snippet:
go to Tools -> Flutter -> Open for editing in Android Studio
In the Android Studio window go to File -> Invalidate Cache and Restart.
- 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 }
You can also refer to this.
- Delete ProjectName/Build folder it has resolved the issue for me.
Conclusion:
So in this article, we took a deep dive into how to fix the plugin project: location_web not found.
Also, Don’t forget to check out How to Fix HttpException In Flutter.
Keep Learning !!! Keep Fluttering !!!
Do let us know in the comments if you are still confused in flutter!! we would love to assist you 🙂
FlutterAgency.com is our portal Platform dedicated to Flutter Technology and Flutter Developers. The portal is full of cool resources from Flutter like Flutter Widget Guide, Flutter Projects, Code libs and etc.
FlutterAgency.com is one of the most popular online portals dedicated to Flutter Technology and daily thousands of unique visitors come to this portal to enhance their knowledge of Flutter.