我已经为我的项目在本机反应中创建了一个应用。当我将项目文件复制到app文件夹中然后运行该应用程序时,它说在node_module react-redux中不存在,然后当我在命令中运行npm install [email protected]
命令后,在我的应用程序文件夹中使用run-android
安装了react-redux这个项目的提示是-Could not read script 'E:\AppFolder\MyApp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.
。
[此后,我擦除了模拟器的数据并运行run-android
,但它仍然给我相同的错误,并且应用程序未安装在模拟器中。
这里是显示命令提示符的错误:
info Building and installing the app on the device (cd android && gradlew.bat app:installDebug)...
Starting a Gradle Daemon, 2 incompatible and 1 stopped Daemons could not be reused, use --status for details
FAILURE: Build failed with an exception.
* Where:
Settings file 'E:\AppFolder\MyApp\android\settings.gradle' line: 4
* What went wrong:
A problem occurred evaluating settings 'TribeBond'.
> Could not read script 'E:\AppFolder\MyApp\node_modules\@react-native-community\cli-platform-android\native_modules.gradle' as it does not exist.
* 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 10s
error 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
error Command failed: gradlew.bat app:installDebug. Run CLI with --verbose flag for more details.```
我在这里按照以下步骤解决我的问题-
react-native run-android
命令运行它。 npm install
命令。react-native run-android
重建应用程序。