Could not find the expected embedded asset AntDesign.ttf. Check that expo-updates is installed correctly

Expo SDK 39:

I have bare workflow but I was still using @expo/vector-icons. I started to get this error with my IOS release build:

'NSInternalInconsistencyException', reason: 'Could not find the expected embedded asset AntDesign.ttf. Check that expo-updates is installed correctly.'

I tried to replace my @expo/vector-icons with react-native-vector-icons but it didn’t helped. Debug is working perfectly with both @expo/vector icons and react-native vector icons.
It is kinda hard to reproduce with minimal repo. If someone have experience with this kind of error in expo-updates, can you at least help me with direction to check. I am out of options)

Hey there @egorzotov . This means that expo-updates expected the AntDesign.ttf file to be embedded into the app binary, but it either wasn’t there at all, or it was in a different relative location than expected. I wasn’t able to reproduce this in a simple blank project. Do you have an unusual repo setup or something?

Hi, thank you for answer!

Maybe I don’t understand how to make fonts embedded inside app binary? @expo/vector-icons was always working for me in Debug and Release builds before i moved to Bare flow.
I never did caching fonts like here but it was working fine: https://docs.expo.io/guides/preloading-and-caching-assets/ - i don’t think that i have to always preload all fonts because i am not even using AntDesign icons in my project.

After all failures with expo-icons I removed them and moved to react-native-vector-icons and configured them by adding to Resources in xcode and to Info.plist. It was working fine in debug.This was a problem Babel preset @expo/vector-icons module resolution but it is resolvable for now with custom babel preset - but i will be very happy if someone can give me some link to read or answer some questions about it :smiley:
But the same error was popping up again in Release on app start.

After I deleted expo dependency - I was able to make app work in Release with react-native-vector-icons without any crashes but updates stopped working for me.

My setup unusual and has custom metro.config.js but it is only configured to watch some folders outside root.
Here is config:

const path = require('path');
const installedDependencies = require("./package.json").dependencies;

const extraNodeModules = {};
const extraModulesArray = [];
Object.keys(installedDependencies).forEach(dep => {
    extraNodeModules[dep] = path.resolve(__dirname, "node_modules", dep);
    extraModulesArray.push(path.resolve(__dirname, "node_modules", dep))
});

const blacklist = require('metro-config/src/defaults/blacklist');

module.exports = {
    watchFolders:[
        ...extraModulesArray,
        path.resolve(__dirname),
        path.resolve(__dirname, '../requester'),
        path.resolve(__dirname, "../store"),
        path.resolve(__dirname, "../reducers"),
        path.resolve(__dirname, "../actions"),
        path.resolve(__dirname, "../hocs"),
        path.resolve(__dirname, "../middlewares"),
        path.resolve(__dirname, "../utils")
    ],
    resolver: {
        /* resolver options */
        blacklistRE: blacklist([
            /node_modules\/.*\/node_modules\/react-native\/.*/,
        ]),
        extraNodeModules:extraNodeModules,
    },
    transformer: {
        /* transformer options */
        assetPlugins: ['expo-asset/tools/hashAssetFiles']
    },
    serializer: {
        /* serializer options */
    },
    server: {
        /* server options */
    }

    /* general options */
};

I still thing that there is something strange about @expo/vector-icons installed as dependency of expo and it is causing some havoc for me.

How I can check if my fonts are embedded or not and where expo-updates checking it?

Hi @egorzotov - you shouldn’t need to worry about embedding the fonts manually, the RN bundler should do this for you as long as they are required somewhere in your app code or dependencies.

You can look inside the app binary by looking in ~/Library/Developer/Xcode/DerivedData/<your-app>/Build/Products/Release-<environment>/<your-app>.app/. You can look at the assets property in app.manifest to see which assets expo-updates expects to be embedded, and the expected file paths, and then look elsewhere in the binary to see which assets were actually embedded by the RN build scripts.

1 Like

Thanks a lot! You helped me a lot with direction to check. I found that app is waiting my fonts in path:
/assets/node_modules/@expo/vector-icons/build/vendor/react-native-vector-icons/Fonts

But i have them in my node_modules in source code but @expo/vector-icons are not bundled with my release app in node_modules.
Why it can skip bundling this fonts inside release? Maybe I should reinstall @expo/vector-icons because some bad linking happened? And what if i want to stay with react-native-vector-icons without @expo/vector-icons wrapper - it will be impossible because @expo/vector-icons is required sub-dependency to expo package?

@egorzotov - unfortunately it’s really hard to say what might be happening here. We have a better shot at being able to help you if you can provide a minimal, reproducible example that demonstrates the issue. I think it’s likely related to your custom metro config so I’d suggest starting there when narrowing down what the problem might be.

1 Like

Hi again! It was kinda interesting problem and i managed to narrow down the issue to rogue expokit dependency in our package.json from old times of ExpoKit flow. I assume that expo-updates working differently with assets in case of expokit installed or don’t even supposed to work at all. After i removed this dependency and builded release - everything started to work like in intended.
Thank you for showing me ways to check assets problem, I am sure it will help me in future :smiley:

Thanks a lot for sharing this content. I am looking for the same info you shared.

Indigo Card