Android NDK C++17 Support

build.gradle

  1. apply plugin: 'com.android.application'
  2.  
  3. android {
  4.     compileSdkVersion 29
  5.     buildToolsVersion "29.0.2"
  6.     defaultConfig {
  7.         applicationId "com.example.myapplication"
  8.         minSdkVersion 15
  9.         targetSdkVersion 29
  10.         versionCode 1
  11.         versionName "1.0"
  12.         testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
  13.         externalNativeBuild {
  14.             cmake {
  15.                 cppFlags "-std=c++17"
  16.             }
  17.         }
  18.     }
  19.     buildTypes {
  20.         release {
  21.             minifyEnabled false
  22.             proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
  23.         }
  24.     }
  25.     externalNativeBuild {
  26.         cmake {
  27.             path "src/main/cpp/CMakeLists.txt"
  28.             version "3.10.2"
  29.         }
  30.     }
  31. }
  32.  
  33. dependencies {
  34.     implementation fileTree(dir: 'libs', include: ['*.jar'])
  35.     implementation 'androidx.appcompat:appcompat:1.0.2'
  36.     implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
  37.     testImplementation 'junit:junit:4.12'
  38.     androidTestImplementation 'androidx.test:runner:1.1.1'
  39.     androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
  40. }

Leave a Reply

Your email address will not be published. Required fields are marked *