Reputation: 219
I'm using gradle to build a react native app. I recently updated my Android SDK and now the following error is being thrown:
* What went wrong:
A problem occurred configuring project ':react-native-navigation'.
> compileSdkVersion is not specified.
This is my top level gradle.build:
buildscript {
ext {
buildToolsVersion = "29.0.2"
minSdkVersion = 16
compileSdkVersion = 29
targetSdkVersion = 29
}
repositories {
google()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:3.5.3")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
And this is my build script from inside the module:
android {
compileSdkVersion rootProject.ext.compileSdkVersion
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
defaultConfig {
applicationId "com.myapp"
minSdkVersion rootProject.ext.minSdkVersion
targetSdkVersion rootProject.ext.targetSdkVersion
versionCode 1
versionName "1.0"
}
Anyone have any idea how I might fix it?
Upvotes: 1
Views: 1814
Reputation: 39
i solved the issue by adding ndk.dir in local.properties file.the local.properties file should look like this.
ndk.dir=/Users/[username]/Library/Android/sdk/ndk/your ndkversion ////23.1.7779620 sdk.dir=/Users/[username]/Library/Android/sdk
Upvotes: 1
Reputation: 219
I stumbled upon the answer when I spotted another error. Something I installed must have required Kotlin, because the build started to complain that it wasn't there.
I added the following in my root build.gradle:
kotlinVersion = "1.3.72"
RNNKotlinVersion = "1.3.72"
And the following in my android/app build.gradle:
apply plugin: 'kotlin-android'
Upvotes: 0