native_modules.gradle文件将在安装react-redux后立即删除

问题描述 投票:0回答:1

我已经为我的项目在本机反应中创建了一个应用。当我将项目文件复制到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 gradle android-emulator command-prompt
1个回答
0
投票

我在这里按照以下步骤解决我的问题-

  1. 我构建了一个新应用,并使用react-native run-android命令运行它。
  2. 然后我一个接一个地安装了所有依赖项,这将在应用程序中使用。
  3. 然后在项目中运行npm install命令。
  4. [之后,我使用react-native run-android重建应用程序。
  5. 还有多田!该应用程序已重建,没有任何错误。
© www.soinside.com 2019 - 2024. All rights reserved.