我复制我自己的回购。project本机,我安装了节点模块,并根据项目的要求设置了Jdk8。然后,我使用react原生运行-android运行我的项目。告诉我错误
任务:react-native-firebase:compileReleaseJavaWithJavac失败
失败:生成失败,出现异常。
* What went wrong:
Execution failed for task ':react-native-firebase:compileReleaseJavaWithJavac'.
> Could not create service of type GeneralCompileCaches using GradleScopeCompileServices.createGeneralCompileCaches().
* 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 1m 3s
13 actionable tasks: 2 executed, 11 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
Command failed: ./gradlew installDebug
Error: Command failed: ./gradlew installDebug
at checkExecSyncError (child_process.js:601:13)
at Object.execFileSync (child_process.js:621:13)
at runOnAllDevices (/Volumes/Transcend/Emjoy/admin_panel_app_emjoy/node_modules/react-native/local-cli/runAndroid/runAndroid.js:299:19)
at buildAndRun (/Volumes/Transcend/Emjoy/admin_panel_app_emjoy/node_modules/react-native/local-cli/runAndroid/runAndroid.js:135:12)
at isPackagerRunning.then.result (/Volumes/Transcend/Emjoy/admin_panel_app_emjoy/node_modules/react-native/local-cli/runAndroid/runAndroid.js:65:12)
at <anonymous>
at process._tickCallback (internal/process/next_tick.js:188:7)我版本的react原生,react本机-cli,react本机-firebase-所有包都是与所需的项目相同的。
发布于 2019-11-21 13:25:10
如果您正在使用Reacti-Native0.60+,请确保使用。
npx jetify
来自项目根目录。
发布于 2019-11-21 13:37:43
这是一个非常荒谬的问题,与反应本机0.60+,因为它想要安装玩物。
因此,我解决了它的第一个安装玩具,你可以使用纱线或npm。
yarn add jetifier 或
npm jetifier 然后,您应该执行npx jetify
发布于 2020-03-02 00:22:01
可能是一个迟来的答案,但我今天遇到了同样的错误,我就是这样解决的。
在运行./gradlew assembleRelease之前,您需要运行npx jetify
上面的命令将android.support.v4.app.* package转换为androidx.core.app.*,这有助于编译构建。
https://stackoverflow.com/questions/56567320
复制相似问题