为什么Expo Go隧道无法使用?

问题描述 投票:0回答:1

所以我遇到了一个问题,我不能再使用世博隧道了。我一直在使用它在 Expo Go 中测试我的应用程序,但现在它陷入了开发模式。 它发生在我为 Android 构建应用程序之后(之前我只为 IOS 构建它)。

之前它会有一个使用 NGROK 隧道提供服务的 IP,但现在它只会使用:

Metro waiting on exp+project://expo-development-client/?url=http%3A%2F%2F127.0.0.1%3A8081

当我用 iPhone 扫描二维码时,它显示“未找到可用数据” 这是运行 npx expo start --tunnel

时的情况

澄清我的目标是使用 Expo Go(我之前曾使用过)在 iPhone 上测试我的应用程序。

App.json:

{
  "expo": {
    "sdkVersion": "51.0.14",
    "name": "project",
    "slug": "project",
    "version": "1.0.2",
    "entryPoint": "./src/App.js",
    "orientation": "portrait",
    "icon": "./assets/apple-touch-icon.png",
    "userInterfaceStyle": "light",
    "splash": {
      "image": "./assets/Logo.png",
      "resizeMode": "contain",
      "backgroundColor": "#000000"
    },
    "assetBundlePatterns": [
      "**/*"
    ],
    "ios": {
      "supportsTablet": true,
      "config": {
        "googleMapsApiKey": "key"
      },
      "publishManifestPath": "manifest.json",
      "bundleIdentifier": "com.id",
      "buildNumber": "1",
      "infoPlist": {
        "NSPhotoLibraryUsageDescription": "This app requires access to your photo library to allow you to select a profile picture. Your photos will not be shared without your permission.",
        "NSLocationWhenInUseUsageDescription": "This app requires access to your location to provide a better user experience by showing your position relative to the destinations on the map. Your location will not be shared or used for any other purpose."
      }
    },
    "android": {
      "package": "project",
      "versionCode": 2,
      "adaptiveIcon": {
        "foregroundImage": "./assets/android-chrome-256x256.png",
        "backgroundColor": "#ffffff"
      },
      "permissions": ["READ_EXTERNAL_STORAGE", "ACCESS_FINE_LOCATION","android.permission.READ_EXTERNAL_STORAGE","android.permission.CAMERA"],
      "config": {
        "googleMaps": {
          "apiKey": "AIzaSyAmD_o4BkStDp7KlLXwG6iEZY1zTI5Iux8"
        }
      }
    },
    "web": {
      "favicon": "./assets/favicon.png"
    },
    "packagerOpts": {
      "assetExts": [
        "svg"
      ]
    },
    "plugins": [
      "expo-asset",
      "expo-secure-store",
      "expo-splash-screen",
      "expo-dev-client"
    ],
    "extra": {
      "eas": {
        "projectId": "1a7b2be8-182b-40c8-802a-5a20433287a3"
      }
    },
    "owner": "project"
  }
}

eas.json

{
  "cli": {
    "version": ">= 9.0.5"
  },
  "build": {
    "production": {
      "android": {
        "buildType": "app-bundle"
      },
      "ios": {
        "distribution": "store"
      }
    },
    "preview": {
      "android": {
        "buildType": "apk"
      }
    }
  },
  "submit": {
    "production": {
      "ios": {
        "ascApiKeyId": "id",
        "ascApiKeyIssuerId": "id",
        "ascAppId": "6504838908",
        "appleTeamId": "id",
        "bundleIdentifier": "project",
        "ascApiKeyPath": "./keypath.p8"
      }
    }
  }
}

**package.json **

{
  "name": "project",
  "version": "1.0.0",
  "private": true,
  "dependencies": {
    "@react-native-async-storage/async-storage": "1.23.1",
    "@react-native-community/datetimepicker": "8.0.1",
    "@react-native-picker/picker": "^2.7.5",
    "@react-navigation/bottom-tabs": "^6.5.20",
    "@react-navigation/drawer": "^6.6.6",
    "@react-navigation/native": "^6.1.14",
    "@react-navigation/native-stack": "6.9.22",
    "axios": "0.28.0",
    "echarts": "^5.5.0",
    "expo": "^51.0.17",
    "expo-app-loading": "^2.1.1",
    "expo-asset": "~10.0.6",
    "expo-av": "~14.0.5",
    "expo-constants": "~16.0.2",
    "expo-image-picker": "~15.0.5",
    "expo-location": "~17.0.1",
    "expo-permissions": "^14.4.0",
    "expo-secure-store": "~13.0.1",
    "expo-status-bar": "~1.12.1",
    "git": "^0.1.5",
    "lottie-react-native": "6.7.0",
    "react": "18.2.0",
    "react-native": "0.74.2",
    "react-native-chart-kit": "^6.12.0",
    "react-native-geolocation-service": "^5.3.1",
    "react-native-gesture-handler": "~2.16.1",
    "react-native-maps": "1.14.0",
    "react-native-raw-bottom-sheet": "^3.0.0",
    "react-native-reanimated": "~3.10.1",
    "react-native-safe-area-context": "4.10.1",
    "react-native-screens": "3.31.1",
    "react-native-sectioned-multi-select": "^0.10.0",
    "react-native-svg": "15.2.0",
    "react-native-vector-icons": "^10.0.3",
    "react-native-video": "^5.2.1",
    "react-native-webview": "13.8.6",
    "touch": "^3.1.0"
  },
  "scripts": {
    "start": "expo start --no-dev --tunnel",
    "android": "expo run:android",
    "ios": "expo run:ios",
    "web": "expo start --web",
    "eject": "expo eject"
  },
  "eslintConfig": {
    "extends": [
      "react-app",
      "react-app/jest"
    ]
  },
  "browserslist": {
    "production": [
      ">0.2%",
      "not dead",
      "not op_mini all"
    ],
    "development": [
      "last 1 chrome version",
      "last 1 firefox version",
      "last 1 safari version"
    ]
  },
  "devDependencies": {
    "expo-dev-client": "^4.0.18",
    "patch-package": "^8.0.0",
    "react-native-svg-transformer": "^1.3.0"
  }
}

  expo-env-info 1.2.0 environment info:
    System:
      OS: Linux 6.5 Debian GNU/Linux 12 (bookworm) 12 (bookworm)
      Shell: 5.2.15 - /bin/bash
    Binaries:
      Node: 18.20.1 - /usr/local/bin/node
      Yarn: 1.22.19 - /usr/local/bin/yarn
      npm: 10.5.0 - /usr/local/bin/npm
    npmPackages:
      expo: ^51.0.21 => 51.0.21 
      react: 18.2.0 => 18.2.0 
      react-native: 0.74.2 => 0.74.2 
    npmGlobalPackages:
      eas-cli: 10.2.1
      expo-cli: 6.3.10
    Expo Workflow: bare

运行 npx expo start --tunnel 应该允许我在 iPhone 上测试该应用程序

react-native expo expo-go
1个回答
0
投票

所以我只需从 app.json 文件中删除 SDKVersion,它现在可以通过隧道运行。

© www.soinside.com 2019 - 2024. All rights reserved.