I've been trying to fix this error but i can't seem to get it to build.. the emulator works and all that but i cant seem to get the program to build properly
buildscript {
ext {
buildToolsVersion = "29.0.3"
minSdkVersion = 21
compileSdkVersion = 31
targetSdkVersion = 31
kotlin_version = '1.6.10'
ndkVersion = "22.0.7026061"
}
repositories {
google()
mavenCentral()
jcenter()
}
dependencies {
classpath("com.android.tools.build:gradle:4.1.0")
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.14'
}
}
def REACT_NATIVE_VERSION = new File(['node', '--print', "JSON.parse(require('fs').readFileSync(require.resolve('react-native/package.json'), 'utf-8')).version"].execute(null, rootDir).text.trim())
allprojects {
configurations.all {
resolutionStrategy {
force "com.facebook.react:react-native:" + REACT_NATIVE_VERSION
}
}
repositories {
mavenLocal()
maven {
url(new File(["node", "--print", "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), "../android"))
}
maven {
url(new File(["node", "--print", "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), "../dist"))
}
google()
mavenCentral()
jcenter()
maven { url 'https://www.jitpack.io' }
}
}
this is the error i get when i try to run it
Cause: compileSdkVersion is not specified. Please add it to build.gradle
Im a newbie to gradle so much help would be appreciated, thank you!