请教一个 expo 的问题,一直打包报错,找不到原因,感谢感谢! - V2EX
V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
请不要在回答技术问题时复制粘贴 AI 生成的内容
moment082
V2EX    程序员

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

  •  
  •   moment082 2024-12-05 11:29:26 +08:00 1944 次点击
    这是一个创建于 393 天前的主题,其中的信息可能已经有所发展或是发生改变。

    目前正在使用 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  
       2024-12-05 13:44:00 +08:00
    Java 版本用 23 的
    hefengwqz
        2
    hefengwqz  
       2024-12-05 13:45:04 +08:00
    话说 react native 现在国内用 expo 的多,还是原生脚手架的多啊
    MarcoJiang
        3
    MarcoJiang  
       2024-12-05 14:00:11 +08:00
    试试切换成 JDK17
    FreshOldMan
        4
    FreshOldMan  
       2024-12-05 14:05:48 +08:00   1
    @hefengwqz #2 新项目肯定 expo 多,文档都换成 expo 了,老项目基本都是原生脚手架
    moment082
        5
    moment082  
    OP
       2024-12-05 14:19:01 +08:00
    @MarcoJiang 用的是 17.0.11
    moment082
        6
    moment082  
    OP
       2024-12-05 14:19:26 +08:00
    @hefengwqz 我的是 17 版本,好像 expo 不依赖 jdk 吧
    hefengwqz
        7
    hefengwqz  
       2024-12-05 14:27:18 +08:00
    @moment082 gradle 依赖,你的 8.10.2 太新了,8.10+后官方都维护的 Java23
    moment082
        8
    moment082  
    OP
       2024-12-05 14:40:44 +08:00
    @hefengwqz 好像还真是,我去升级一下看看
    moment082
        9
    moment082  
    OP
       2024-12-05 15:15:40 +08:00
    @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  
       2024-12-05 18:30:13 +08:00
    梯子挂了吗
    moment082
        11
    moment082  
    OP
       2024-12-05 19:58:23 +08:00
    @hwf 找到问题了,包管理工具的原因
    关于     帮助文档     自助推广系统     博客     API     FAQ     Solana     2491 人在线   最高记录 6679       Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 23ms UTC 03:46 PVG 11:46 LAX 19:46 JFK 22:46
    Do have faith in what you're doing.
    ubao msn snddm index pchome yahoo rakuten mypaper meadowduck bidyahoo youbao zxmzxm asda bnvcg cvbfg dfscv mmhjk xxddc yybgb zznbn ccubao uaitu acv GXCV ET GDG YH FG BCVB FJFH CBRE CBC GDG ET54 WRWR RWER WREW WRWER RWER SDG EW SF DSFSF fbbs ubao fhd dfg ewr dg df ewwr ewwr et ruyut utut dfg fgd gdfgt etg dfgt dfgd ert4 gd fgg wr 235 wer3 we vsdf sdf gdf ert xcv sdf rwer hfd dfg cvb rwf afb dfh jgh bmn lgh rty gfds cxv xcv xcs vdas fdf fgd cv sdf tert sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf sdf shasha9178 shasha9178 shasha9178 shasha9178 shasha9178 liflif2 liflif2 liflif2 liflif2 liflif2 liblib3 liblib3 liblib3 liblib3 liblib3 zhazha444 zhazha444 zhazha444 zhazha444 zhazha444 dende5 dende denden denden2 denden21 fenfen9 fenf619 fen619 fenfe9 fe619 sdf sdf sdf sdf sdf zhazh90 zhazh0 zhaa50 zha90 zh590 zho zhoz zhozh zhozho zhozho2 lislis lls95 lili95 lils5 liss9 sdf0ty987 sdft876 sdft9876 sdf09876 sd0t9876 sdf0ty98 sdf0976 sdf0ty986 sdf0ty96 sdf0t76 sdf0876 df0ty98 sf0t876 sd0ty76 sdy76 sdf76 sdf0t76 sdf0ty9 sdf0ty98 sdf0ty987 sdf0ty98 sdf6676 sdf876 sd876 sd876 sdf6 sdf6 sdf9876 sdf0t sdf06 sdf0ty9776 sdf0ty9776 sdf0ty76 sdf8876 sdf0t sd6 sdf06 s688876 sd688 sdf86