【发布时间】:2019-12-24 02:41:31
【问题描述】:
几周前我一直在尝试修复此错误,但没有成功。问题是我无法发布我的应用程序。
当我为 iOS 或 Android 中的任何一个构建我的 expo 应用程序时,Expo CLI 签名过程运行良好,没有错误并生成最终包,但是当我将 spa 或 apk 文件安装到真实设备中时,它会显示启动屏幕连续 4 或 5 次(某种循环),最后显示以下错误消息:
签出没有结果:
https://forums.expo.io/t/application-main-has-not-been-registered/14395
Application main has not been registered
https://forums.expo.io/t/application-main-has-not-been-registered/11753
我的 package.json 看起来像这样:
{
"name": "Sxunco",
"homepage": "https://www.sxunco.com",
"version": "1.0.3",
"private": true,
"main": "node_modules/expo/AppEntry.js",
"jest": {
"preset": "jest-expo",
"transformIgnorePatterns": [
"node_modules/(?!((jest-)?react-native|react-clone-referenced-element|expo(nent)?|@expo(nent)?/.*|react-navigation|redux-persist|native-base(-shoutem-theme)|native-base|react-native-router-flux))"
]
},....
我的 App.js:
import React from 'react';
import Root from './src/native/index';
import configureStore from './src/store/index';
const { persistor, store } = configureStore();
export default function App() {
return <Root store={store} persistor={persistor} />;
}
我尝试过同样的结果:
- 在 app.json 中添加
"appKey": "main" - 将
AppRegistry.registerComponent(‘main’, () => App);添加到 App.js 和 exporegisterRootComponent(App)(分开和一起,都不起作用) - 更改“主”路径 package.json 直接到 App.js 并使用上述方法注册应用程序 手动
当我运行构建时,我也会运行:
exp start --no-dev --minify
所以我等待服务器完成加载然后运行expo build:android
我不知道该怎么做,因此我无法发布我的应用程序。
【问题讨论】:
-
嗨@karlo 我也有同样的问题,你是怎么解决的?
标签: react-native build expo