V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
• 请不要在回答技术问题时复制粘贴 AI 生成的内容
moment082
V2EX  ›  程序员

请教一个 expo 的问题,一直打包报错,找不到原因,感谢感谢!

  •  
  •   moment082 · 7 天前 · 528 次点击

    目前正在使用 expo 开发一款 APP ,目前我是能在 web 端正常使用的,在手机端测试也是没有问题的,就是打包的时候报错,不知道是什么原因报错,这是我的一些版本信息:

    {
      "dependencies": {
        "@babel/runtime": "^7.26.0",
        "@expo/vector-icons": "^14.0.2",
        "@react-native-async-storage/async-storage": "^2.1.0",
        "@react-navigation/bottom-tabs": "^7.0.0",
        "@react-navigation/native": "^7.0.13",
        "@supabase/supabase-js": "^2.46.2",
        "expo": "~52.0.11",
        "expo-blur": "~14.0.1",
        "expo-clipboard": "^7.0.0",
        "expo-constants": "~17.0.3",
        "expo-file-system": "^18.0.4",
        "expo-font": "~13.0.1",
        "expo-haptics": "~14.0.0",
        "expo-image-manipulator": "^13.0.5",
        "expo-image-picker": "^16.0.3",
        "expo-linking": "~7.0.3",
        "expo-media-library": "^17.0.3",
        "expo-router": "~4.0.9",
        "expo-splash-screen": "~0.29.13",
        "expo-status-bar": "~2.0.0",
        "expo-symbols": "~0.2.0",
        "expo-system-ui": "~4.0.4",
        "expo-web-browser": "~14.0.1",
        "react": "18.3.1",
        "react-dom": "18.3.1",
        "react-native": "0.76.3",
        "react-native-element-dropdown": "^2.12.2",
        "react-native-gesture-handler": "~2.20.2",
        "react-native-image-zoom-viewer": "^3.0.1",
        "react-native-markdown-display": "^7.0.2",
        "react-native-popup-menu": "^0.16.1",
        "react-native-reanimated": "~3.16.1",
        "react-native-safe-area-context": "4.12.0",
        "react-native-screens": "~4.1.0",
        "react-native-web": "~0.19.13",
        "react-native-webview": "13.12.2",
        "twrnc": "^4.6.0",
        "zustand": "^5.0.1"
      }
    }
    

    这是 app.json 文件的配置:

    {
      "expo": {
        "name": "",
        "slug": "",
        "version": "1.0.0",
        "orientation": "portrait",
        "icon": "./assets/images/icon.png",
        "scheme": "myapp",
        "userInterfaceStyle": "automatic",
        "newArchEnabled": true,
        "ios": {
          "supportsTablet": true
        },
        "android": {
          "adaptiveIcon": {
            "foregroundImage": "./assets/images/adaptive-icon.png",
            "backgroundColor": "#ffffff"
          },
          "package": "",
          "permissions": [
            "CAMERA",
            "READ_EXTERNAL_STORAGE",
            "WRITE_EXTERNAL_STORAGE",
            "MEDIA_LIBRARY"
          ]
        },
        "web": {
          "bundler": "metro",
          "output": "static",
          "favicon": "./assets/images/favicon.png"
        },
        "plugins": [
          "expo-router",
          "expo-image-picker",
          "expo-media-library",
          "expo-file-system",
          [
            "expo-splash-screen",
            {
              "image": "./assets/images/splash-icon.png",
              "imageWidth": 200,
              "resizeMode": "contain",
              "backgroundColor": "#ffffff"
            }
          ]
        ],
        "experiments": {
          "typedRoutes": true
        },
        "extra": {
          "router": {
            "origin": false
          },
          "eas": {
            "projectId": "79ae9f3b-3151-485f-bf91-742e4c21e"
          }
        }
      }
    }
    

    这是 eas.json 文件的配置:

    {
      "cli": {
        "version": ">= 13.4.2",
        "appVersionSource": "remote"
      },
      "build": {
        "development": {
          "developmentClient": true,
          "distribution": "internal",
          "android": {
            "gradleCommand": ":app:assembleDebug",
            "buildType": "apk"
          }
        },
        "preview": {
          "distribution": "internal",
          "android": {
            "buildType": "apk",
            "gradleCommand": ":app:assembleRelease"
          }
        },
        "production": {
          "autoIncrement": true,
          "android": {
            "buildType": "app-bundle",
            "gradleCommand": ":app:bundleRelease"
          }
        }
      },
      "submit": {
        "production": {
          "android": {
            "track": "internal"
          }
        }
      }
    }
    

    这是 eas 的版本:

    20241205112715

    这是相关的报错信息:

    20241205112823

    请问这些都应该如何解决啊。感谢大佬们的指教!!!

    11 条回复    2024-12-05 19:58:23 +08:00
    hefengwqz
        1
    hefengwqz  
       7 天前
    Java 版本用 23 的
    hefengwqz
        2
    hefengwqz  
       7 天前
    话说 react native 现在国内用 expo 的多,还是原生脚手架的多啊
    MarcoJiang
        3
    MarcoJiang  
       7 天前
    试试切换成 JDK17
    FreshOldMan
        4
    FreshOldMan  
       7 天前   ❤️ 1
    @hefengwqz #2 新项目肯定 expo 多,文档都换成 expo 了,老项目基本都是原生脚手架
    moment082
        5
    moment082  
    OP
       7 天前
    @MarcoJiang 用的是 17.0.11
    moment082
        6
    moment082  
    OP
       7 天前
    @hefengwqz 我的是 17 版本,好像 expo 不依赖 jdk 吧
    hefengwqz
        7
    hefengwqz  
       7 天前
    @moment082 gradle 依赖,你的 8.10.2 太新了,8.10+后官方都维护的 Java23
    moment082
        8
    moment082  
    OP
       7 天前
    @hefengwqz 好像还真是,我去升级一下看看
    moment082
        9
    moment082  
    OP
       7 天前
    @hefengwqz 还是有这个报错欸 java version "23.0.1" 2024-10-15
    Java(TM) SE Runtime Environment (build 23.0.1+11-39)
    Java HotSpot(TM) 64-Bit Server VM (build 23.0.1+11-39, mixed mode, sharing) 我已经升级了
    hwf
        10
    hwf  
       7 天前
    梯子挂了吗
    moment082
        11
    moment082  
    OP
       7 天前
    @hwf 找到问题了,包管理工具的原因
    关于   ·   帮助文档   ·   博客   ·   API   ·   FAQ   ·   实用小工具   ·   1246 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 26ms · UTC 17:31 · PVG 01:31 · LAX 09:31 · JFK 12:31
    Developed with CodeLauncher
    ♥ Do have faith in what you're doing.