[英]React Native Task :react-native-image-picker:compileDebugJavaWithJavac FAILED
When trying to run my project on my windows computer it is not working, it works on my macOS but when running it on windows it throws the following errors:当尝试在我的 Windows 计算机上运行我的项目时它不工作,它在我的 macOS 上工作但是当在 Windows 上运行它时它会抛出以下错误:
Task :react-native-image-picker:compileDebugJavaWithJavac FAILED
if (Build.VERSION.SDK_INT < Build.VERSION_CODES.TIRAMISU) {
^
symbol: variable TIRAMISU
location: class VERSION_CODES
Running it with npx react-native run-android
使用
npx react-native run-android
运行它
build.gradle
has the following: build.gradle
具有以下内容:
buildscript {
ext {
buildToolsVersion = "30.0.3"
minSdkVersion = 30
compileSdkVersion = 30
targetSdkVersion = 30
ndkVersion = "20.1.5948944"
}
Have been trying to change the number with everything I have installed, 29
, 30
, 31
,and 33
minSdk, buildTools, compile, and targeted nothing is working.一直在尝试用我安装的所有东西更改数字,
29
和30
33
、 31
、编译和目标没有任何效果。
Currently, have node 14 and JDK 11目前,有节点 14 和 JDK 11
Error changes when I use 33 to the following one:当我将 33 用于以下时,错误发生变化:
Task :react-native-webview:compileDebugJavaWithJavac FAILED
Have already tried multiple times ./gradlew clean
已经试过多次
./gradlew clean
Someone knows what's going on?有人知道发生了什么事吗? what am I missing?
我错过了什么?
Check if both mac & windows have same java version by running command java -version
通过运行命令
java -version
检查 mac 和 windows 是否具有相同的 java 版本
If no, change the version of java in windows like as in mac then, clean and rebuild如果不是,请像在 mac 中一样更改 windows 中的 java 版本,然后清理并重建
If yes, check if one of this this solution works:如果是,请检查此解决方案之一是否有效:
React Native Android build failure with different errors without any changes in code for past days due to publish of React Native version 0.71.0-rc.0 由于 React Native 版本 0.71.0-rc.0 的发布,React Native Android 构建失败并出现不同的错误,过去几天代码没有任何变化
https://stackoverflow.com/a/74371195/10657559 https://stackoverflow.com/a/74371195/10657559
I downgrade version of react-native-image-picker to 0.38.1, works for me我将 react-native-image-picker 的版本降级到 0.38.1,对我有用
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.