[英]React-native problem - Execution failed for task ':app:compileDebugJavaWithJavac'
[英]Execution failed for task ':expo-constants:compileDebugJavaWithJavac'. (React-Native)
所以,我正在開發一個 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
首先嘗試npm i jetifier
或yarn add jetifier
然后npx jetify
。 希望能幫助到你
刪除 node_modules/expo-constants/and build 文件夾
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.