简体   繁体   English

React Native 任务:react-native-image-picker:compileDebugJavaWithJavac FAILED

[英]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.一直在尝试用我安装的所有东西更改数字, 2930 3331 、编译和目标没有任何效果。

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?我错过了什么?

  1. Check if both mac & windows have same java version by running command java -version通过运行命令java -version检查 mac 和 windows 是否具有相同的 java 版本

  2. If no, change the version of java in windows like as in mac then, clean and rebuild如果不是,请像在 mac 中一样更改 windows 中的 java 版本,然后清理并重建

  3. If yes, check if one of this this solution works:如果是,请检查此解决方案之一是否有效:

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.

相关问题 任务 :react-native-gesture-handler:compileDebugJavaWithJavac FAILED - Task :react-native-gesture-handler:compileDebugJavaWithJavac FAILED 任务“:app:compileDebugJavaWithJavac”执行失败。 在运行 React Native 项目时 - Execution failed for task ':app:compileDebugJavaWithJavac'. while running React Native Project AndroidX 任务后的 React-Native :@react-native-community_viewpager:compileDebugJavaWithJavac FAILED - React-Native after AndroidX Task :@react-native-community_viewpager:compileDebugJavaWithJavac FAILED 使用Android Studio虚拟设备执行任务&#39;:react-native-gesture-handler:compileDebugJavaWithJavac&#39;的执行失败 - Execution failed for task ':react-native-gesture-handler:compileDebugJavaWithJavac' with Android Studio Virtual Device 反应本机构建失败任务&#39;:app:checkDebugDuplicateClasses&#39;的执行失败 - React native build failed Execution failed for task ':app:checkDebugDuplicateClasses' 使用 react-native-multiple-image-picker 在 Android 上构建 React Native 应用程序时出错 - Error building React Native app on Android with react-native-multiple-image-picker React Native Task:app:processDebugResources无法执行aapt - React Native Task :app:processDebugResources Failed to execute aapt 任务&#39;:app:packageDebug&#39;的React-Native执行失败 - React-Native Execution failed for task ':app:packageDebug' 任务:react-native-gradle-plugin:compileKotlin FAILED - Task :react-native-gradle-plugin:compileKotlin FAILED Task:app:mergeExtDexDebug 在运行反应原生的 android 应用程序时失败 - Task :app:mergeExtDexDebug FAILED in running android app of react native
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM