React Native - 执行 org.jetbrains.kotlin.compilerRunner.GradleCompilerRunnerWithWorkers$GradleKotlinCompilerWorkAction 时发生故障

问题描述 投票:0回答:1

我收到谷歌的通知,说我必须更新我的应用程序:

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

所以我进入 mu build.gradle 文件并更改了这些值:

 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' }
            }
        }

但是当我尝试在我的设备上运行该应用程序时,我收到此错误:

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

我该如何解决这个问题?

我也收到此错误:

Task :react-native-screens:compileDebugKotlin FAILED
android react-native
1个回答
0
投票

我只是升级了react-native-screens库:

npm i react-native-screens
© www.soinside.com 2019 - 2024. All rights reserved.