我正在构建一个反应本机应用程序,在expo客户端上工作正常。但我得到:'未捕获错误:在启动画面后在日志中调用AppRegistry.runApplication'时出错。
我添加了AppRegistry.registerComponent('main',()=> App),这通过Expo客户端工作。我是通过expo build:android创建SDK的。
{
"main": "App.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"eject": "expo eject",
"test": "node ./node_modules/jest/bin/jest.js --watchAll"
},
"jest": {
"preset": "jest-expo"
},
"dependencies": {
"@expo/samples": "2.1.1",
"expo": "^32.0.0",
"react": "16.5.0",
"react-native": "https://github.com/expo/react-native/archive/sdk-32.0.0.tar.gz",
"react-native-elements": "^1.1.0",
"react-native-material-cards": "^1.0.9",
"react-native-shadow": "^1.2.2",
"react-navigation": "^3.0.9",
"typescript": "^3.4.1"
},
"devDependencies": {
"babel-preset-expo": "^5.0.0",
"jest-expo": "^32.0.0"
},
"private": true
}
当您输入'expo init appname'时,您输入的名称是'main'吗?
AppRegistry.registerComponent('AppName', () => componentName)
如果没有,请参阅this link.
C:\Users\username\AppData\Local\Android\Sdk\platform-tools\
从这里开了一个航站楼。并输入adb reverse tcp:8081 tcp:8081