运行react-native run-android --variant = release时出错(在根项目'gnosisapp'中找不到任务'installReleaseDebug'.)

Joh*_*son 8 android facebook android-gradle-plugin react-native react-native-android

我正试图做这个错误 react-native run-android --variant=release

Starting JS server...
Running /home/sonic182/Android/platform-tools/adb -s ZY2232QD4K reverse tcp:8081 tcp:8081
Building and installing the app on the device (cd android && ./gradlew installReleaseDebug)...

FAILURE: Build failed with an exception.

* What went wrong:
Task 'installReleaseDebug' not found in root project 'gnosisapp'.

* Try:
Run gradlew tasks to get a list of available tasks. Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

Total time: 7.779 secs
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/android-setup.html

(node:24877) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 2): TypeError: Cannot read property 'message' of undefined
Run Code Online (Sandbox Code Playgroud)

我已经完成了Ubuntu 16.04,我从这里完成了所有步骤https://facebook.github.io/react-native/docs/signed-apk-android.html,直到我需要做的测试步骤react-native run-android --variant=release

会是什么呢?:/ 谢谢

max*_*23_ 38

如果您运行的是React Native 0.39.x,请使用以下命令:

react-native run-android --configuration=release
Run Code Online (Sandbox Code Playgroud)

  • 已经提交了PR(https://github.com/facebook/react-native/pull/11443)来更新官方文档. (3认同)
  • 这应该在官方文档中更新... https://facebook.github.io/react-native/docs/signed-apk-android.html (2认同)