Skip to content

Latest commit

 

History

History
75 lines (57 loc) · 2.05 KB

File metadata and controls

75 lines (57 loc) · 2.05 KB

AndroidIDE-NDK

This bash script will install NDK to AndroidIDE and Termux.

How to install Ndk to AndroidIDE and Termux.

  1. Download the NDK installation script:

    cd && pkg upgrade && pkg install wget && wget https://github.com/MrIkso/AndroidIDE-NDK/raw/main/ndk-install.sh --no-verbose --show-progress -N && chmod +x ndk-install.sh && bash ndk-install.sh
  2. Choose your required NDK version from the list by entering the numbers provided and wait for the installation to complete.

  3. After installation, edit or set ndkVersion in your build.gradle or build.gradle.kts file as follows:

    • If you choose r24, set ndkVersion to "24.0.8215888".
    • If you choose r28c, set ndkVersion to "28.2.13676358".
    • If you choose r29, set ndkVersion to "29.0.14206865".

You can find the downloaded ndk version names by running:

ls $HOME/android-sdk/ndk

(⚠️ Warning: CMake works on Android 10+ Only)

Example:

plugins {
    id 'com.android.application'
}

android {
    compileSdk 33
    buildToolsVersion "33.0.0"
    ndkVersion "28.2.13676358"

    defaultConfig {
        applicationId "com.myapplication"
        minSdk 23
        targetSdk 33
        versionCode 1
        versionName "1.0"
    }
    
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }

    externalNativeBuild {
        cmake {
            path file('src/main/cpp/CMakeLists.txt')
        }
    }
}

dependencies {
   ...
}

Thanks to: