【问题标题】:Execution failed for task ':expo-constants:compileDebugJavaWithJavac'. (React-Native)任务 ':expo-constants:compileDebugJavaWithJavac' 执行失败。 (反应原生)
【发布时间】:2020-01-15 12:39:06
【问题描述】:

所以,我正在开发一个 react-native 应用程序。当我尝试使用提供的有关它的文档添加 react-native-navigation 时,这是我遇到的错误,已经尝试了所有可用的解决方案,但对我不起作用。

提前致谢!

任务:expo-constants:compileDebugJavaWithJavac FAILED E:\react native\rn-course\node_modules\expo-constants\android\src\main\java\expo\modules\constants\ConstantsService.java:142:错误:找不到符号 返回 info.getLongVersionCode(); ^ 符号:方法 getLongVersionCode() 位置:PackageInfo 类型的变量信息 1 个错误

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':expo-constants:compileDebugJavaWithJavac'.
> Compilation failed; see the compiler error output for 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

BUILD FAILED in 35s
340 actionable tasks: 335 executed, 5 up-to-date
Could not install the app on the device, read the error above for details.
Make sure you have an Android emulator running or a device connected and have
set up your Android development environment:
https://facebook.github.io/react-native/docs/getting-started.html

【问题讨论】:

  • 您好,您能否编辑您的问题以包含更多上下文? (我不知道它实际上是什么,但我想像你试图运行什么代码,或者你试图做什么/安装什么)
  • 谢谢。已编辑,但如果需要任何代码,我可以再次提供感谢。

标签: android react-native


【解决方案1】:

首先尝试npm i jetifieryarn add jetifier,然后再尝试npx jetify。希望对你有帮助

【讨论】:

  • 谢谢。现在我收到此错误任务':app:processDebugResources'的执行失败。 > 执行 aapt 失败
  • 我已将新错误发布为新问题,请结帐stackoverflow.com/q/59768657/12717682
【解决方案2】:

删除 node_modules/expo-constants/ 并构建文件夹

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2020-07-06
    • 2022-10-04
    • 1970-01-01
    • 2021-04-12
    • 2022-11-06
    • 1970-01-01
    • 2022-11-07
    • 2023-01-05
    相关资源
    最近更新 更多