skip to Main Content

I had a notification from google saying i had to update my App:

App must target Android 14 (API level 34) or higher

So i went into mu build.gradle file and changed these values:

 buildscript {
        ext {
            buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0'  <-- changed from 33 to 34
            minSdkVersion = Integer.parseInt(findProperty('android.minSdkVersion') ?: '21')
            compileSdkVersion = Integer.parseInt(findProperty('android.compileSdkVersion') ?: '34') <-- changed from 33 to 34
            targetSdkVersion = Integer.parseInt(findProperty('android.targetSdkVersion') ?: '34') <-- changed from 33 to 34
            if (findProperty('android.kotlinVersion')) {
                kotlinVersion = findProperty('android.kotlinVersion')
            }
            frescoVersion = findProperty('expo.frescoVersion') ?: '2.5.0'

            // We use NDK 23 which has both M1 support and is the side-by-side NDK version from AGP.
            ndkVersion = "23.1.7779620"
        }
  repositories {
    google()
    mavenCentral()
    maven { url 'https://jcenter.bintray.com' }
}
dependencies {
    classpath('com.android.tools.build:gradle:7.4.1')
    classpath('com.facebook.react:react-native-gradle-plugin')
    
}
}

            allprojects {
            repositories {
                maven {
                    // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm
                    url(new File(['node', '--print', "require.resolve('react-native/package.json')"].execute(null, rootDir).text.trim(), '../android'))
                }
                maven {
                    // Android JSC is installed from npm
                    url(new File(['node', '--print', "require.resolve('jsc-android/package.json')"].execute(null, rootDir).text.trim(), '../dist'))
                }

                google()
                mavenCentral()
                maven { url 'https://www.jitpack.io' }
            }
        }

But when i try to run the app on my device i get this error:

A failure occurred while executing org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction

How do i fix this?

I also get this error:

Task :react-native-screens:compileDebugKotlin FAILED

2

Answers


  1. Chosen as BEST ANSWER

    I simply just upgraded the react-native-screens library:

    npm i react-native-screens
    

  2. Check if your package name is same in all files of your project.

    com.example.example
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search