所以,我真的是React Native和Expo的新手,但是我正试图为朋友制作一个应用程序,事情是当我尝试创建APK时,我完成了所有事情,它只是不工作,当我尝试打开它时,它立即关闭。
要创建我使用的APK,请执行以下操作:第一个月
这是我的App.js:
import React, { useEffect } from 'react';
import { Buffer } from 'buffer';
import * as ScreenOrientation from 'expo-screen-orientation';
import NavigationStack from './src/stack/NavigationStack';
import { NavigationContainer } from '@react-navigation/native';
import { SurveyProvider } from './src/SurveyContext';
if (!global.Buffer) {
global.Buffer = Buffer;
}
export default function App() {
useEffect(() => {
async function setScreenOrientation() {
await ScreenOrientation.lockAsync(ScreenOrientation.OrientationLock.LANDSCAPE);
}
setScreenOrientation();
}, []);
return (
<SurveyProvider>
<NavigationContainer>
<NavigationStack />
</NavigationContainer>
</SurveyProvider>
);
}
字符串
这是我的eas.json:
{
"cli": {
"version": ">= 3.13.3"
},
"build": {
"development": {
"developmentClient": true,
"distribution": "internal"
},
"preview": {
"distribution": "internal"
},
"production": {}
},
"submit": {
"production": {}
}
}
型
这是我的包。json:
{
"name": "appName",
"version": "1.0.0",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
"start": "expo start",
"android": "expo start --android",
"ios": "expo start --ios",
"web": "expo start --web"
},
"dependencies": {
"@babel/preset-env": "^7.1.6",
"@babel/runtime": "^7.20.6",
"@expo/prebuild-config": "^6.2.6",
"@react-native-picker/picker": "2.4.10",
"@react-navigation/native": "^6.1.7",
"@react-navigation/stack": "^6.3.17",
"@reduxjs/toolkit": "^1.9.5",
"exceljs": "^4.3.0",
"expo": "^49.0.6",
"expo-document-picker": "~11.5.4",
"expo-file-system": "~15.4.2",
"expo-image-picker": "~14.3.2",
"expo-media-library": "~15.4.1",
"expo-permissions": "~14.2.1",
"expo-screen-orientation": "~6.0.5",
"expo-sharing": "~11.5.0",
"expo-updates": "~0.18.11",
"nativewind": "^2.0.11",
"react": "18.2.0",
"react-native": "0.72.3",
"react-native-dotenv": "^3.4.9",
"react-native-gesture-handler": "~2.12.0",
"react-native-safe-area-context": "4.6.3",
"react-native-screens": "~3.22.0",
"react-redux": "^8.1.1",
"redux-devtools-extension": "^2.13.9",
"xlsx": "^0.18.5"
},
"devDependencies": {
"@babel/core": "^7.20.0",
"tailwindcss": "3.3.2"
},
"private": true
}
型
我试着要求chatGPT,但这只会让事情变得更糟,我真的不知道发生了什么,我添加了android权限,但显然这没有帮助.
"android": {
"permissions": [
"READ_EXTERNAL_STORAGE",
"WRITE_EXTERNAL_STORAGE"
],
型
我只是想应用程序安装后打开我从EAS创建的APK,它真的工作时,我使用世博会去,但再次,我是新来的,所以idk该怎么办.
1条答案
按热度按时间qv7cva1a1#
我发现了问题,这是博览会更新,我只是卸载它,这工作。