After developing most of my app with react-native on expo, I’ve been trying to build it to check if it works by itself, but when prebuilding I’m running into this particular issue:
<code>C:UsersspippolatorReactmyApp> npx expo prebuild
(node:25332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Created native directory | reusing /android
√ Updated package.json | no changes
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
at Object.resolve (node:path:171:9)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:11:45
at Array.map (<anonymous>)
at resolveFontPaths (C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:10:28)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildwithFontsAndroid.js:15:70
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:201:29)
at interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:105:27)
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:206:14)
at async interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js
<code>C:UsersspippolatorReactmyApp> npx expo prebuild
(node:25332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Created native directory | reusing /android
√ Updated package.json | no changes
× Prebuild failed
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
at Object.resolve (node:path:171:9)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:11:45
at Array.map (<anonymous>)
at resolveFontPaths (C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:10:28)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildwithFontsAndroid.js:15:70
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:201:29)
at interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:105:27)
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:206:14)
at async interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js
</code>
C:UsersspippolatorReactmyApp> npx expo prebuild
(node:25332) [DEP0040] DeprecationWarning: The `punycode` module is deprecated. Please use a userland alternative instead.
(Use `node --trace-deprecation ...` to show where the warning was created)
√ Created native directory | reusing /android
√ Updated package.json | no changes
× Prebuild failed
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
TypeError [ERR_INVALID_ARG_TYPE]: [android.dangerous]: withAndroidDangerousBaseMod: The "paths[1]" argument must be of type string. Received an instance of Object
at Object.resolve (node:path:171:9)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:11:45
at Array.map (<anonymous>)
at resolveFontPaths (C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildutils.js:10:28)
at C:UsersspippolatorReactmyAppnode_modulesexpo-fontpluginbuildwithFontsAndroid.js:15:70
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:201:29)
at interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:105:27)
at action (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js:206:14)
at async interceptingMod (C:UsersspippolatorReactmyAppnode_modules@expoconfig-pluginsbuildpluginswithMod.js
I think it’s probably related to how I manage fonts, but I’ve been looking at the documentation and I dont see the problem
But given that I’m new to this framework I’m sure I’m missing something
This is how I manage fonts:
<code> const [fontsLoaded] = useFonts({
'font1': require('./assets/fonts/firstfont.otf'),
'font2': require('./assets/fonts/secondfont.ttf'),
'font3': require('./assets/fonts/thirdfont.ttf'),
'font4': require('./assets/fonts/fourthfont.otf'),
'font5': require('./assets/fonts/fifthfont.ttf'),
<code> const [fontsLoaded] = useFonts({
'font1': require('./assets/fonts/firstfont.otf'),
'font2': require('./assets/fonts/secondfont.ttf'),
'font3': require('./assets/fonts/thirdfont.ttf'),
'font4': require('./assets/fonts/fourthfont.otf'),
'font5': require('./assets/fonts/fifthfont.ttf'),
});
</code>
const [fontsLoaded] = useFonts({
'font1': require('./assets/fonts/firstfont.otf'),
'font2': require('./assets/fonts/secondfont.ttf'),
'font3': require('./assets/fonts/thirdfont.ttf'),
'font4': require('./assets/fonts/fourthfont.otf'),
'font5': require('./assets/fonts/fifthfont.ttf'),
});
I then declared variables so that I can reference these fonts throughout the code more easily.
<code>const titleFont = 'font1';
const headerFont = 'font1';
<code>const titleFont = 'font1';
const headerFont = 'font1';
</code>
const titleFont = 'font1';
const headerFont = 'font1';
I tried also loading fonts by:
<code>import font1 from './assets/fonts/firstfont.otf';
import font2 from './assets/fonts/secondfont.ttf';
import font3 from './assets/fonts/thirdfont.ttf';
import font4 from './assets/fonts/fourthfont.otf';
import font5 from './assets/fonts/fifthfont.ttf';
const [fontsLoaded] = useFonts({
<code>import font1 from './assets/fonts/firstfont.otf';
import font2 from './assets/fonts/secondfont.ttf';
import font3 from './assets/fonts/thirdfont.ttf';
import font4 from './assets/fonts/fourthfont.otf';
import font5 from './assets/fonts/fifthfont.ttf';
//and later
const [fontsLoaded] = useFonts({
'font1': font1,
'font2': font2,
'font3': font3,
'font4': font4,
'font5': font5,
});
</code>
import font1 from './assets/fonts/firstfont.otf';
import font2 from './assets/fonts/secondfont.ttf';
import font3 from './assets/fonts/thirdfont.ttf';
import font4 from './assets/fonts/fourthfont.otf';
import font5 from './assets/fonts/fifthfont.ttf';
//and later
const [fontsLoaded] = useFonts({
'font1': font1,
'font2': font2,
'font3': font3,
'font4': font4,
'font5': font5,
});
but it doesn’t change at all
And this is my app.json:
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"image": "./assets/splash.png",
"backgroundColor": "#ffffff"
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
"package": "com.spippolator.myApp",
"font1": "'./assets/fonts/fifthfont.ttf'",
"font2": "./assets/fonts/secondfont.ttf",
"font3": "./assets/fonts/thirdfont.otf",
"font4": "./assets/fonts/fourthfont.ttf",
"font5": "./assets/fonts/fifthfont.ttf"
"favicon": "./assets/favicon.png"
"usesCleartextTraffic": true
"fonts": "./assets/fonts/larabiefont-free.rg-regular.otf"
"fonts": "./assets/fonts/SvBasicManual-nRPP.ttf"
"fonts": "./assets/fonts/hackerchaos.otf"
"fonts": "./assets/fonts/Hacked-KerX.ttf"
"fonts": "./assets/fonts/GlitchGoblin-2O87v.ttf"
"projectId": "987944a8-f07f-4599-857e-8734584802e4"
<code>{
"expo": {
"name": "myApp",
"slug": "myApp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.spippolator.myApp",
"fonts": {
"font1": "'./assets/fonts/fifthfont.ttf'",
"font2": "./assets/fonts/secondfont.ttf",
"font3": "./assets/fonts/thirdfont.otf",
"font4": "./assets/fonts/fourthfont.ttf",
"font5": "./assets/fonts/fifthfont.ttf"
}
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"expo-build-properties",
{
"android": {
"usesCleartextTraffic": true
}
}
],
[
"expo-font",
{
"fonts": [
{
"fonts": "./assets/fonts/larabiefont-free.rg-regular.otf"
},
{
"fonts": "./assets/fonts/SvBasicManual-nRPP.ttf"
},
{
"fonts": "./assets/fonts/hackerchaos.otf"
},
{
"fonts": "./assets/fonts/Hacked-KerX.ttf"
},
{
"fonts": "./assets/fonts/GlitchGoblin-2O87v.ttf"
}
]
}
]
],
"extra": {
"eas": {
"projectId": "987944a8-f07f-4599-857e-8734584802e4"
}
}
}
}
</code>
{
"expo": {
"name": "myApp",
"slug": "myApp",
"version": "1.0.0",
"orientation": "portrait",
"icon": "./assets/icon.png",
"userInterfaceStyle": "light",
"splash": {
"image": "./assets/splash.png",
"resizeMode": "contain",
"backgroundColor": "#ffffff"
},
"assetBundlePatterns": [
"**/*"
],
"ios": {
"supportsTablet": true
},
"android": {
"adaptiveIcon": {
"foregroundImage": "./assets/adaptive-icon.png",
"backgroundColor": "#ffffff"
},
"package": "com.spippolator.myApp",
"fonts": {
"font1": "'./assets/fonts/fifthfont.ttf'",
"font2": "./assets/fonts/secondfont.ttf",
"font3": "./assets/fonts/thirdfont.otf",
"font4": "./assets/fonts/fourthfont.ttf",
"font5": "./assets/fonts/fifthfont.ttf"
}
},
"web": {
"favicon": "./assets/favicon.png"
},
"plugins": [
[
"expo-build-properties",
{
"android": {
"usesCleartextTraffic": true
}
}
],
[
"expo-font",
{
"fonts": [
{
"fonts": "./assets/fonts/larabiefont-free.rg-regular.otf"
},
{
"fonts": "./assets/fonts/SvBasicManual-nRPP.ttf"
},
{
"fonts": "./assets/fonts/hackerchaos.otf"
},
{
"fonts": "./assets/fonts/Hacked-KerX.ttf"
},
{
"fonts": "./assets/fonts/GlitchGoblin-2O87v.ttf"
}
]
}
]
],
"extra": {
"eas": {
"projectId": "987944a8-f07f-4599-857e-8734584802e4"
}
}
}
}
When I start my build it also says as a warning that: ”
I’m having a really hard time figuring this out, can anyone help me?
Thank you!
Tried changing fonts path, how I declare fonts, updating expo and some other stuff.
Also tried modifying app.json
Tried building a whole new project, still doesn’t work.