Compatible side by side NDK version was not found. Default is 20.0.5594570
Asked Answered
C

9

32

I am getting the above error

My gradle looks like this

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'

android {
    compileSdkVersion 29
    buildToolsVersion "29.0.3"

    defaultConfig {
        applicationId "com.example.hypersignwalletcorekotlin"
        minSdkVersion 23
        targetSdkVersion 29
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

}
project.ext {
    walletcore_version = "2.0.5"
}
dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
    implementation 'androidx.appcompat:appcompat:1.1.0'
    implementation 'androidx.core:core-ktx:1.2.0'
    implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
    implementation "com.trustwallet:wallet-core:$walletcore_version"
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'androidx.test.ext:junit:1.1.1'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
}

Not able to understand why is this happening.

Thanks

Codify answered 11/4, 2020 at 12:45 Comment(1)
reddit.com/r/androiddev/comments/f4s0hr/…Dowzall
I
25

The Fix: add ndkVersion to your module's build.gradle

    android.ndkVersion  "your-installed-ndk-version"

as in some examples. You could find your NDK version from the file $NDK/source.properties.

Background Info: You probably using AGP/Android Studio version 3.6+: "From Android Gradle Plugin ( AGP ) 3.6+, there is a known good NDK concept added, which is the known good/tested NDK version when that AGP version was released". AGP will use that internal NDK version if:

  • you are not using the ndkVersion feature added in AGP 3.5

That internal NDKs are expected to be installed as side-by-side NDK place: $SDK\ndk
if not installed:

  • AGP 3.6, AGP 4.0 will error out
  • AGP 4.1 would auto install it.

The internally embedded NDK version, most likely, will be out-of-date pretty quickly as newer NDKs are constantly being released: if you want to use a newer NDK version, you do need to configure gradle with ndkVersion.

Additional Doc: Refer to the official documentation for details.

Impaction answered 29/4, 2020 at 19:59 Comment(0)
U
7

To install a specific version of the NDK, do the following:

With a project open, click Tools > SDK Manager.

Click the SDK Tools tab.

Select the Show Package Details checkbox.

Select the NDK (Side by side) checkbox and the checkboxes below it that correspond to the NDK versions you want to install. Android Studio installs all versions of the NDK in the android-sdk/ndk/ directory.

Undies answered 5/10, 2020 at 14:3 Comment(0)
H
5

I do not use NDK, but still got this error. Clean project worked for me.

Build -> "Clean Project" and then rebuild.

Heffernan answered 19/9, 2020 at 10:24 Comment(0)
L
3

That error happened to me when I run cordova build with Android Studio open. :D

I closed it and that's it.

Lapides answered 17/12, 2020 at 0:30 Comment(0)
C
2

You need to click the tool on above the bar option. Then you need to download the current ndk if not installed.

Concave answered 25/5, 2020 at 15:38 Comment(0)
S
1

I just create a new emulator using the newest Android Studio version. It solved my problem. Hopefully, it may be an alternative...

Shirelyshirey answered 20/11, 2020 at 6:31 Comment(0)
S
0

Install NDK from SDK Manager -> SDK tools and then just add this line in the android/app/build.gradle

android{ 
   ndkVersion flutter.ndkVersion
 }
Schmidt answered 1/8, 2022 at 12:45 Comment(0)
H
0

enter image description hereUpdate your ndk to higher one.

Android studio.

> Tools > SDK Manager > SDK Tools > Enable check box: NDK (Side by Side)
> bottom right :Show Package Details > Select the NDK version(show in error) like 25.1.8937393 > then OK.

Reload your android studio.

VS Code ( Configure specific versions of the NDK in your project) : Go build.gradle

add: specify higher ndk version to ndkVersion field in android.

android {
    ndkVersion "25.1.8937393"
    // Other configurations...
}

Reload code ediotor and configure it. If not work open your project on android studio and make changes like above. then reopen with vs code.

Holophytic answered 25/3 at 0:40 Comment(0)
T
-1

You can install only the NDK that you need.

Go SDK Manager -> SDK tools -> Click in Show Package Details

Click and install.

Threonine answered 26/10, 2020 at 11:32 Comment(2)
Hi, this does not add much compared with @Undies answer also it does not address the question directly.Taenia
The order I made in my answer was the one that worked for me.Threonine

© 2022 - 2024 — McMap. All rights reserved.