在合并PR后,此错误开始发生,但该PR不包含任何Android侧面的本机更改。
version信息: 反应本机手柄: ^2.3.2 build.gradle中的kotlin版本:1.6.10 反应本版本:0.68.5
> Task :react-native-gesture-handler:compileReleaseKotlin FAILED
e: /Users/saumya/Desktop/latest/lc-app/node_modules/react-native-gesture-handler/android/src/main/java/com/swmansion/gesturehandler/react/RNGestureHandlerButtonViewManager.kt: (247, 92): Unresolved reference: TIRAMISU
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':react-native-gesture-handler:compileReleaseKotlin'.
> Compilation error. See log for more details
* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
* Get more help at https://help.gradle.org
Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.
试过此问题的流行解决方案,例如:
使用这个
npm i jetifier
npx jetify
android.useAndroidX=true
android.enableJetifier=true
android/build.gradle
buildscript {
ext {
targetSdkVersion '33.0.0'
buildToolsVersion = 33
compileSdkVersion = 33
}
}
这个问题似乎到处都是。在软件包中必须有一个不匹配的版本导致此错误。您必须update您的整个项目并寻求破坏更改。
或在大多数情况下应降级到反应式的手机处理程序2.8.0应该工作:
please尝试此版本。
“反应 - 势handler”:“ 2.9.0”aupdating Android/build.gradle SDK版本对我有用:
Build.VERSION_CODES.LOLLIPOP
ndkVersion = "25.0.8775105"
buildscript {
ext {
targetSdkVersion '33.0.0'
buildToolsVersion = 33
compileSdkVersion = 33
}
}
可能会期待较旧的版本
react-navigation
,如果您更新一个版本,则需要两者更新。
这似乎是您的React本地版本之间的兼容性问题。我在
react-navigation
react-native-gesture-handler
时使用了
"react-native": "0.71.17"
,遇到了问题。尝试各种解决方案后,我发现降级
"react-native-gesture-handler": "2.20.0"
1.CHACKKOTLIN版本
确保您的项目使用正确的Kotlin版本。对于反应天然
react-native-gesture-handler to version 2.9.0
,通常建议使用kotlin
0.71.17
。更新您的
android/build.gradle
重建项目:
NPM安装 CD Android ./gradlew清洁 光盘 .. NPX反应原始运行android