Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

Tags:

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

like image 599
Vikram Anand Bhushan Avatar asked Apr 11 '20 12:04

Vikram Anand Bhushan


People also ask

What is android NDK side by side?

NDK (Side by side) is irrelevant for Android Gradle Plugin earlier than 3.5. However, the components available for download by SDK manager aren't customizable based on Android Gradle Plugin version so the side by side NDKs will appear. The non side by side NDK has been marked as obsolete.

How do you add NDK in react native?

Go to File > Project Structure > SDK location and then in the "Android NDK location" part, give your ndk address location, if you don't have it, you can download it.

How do I fix NDK missing a platforms directory?

If you are using NDK, verify the ndk. dir is set to a valid NDK directory. It is currently set to /usr/local/opt/android-sdk/ndk-bundle. If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.


1 Answers

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.

like image 162
Gerry Avatar answered Feb 20 '23 21:02

Gerry