今天继续做公司安排的安卓项目时,yarn android运行项目后发现出现了这个错误,刚开始百思不得其解,我也没改什么配置。。然后细细看了看错误信息,定位到了位置。原来是我把package.json中一个不用的包删除掉后没有删掉其他依赖的信息,导致项目运行起来没找到这个包从而报错。
error Failed to install the app. Make sure you have the Android development environment set up: https://reactnative.dev/docs/environment-setup. Run CLI
with --verbose flag for more details.
Error: Command failed: gradlew.bat app:installDebug -PreactNativeDevServerPort=8081
D:\workspace_idea\work_project\6.code\LegalApp\android\app\src\main\java\com\legalapp\MainApplication.java:7: ����: �����ui.fileselector���
���
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.
错误就在:
D:\workspace_idea\work_project\6.code\LegalApp\android\app\src\main\java\com\legalapp\MainApplication.java:7: ����: �����ui.fileselector���
���
把没用的import去掉即可。