为什么在使用Expo成功构建后无法安装React Native应用程序?

时间:2019-11-30 08:05:24

标签: reactjs react-native react-native-android expo

成功构建expo应用程序后,它将无法安装在任何手机中。 这可能很容易,但是我已经尽力解决了这个问题,但是没有用。 自从我从事反应工作以来,这是我最疯狂的经历。 下面是我从安装应用到构建应用的步骤

  1. npm install expo-cli --global
  2. expo init my-new-project
  3. cd my-new-project =>博览会开始
  4. npm install -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
}

请帮助?

1 个答案:

答案 0 :(得分:0)

enter image description here 如上图所示,在手机设置中找到开发人员选项的方法,然后将其禁用。 我就是这样解决我的。 希望对您有用。