expo / vector-icons

https://icons.expo.fyi
MIT License
647 stars 114 forks source link

[Android, Development Build, SDK 50, monorepo] Icons do not show up #297

Closed atesarova closed 2 months ago

atesarova commented 2 months ago

Icons do not show up after building the app.

I am getting warning: Module "3" is missing from the asset registry (probably the error is connected)

When I build the app without development client, the icons load properly.

My package.json:

{
    "name": "fintokei-mobile",
    "main": "index.js",
    "version": "1.0.0",
    "scripts": {
        "start": "expo start --dev-client",
        "android": "expo run:android",
        "ios": "expo run:ios",
        "type-check": "tsc -noEmit --skipLibCheck"
    },
    "jest": {
        "preset": "jest-expo"
    },
    "dependencies": {
        "@expo/vector-icons": "^14.0.0",
        "@gluestack-style/animation-resolver": "^1.0.4",
        "@gluestack-style/react": "^1.0.48",
        "@gluestack-ui/config": "^1.1.7",
        "@gluestack-ui/themed": "^1.1.8",
        "@gorhom/portal": "^1.0.14",
        "@react-native-community/hooks": "^3.0.0",
        "@react-native-community/netinfo": "11.1.0",
        "@react-native-segmented-control/segmented-control": "^2.5.0",
        "@react-navigation/native": "^6.0.2",
        "@shopify/flash-list": "^1.6.3",
        "@tanstack/react-query": "^4.36.1",
        "@trpc/client": "^10.45.1",
        "@trpc/react-query": "^10.45.1",
        "babel-preset-expo": "^10.0.1",
        "dayjs": "^1.11.10",
        "expo": "~50.0.7",
        "expo-application": "~5.8.3",
        "expo-asset": "~9.0.2",
        "expo-av": "~13.10.5",
        "expo-constants": "~15.4.5",
        "expo-dev-client": "~3.3.9",
        "expo-device": "~5.9.3",
        "expo-font": "~11.10.3",
        "expo-linear-gradient": "~12.7.2",
        "expo-linking": "~6.2.2",
        "expo-local-authentication": "~13.8.0",
        "expo-localization": "~14.8.3",
        "expo-navigation-bar": "~2.8.1",
        "expo-notifications": "~0.27.6",
        "expo-router": "~3.4.7",
        "expo-secure-store": "~12.8.1",
        "expo-sharing": "~11.10.0",
        "expo-splash-screen": "~0.26.4",
        "expo-status-bar": "~1.11.1",
        "expo-system-ui": "~2.9.3",
        "expo-updates": "~0.24.11",
        "expo-web-browser": "~12.8.2",
        "i18next": "^23.10.0",
        "react": "18.2.0",
        "react-dom": "18.2.0",
        "react-hook-form": "^7.50.1",
        "react-i18next": "^14.0.5",
        "react-native": "0.73.4",
        "react-native-gesture-handler": "~2.14.0",
        "react-native-mmkv": "^2.12.1",
        "react-native-pager-view": "^6.2.3",
        "react-native-reanimated": "~3.6.2",
        "react-native-safe-area-context": "4.8.2",
        "react-native-screens": "~3.29.0",
        "react-native-svg": "14.1.0",
        "react-native-toast-message": "^2.2.0",
        "react-native-web": "~0.19.6",
        "react-native-webview": "13.6.4",
        "zustand": "4.4.0"
    },
    "devDependencies": {
        "@babel/runtime": "^7.24.0",
        "@babel/core": "^7.20.0",
        "@react-native/assets-registry": "0.74.0",
        "@types/react": "~18.2.45",
        "jest": "^29.2.1",
        "jest-expo": "~50.0.2",
        "typescript": "^5.1.3"
    },
    "private": true
}

metro.config:


const { getDefaultConfig } = require('expo/metro-config')
const path = require('path')

const projectRoot = __dirname
const workspaceRoot = path.resolve(projectRoot, '../..')

const config = getDefaultConfig(projectRoot)

config.watchFolders = [
    workspaceRoot,
    path.resolve(projectRoot, 'node_modules'),
    path.resolve(workspaceRoot, 'node_modules'),
    path.resolve(workspaceRoot, 'packages')
]

config.resolver.nodeModulesPaths = [
    path.resolve(projectRoot, 'node_modules'),
    path.resolve(workspaceRoot, 'node_modules')
]

module.exports = config
m79464449p commented 2 months ago

Me too,and Metro.confing.js is inoperative

atesarova commented 2 months ago

The problem caused package expo-asset for me. I solved it by moving the package to devDependencies ✅ Hope it helps someone.