I have some problems while running flutter in android studio
This is my error Launching lib\\main.dart on Moto C Plus in debug mode... I
I found a solution! Go to your flutter folder. After you need to find flutter.gradle. On my PC: C:\src\flutter\packages\flutter_tools\gradle Open flutter.gradle with note or notepad and change buildscript from this:
repositories {
jcenter()
maven {
url 'https://dl.google.com/dl/android/maven2'
}
}
to this:
repositories {
maven {
url 'https://dl.google.com/dl/android/maven2'
}
jcenter()
}
There were lots of similar issues raised the past days, that could be solved by adding the google()
repository in first position in the repositories
block of the build scripts.
See detailed explanation in the following answers:
The root cause , related to missing libraries in Jcenter, is explained in detail here : https://stackoverflow.com/a/50885939/6899896
Open the root flutter folder in your computer, and open the gradle folder in that root folder (For example C:\flutter\package\flutter_tool\gradle) and add 'google()' to the buildscript. It fixed the issue for me.
Flutter root folder:
Add 'google()' to the buildscript: