我在React-Native项目中遇到了一个问题,该问题较早就可以正常工作,但是突然停止了工作。每当我使用命令时:
react-native run-android
我收到一个错误:
找不到Android项目。也许首先运行react-native android?
我尝试跑步:
react-native android
但它说:
Unrecognized command 'android' Run react-native --help to see list of all available commands
经过尝试:
D:\ProjectRoot\ReactNativeProjects\AwesomeProject>react-native eject
返回的错误是:
扫描文件夹中D:\ ProjectRoot \ ReactNativeProjects \ AwesomeProject \ node_modules中的符号链接(48毫秒)
name
必须在app.json
配置文件中定义应用程序以定义项目名称。它不能包含任何空格或破折号。
这是app.json文件:
{
"expo": {
"name": "AwesomeProject",
"description": "A very interesting project.",
"slug": "AwesomeProject",
"privacy": "public",
"sdkVersion": "30.0.0",
"platforms": ["ios", "android"],
"ios": {
"supportsTablet": true
},
"android": {
"package": "com.project.first"
},
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/images/icon.png",
"splash": {
"image": "./assets/images/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"updates": {
"fallbackToCacheTimeout": 0
},
"assetBundlePatterns": [
"**/*"
]
}
}