“react-native-image-crop-picker” 编译调试时使用 javac 失败。

huangapple go评论51阅读模式
英文:

react-native-image-crop-picker compile debug java with javac failed

问题

在此错误中,使用了已过时的 Gradle 功能,使其与 Gradle 8.0 不兼容。您可以使用 '--warning-mode all' 选项来显示各个已弃用警告,并确定它们是否来自您自己的脚本或插件。要解决此错误,请考虑以下解决方法:

1. 更新 Gradle 版本:尝试将 Gradle 版本升级到与您的项目兼容的版本。您可以在项目的 build.gradle 文件中指定 Gradle 版本。例如:

dependencies {
classpath 'com.android.tools.build:gradle:<desired_gradle_version>'
}


将 `<desired_gradle_version>` 替换为您希望使用的 Gradle 版本。然后执行 Gradle 同步操作。

2. 更新依赖项:有时此问题可能是由于某些依赖项过时而导致的。尝试更新您项目中的所有依赖项,以确保它们与您选择的 Gradle 版本兼容。

3. 检查自定义脚本和插件:如果您在项目中使用了自定义脚本或插件,确保它们不会使用已弃用的 Gradle 功能。根据错误消息的建议,使用 '--warning-mode all' 来查看详细的警告信息,以确定问题的来源。

以上是解决此错误的一些常见方法,您可以根据您的项目情况尝试其中一种或多种方法来解决问题。
英文:

# Task :react-native-image-crop-picker:compileDebugJavaWithJavac FAILED**

Deprecated Gradle features were used in this build, making it incompatible with Gradle 8.0.

You can use &#39;--warning-mode all&#39; to show the individual deprecation warnings and determine if they come from your own scripts or plugins.

`

How to solve this error, please give me solution to this problem

答案1

得分: 1

降级 react-native-image-picker 到 0.38.1 版本。

注意:通常情况下降级不是一个好主意,因为它可能过时或有 bug。但是,一些新发布的版本可能不支持或存在 bug,而之前的版本已经运行良好。

清除并重新构建 gradle:

cd android
./gradlew clean
英文:

There seem to be issue with the current version, so downgrade react-native-image-picker to 0.38.1

Note: usually downgrading is not a good idea, since it might be outdated or buggy. However, some new-released versions might not support or buggy that previous versions have been working well.

clean the rebuild the gradle again

cd android
./gradlew clean

huangapple
  • 本文由 发表于 2023年5月10日 15:09:58
  • 转载请务必保留本文链接:https://go.coder-hub.com/76215774.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定