Sau*_*yak 11 android cross-platform kotlin react-native react-native-gesture-handler
这是我在构建分支的 android apk 时遇到的错误。(为 ios 构建时不会发生)。多年来我一直在这个代码库上使用react-native-gesture-handler,但从未遇到过这个错误。
此错误在合并 pr 后开始发生,但此 pr 不包含任何 android 端本机更改。
版本信息:react-native-gesture-handler:^2.3.2 build.gradle 中的 kotlin 版本:1.6.10 React-native 版本: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.
Run Code Online (Sandbox Code Playgroud)
已经尝试过针对此问题的流行解决方案,例如:
npm i jetifier
npx jetify
Run Code Online (Sandbox Code Playgroud)
android.useAndroidX=true
android.enableJetifier=true
Run Code Online (Sandbox Code Playgroud)
但问题仍然没有得到解决!
请分享任何解决方案或询问任何信息。这将会非常有帮助。
小智 9
更新android/build.gradle
sdk 版本对我有用:
buildscript {
ext {
targetSdkVersion '33.0.0'
buildToolsVersion = 33
compileSdkVersion = 33
}
}
Run Code Online (Sandbox Code Playgroud)
小智 7
这个react-native-gesture-handler
问题似乎随处可见。导致此错误的包中一定存在版本不匹配。您必须更新整个项目并寻找重大更改。
或者,在大多数情况下,将react-native-gesture-handler降级到版本2.8.0应该可以工作:yarn add react-native-gesture-handler@2.8.0
我将其更改为:
Build.VERSION_CODES.TIRAMISU
Run Code Online (Sandbox Code Playgroud)
到:
Build.VERSION_CODES.LOLLIPOP
Run Code Online (Sandbox Code Playgroud)
它起作用了。
归档时间: |
|
查看次数: |
13270 次 |
最近记录: |