我构建了eas -p android --profile luna
。然后,我下载到物理设备。当打开它时,应用程序在显示闪屏后崩溃。Expo SDK 45.0.0。
我尝试更改eas.json
配置文件。以下是我尝试的内容。
"luna": {
"android": {
"buildType": "apk",
"distribution": "internal"
}
}
"luna": {
"android": {
"buildType": "apk",
"distribution": "internal",
"gradleCommand": ":app:assembleRelease"
}
}
"luna": {
"android": {
"buildType": "apk"
}
},
"luna": {
"android": {
"buildType": "apk",
"developmentClient": true
}
},
可以打开DevelopmentClient,但不是我想要的那个。
有人能告诉我,指导我,给我建议吗
1.如何用EAS为物理设备建立APK
1.我应该降级到Expo SDK 44.0.0并使用expo build:android
吗?
1.如何创建物理设备的apk没有博览会(如弹出博览会)
expo build
经典构建将被完全删除。我将来是否应该构建不带expo的react-native应用?
我的package.json文件。
"dependencies": {
"@react-native-async-storage/async-storage": "~1.17.3",
"@react-native-community/datetimepicker": "6.1.2",
"@react-native-community/netinfo": "8.2.0",
"@react-native-masked-view/masked-view": "0.2.6",
"@react-navigation/material-top-tabs": "^6.2.1",
"@react-navigation/native": "^6.0.10",
"@react-navigation/stack": "^6.2.1",
"expo": "~45.0.0",
"expo-splash-screen": "~0.15.1",
"expo-sqlite": "~10.2.0",
"expo-status-bar": "~1.3.0",
"firebase": "^9.8.1",
"react": "17.0.2",
"react-dom": "17.0.2",
"react-native": "0.68.2",
"react-native-collapsible": "^1.6.0",
"react-native-gesture-handler": "~2.2.1",
"react-native-modal-datetime-picker": "^13.1.2",
"react-native-pager-view": "5.4.15",
"react-native-safe-area-view": "^1.1.1",
"react-native-screens": "~3.11.1",
"react-native-svg": "12.3.0",
"react-native-web": "0.17.7",
"victory-native": "^36.4.1",
"expo-dev-client": "~0.9.6"
},
"devDependencies": {
"@babel/core": "^7.12.9",
"@types/react-native": "^0.67.7",
"babel-plugin-root-import": "^6.6.0"
},
3条答案
按热度按时间vxbzzdmp1#
你可以尝试记录你的错误。我建议你采取的第一步是将你的设备(USB调试处于活动状态)连接到你的PC,转到你的
adb
安装的地方,在那个文件夹中打开一个CMD/PowerShell窗口,运行adb logcat *:S ReactNative:V ReactNativeJS:V
,然后尝试打开崩溃的应用程序,看看它崩溃时记录了什么。我遇到的一个问题是EAS在构建期间添加的一些依赖项出现了问题,所以我通过
npm i
单独安装了它(react-native-reanimated@^2.8.0
),然后我的构建与EAS一起工作。v440hwme2#
正如gusti提到的,你需要调试你的应用程序,然后你才能找到问题并修复它。对我来说,问题是我需要安装一个名为“react-native-safe-area-context”的包:
npm install react-native-safe-area-context
然后运行expo doctor --fix-dependencies
以使其与您的sdk版本兼容。expo install react-native-safe-area-context
如果它不工作尝试运行
expo update
它将升级sdk版本并且重新安装所有的软件包使它们与新版本兼容.这是我的问题,你可能会面临一个不同的,但你只需要阅读错误消息,并修复它。
oxiaedzo3#
要查看应用在adb上的日志,请用途:
adb logcat -e "appname"
您还可以过滤错误:
adb logcat -e "appname" | grep Error