此声明是实验性的,其用法必须标有"@kotlin。ExperimentalStdlibApi' 或 '@OptIn(kotlin.ExperimentalStdlibApi::class)



升级到React Native 0.70.6后,我一直在android上遇到这个问题,几天没有找到解决方案。

> Task :react-native-gradle-plugin:compileKotlin FAILED
e: /Users/hugohouyez/code/hugoh1995/Superprof/node_modules/react-native-gradle-plugin/src/main/kotlin/com/facebook/react/tasks/BundleHermesCTask.kt: (137, 11): This declaration is experimental and its usage must be marked with '@kotlin.ExperimentalStdlibApi' or '@OptIn(kotlin.ExperimentalStdlibApi::class)'

我已经在我的包中安装了"react-native-gradle-plugin"; "^0.71.10"Json,即使文档中没有提到它,因为没有它,它会说它找不到依赖项。

build.graddle

...
dependencies {
classpath("com.android.tools.build:gradle:7.3.0")
classpath("com.facebook.react:react-native-gradle-plugin")
classpath("de.undercouch:gradle-download-task:5.0.1")
classpath("com.google.gms:google-services:4.3.10")
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}

gradle-wrapper.properties

distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
distributionUrl=https://services.gradle.org/distributions/gradle-7.4-all.zip

更改为/android/gradle/wrapper/gradle-wrapper中的distributionUrl。

distributionUrl=https://services.gradle.org/distributions/gradle-7.5.1-all.zip

相关内容

  • 没有找到相关文章

最新更新