Android 创建本地应用程序后生成应用程序
好的,这是我的问题 使用命令Android 创建本地应用程序后生成应用程序,android,react-native,build,runtime-error,Android,React Native,Build,Runtime Error,好的,这是我的问题 使用命令create react native app myApp创建react native app后,我编辑了文件app.js,并能够使用npm start和appExpo在我的android手机上运行它 之后,我使用npm run eject弹出项目 我试图让项目从那里以树的方式运行: 运行npm运行android 运行react原生运行android 并在myApp/android下使用android Studio打开项目,在那里构建它 每次我的手机(三星Galaxy
create react native app myApp
创建react native app后,我编辑了文件app.js
,并能够使用npm start
和appExpo在我的android手机上运行它
之后,我使用npm run eject
弹出项目
我试图让项目从那里以树的方式运行:
react原生运行android
myApp/android
下使用android Studio打开项目,在那里构建它mkdir-android/app/src/main/assets
react native bundle--platform android--dev false--entry file index.android.js--bundle output android/app/src/main/assets/index.android.bundle--assets dest android/app/src/main/res/
找不到条目文件index.android.js
,因为我使用了create react native app
,它只提供文件app.js
因此我运行了命令:react native bundle--platform-android--dev false--entry file App.js--bundle output-android/App/src/main/assets/index.android.bundle--assets dest-android/App/src/main/res/
,它将文件index.android.bundle
和index.android.bundle.meta
添加到assets
文件夹中
最后我跑了:
3. <代码>反应本机再次运行android
现在,我收到以下错误消息:
模块AppRegistry不是已注册的模块(调用runApplication)
我没有主意了。有没有人遇到过类似的问题/知道如何处理
谢谢,
布吉问题已解决:
react native 0.49.5有一个index.js
文件,需要在react native bundle
命令中使用该文件
mkdir-android/app/src/main/assets
react native bundle--platform android--dev false--entry file index.js--bundle output android/app/src/main/assets/index.android.bundle--assets dest android/app/src/main/res/
react原生运行android
index.js
文件,需要在react native bundle
命令中使用该文件
mkdir-android/app/src/main/assets
react native bundle--platform android--dev false--entry file index.js--bundle output android/app/src/main/assets/index.android.bundle--assets dest android/app/src/main/res/
react原生运行android