首页 > 解决方案 > 为什么在使用 expo 成功构建后 React Native 应用程序没有安装?

问题描述

成功构建 expo 应用程序后,它不会安装在任何手机中。 这可能很容易,但我已经尝试了所有我知道的方法来解决这个问题,但没有奏效。这是我一直在研究 react 以来最疯狂的经历...... 以下是我从安装应用程序到构建它所采取的步骤

  1. npm install expo-cli --global
  2. 博览会初始化我的新项目
  3. cd my-new-project => 世博会开始
  4. npm 安装 -g exp
  5. expo build:android //我选择“让 Expo 处理这个过程!”

这是我的 app.json

{
"expo": {
    "name": "project",
    "slug": "my-new-project",
    "privacy": "public",
    "sdkVersion": "35.0.0",
    "platforms": [
        "ios",
        "android",
        "web"
    ],
    "version": "1.0.0",
    "orientation": "portrait",
    "icon": "./assets/images/icon.png",
    "splash": {
        "image": "./assets/images/splash.png",
        "resizeMode": "contain",
        "backgroundColor": "#ffffff"
    },
    "updates": {
        "fallbackToCacheTimeout": 0
    },
    "assetBundlePatterns": [
        "**/*"
    ],
    "ios": {
        "supportsTablet": true,
        "bundleIdentifier": "com.project.test"
    },
    "android": {
        "package": "com.project.test"
    }
}
}

这是我的 package.json

{
"name": "project",
"main": "node_modules/expo/AppEntry.js",
"scripts": {
    "start": "expo start",
    "android": "expo start --android",
    "ios": "expo start --ios",
    "web": "expo start --web",
    "eject": "expo eject",
    "test": "jest --watchAll"
},
"jest": {
    "preset": "jest-expo"
},
"dependencies": {
    "@expo/samples": "~3.0.3",
    "@expo/vector-icons": "^10.0.3",
    "@react-navigation/web": "^1.0.0-alpha.9",
    "expo": "^35.0.0",
    "expo-asset": "^7.0.0",
    "expo-constants": "^7.0.0",
    "expo-font": "^7.0.0",
    "expo-web-browser": "^7.0.0",
    "react": "16.8.3",
    "react-dom": "16.8.3",
    "react-native": "https://github.com/expo/react-native/archive/sdk-35.0.0.tar.gz",
    "react-native-gesture-handler": "~1.3.0",
    "react-native-web": "^0.11.7",
    "react-navigation": "^3.12.0"
},
"devDependencies": {
    "babel-preset-expo": "^7.0.0",
    "jest-expo": "^35.0.0"
},
"private": true
}

请问有什么帮助吗?

标签: reactjsreact-nativereact-native-androidexpo

解决方案


在此处输入图像描述 在手机设置中找到开发者选项并禁用它,如上图所示。我就是这样解决我的。希望这对你有用。


推荐阅读