-2

My Android Studio and Gradle was working fine for me a few days ago, i don't know what changed, but now when i am trying to import a project with Gradle, i get the message:

"You have not accepted the license agreements of the following SDK components: [Android SDK Build-Tools 25.0.2]. Before building your project, you need to accept the license agreements and complete the installation of the missing components using the Android Studio SDK Manager. Alternatively, to learn how to transfer the license agreements from one workstation to another, go to http://d.android.com/r/studio-ui/export-licenses.html "

  • I use Windows 10
  • "java -version" on cmd gives me the java version
  • when typing sdkmanager --licences i get:

    "'sdkmanager' is not recognized as an internal or external command, operable program or batch file."

  • Tried to reinstall Andriod Studio, installing newest java version

  • The projects i am trying to load are from a Google course in udacity so they should probably work fine (and they did work fine few days ago)
  • When I am trying to create a new project with Gradle i get:

    Failed to create directory "C:\Program Files\Projects\b"

  • I did accept the License Agreement during the installation of Android Studio
  • My User & System environment variables (photo): User Environment Variables + System Path Variable

Let me know if any other details are needed, thanks in advance! Omer

5
  • 1
    What is your problem. Why you don't want to accept terms and agreement while installing.
    – UmarZaii
    Commented Aug 6, 2017 at 0:41
  • I did accept the License Agreement. This is why I am surprised
    – Omer
    Commented Aug 6, 2017 at 11:11
  • See my answer below. Notified me if it didn't work.
    – UmarZaii
    Commented Aug 6, 2017 at 11:50
  • Well, clearly sdkmanager isn't on the PATH... Did you try to give the full path to that command? Commented Aug 6, 2017 at 16:15
  • what do you mean by "that command"?
    – Omer
    Commented Aug 6, 2017 at 16:21

2 Answers 2

0

There are many ways to cure this bug. This may occur when you purposely didn't accept the license agreement OR you didn't realize that you didn't accept the license agreement while installing your Android Studio or SDK Build Tools.

In rare cases, bug will occur where you accept the agreement but it didn't record that you did accept it. In that cases you should try below actions:

  • Reinstall your Android Studio
  • Delete your Android SDK Build-Tools 25.0.2 in your SDK folder
  • Delete your SDK folder and reinstall it from scratch
9
  • Maybe I didn't understand what you mean: 1. I uninstalled Android Studio 2. I deleted the SDK folder (including Build Tools) 3. I reinstalled Android Studio Still the same message
    – Omer
    Commented Aug 6, 2017 at 15:51
  • Which part of it?
    – UmarZaii
    Commented Aug 6, 2017 at 15:52
  • accidently pressed enter sorry, i edited my comment. thanks for trying to help!
    – Omer
    Commented Aug 6, 2017 at 15:53
  • Did you reinstall your SDK build tools?
    – UmarZaii
    Commented Aug 6, 2017 at 15:54
  • I deleted all the sdk directory, and it was installed from scratch when i reinstalled Android Studio. Is that what you meant?
    – Omer
    Commented Aug 6, 2017 at 15:58
0

Resolved:

Uninstalled, deleted all environment variables, all directories, all caches, and reinstalled.

Directories that i deleted:

  • C:\Users\MyUserName\AppData\Local\sdk
  • C:\Users\MyUserName\ .android
  • C:\Users\MyUserName\ .AndroidStudio2.3
  • C:\Users\MyUserName\ .gradle
  • C:\Program Files\Android

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.