Shubham Anand
Shubham Anand

Reputation: 621

Failed to install the following Android SDK packages as some licences have not been accepted.- 20.1.5948944 NDK (Side by side) 20.1.5948944

I have taken a pull from bitbucket and trying to run a project. While running the project it says the following lines:

ERROR: Failed to install the following Android SDK packages as some licences have not been accepted.
   ndk;20.1.5948944 NDK (Side by side) 20.1.5948944
To build this project, accept the SDK license agreements and install the missing components using the Android Studio SDK Manager.

Android studio is also installed new in the machine.

Upvotes: 4

Views: 14807

Answers (4)

Mr-IDE
Mr-IDE

Reputation: 7661

Android Studio has detected that your project requires the NDK (Native Development Kit - for C/C++ code building), but you don't have the NDK installed.

It was detected because you probably have something like this in your app/build.gradle file:

android {
    externalNativeBuild {
        cmake {
            path "CMakeLists.txt"
        }
    }
}

More info:

You'll need to manually install the Android NDK tool, which is a large 930 MB download:

  1. Android Studio ➔ File ➔ Settings (Windows/Linux). Or Android Studio ➔ Preferences (MacOS)
  2. In the search box, type in "sdk" and navigate to Languages & Frameworks ➔ Android SDK. (Some Android Studio versions have this in Appearance and Behavior ➔ System Settings ➔ Android SDK)
  3. Click the 'SDK Tools' tab
  4. Optional: You may want to click on "Show Package Details" at the bottom-right, in order to choose a specific version of the NDK.
  5. Click the checkbox for "NDK (Side by Side)"

Screenshot of Android Studio ➔ Preferences ➔ Appearance and Behavior ➔ System Settings ➔ Android SDK

  1. Click the Apply button. This will download the Android NDK for you.
  2. Then do a gradle sync: Press the 'elephant' icon at the far right, with tooltip "Sync Project With Gradle Files"

Android Studio toolbar - Button: Sync Project with Gradle Files

You may be prompted to install CMake next. Just follow the same process to install CMake. Or click the blue link in Build window: "Install CMake 3.XX.X". You should now be able to build your project.

Once you've installed the NDK and CMake and configured it, you should see new menu options for Android Studio ➔ Tools ➔ SDK Manager and AVD Manager.

Upvotes: 7

Abdulfatah Nasrat
Abdulfatah Nasrat

Reputation: 291

I have faced the same problem and I could solve it by adding this line code in the build.gridle inside of Android{} block

ndkVersion "21.0.6113669"

Then sync project.

Upvotes: 0

Serge.V
Serge.V

Reputation: 1

See also: Android Studio not showing SDK Manager Option in the Tools Menu (the SDK manager not always is accessible from "Tools" drop-down menu)

Upvotes: 0

Shubham Anand
Shubham Anand

Reputation: 621

When you install Android Studio 3.5.2, the android studio doesn't install NDK(Side By side) so, you need to do it manually. Tools -> SDK Manager -> System Settings -> Android SDK -> (Select) SDK Tool and enable NDK(Side by Side).

Upvotes: 3

Related Questions