Reputation: 29
I'm trying to build a simple flutter application.
While trying to run the application in my android studio 3.0.1, the following error is displayed. Latest build tools and platform is installed.
Resolving dependencies... Finished with error:
- Error running Gradle: Unable to download needed Android SDK components, as the following licenses have not been accepted: Android SDK Build-Tools 25.0.3, Android SDK Platform 25
To resolve this, please run the following command in a Terminal: flutter doctor --android-licenses
When tried to run the above code, the below-mentioned error is displayed.
Oops; flutter has exited unexpectedly.
Hope anyone can help me to resolve this. Thanks in advance.
Upvotes: 1
Views: 5426
Reputation: 332
try running
flutter doctor --android-licenses
If the problem still exists
Make sure your sdk is not in folder with spaces like C:\Windows\Users\Rahul Raj\Android\SDK
Even If The Problem exists try checking the environment variable ANDROID_HOME
shows your sdk path
Upvotes: 0
Reputation: 11
subprojects {
project.configurations.all {
resolutionStrategy.eachDependency { details ->
if (details.requested.group == 'com.android.support'
&& !details.requested.name.contains('multidex') ) {
details.useVersion "27.1.0"
}
}
}
}
It fixed for me by adding this to build.gradle in android folder.
Upvotes: 0
Reputation: 544
Try to change the location of SDK
Make sure its not in folder with spaces like C:\John Doe\SDK
Update your SDK and try again this command flutter doctor --android-licenses
Upvotes: 0
Reputation: 436
Change sdk.dir in local.properties
Problem was with sdk path in local.properties. By default its pointing to different location. It works for me when change android sdk home dir in sdk.dir
Upvotes: 1