简体   繁体   中英

native Could not find image './expo-asset/assets/${your_img_path}' not found in React Native / Expo

As my project is expo ejected react native project and I'm getting the error [native] Could not find image on path

'file:///var/mobile/Containers/Data/Application/..../Library/Application%20Support/.expo-internal/assets/...'

"react": "17.0.1", "react-native": "0.64.0", "expo": "~41.0.1", "expo-error-recovery": "^2.1.0", "expo-font": "~9.1.0", "expo-modules-core": "^0.2.0", "expo-splash-screen": "^0.10.3", "expo-status-bar": "~1.0.4", "expo-updates": "^0.5.5",

I have tried this solutions but not working any solution for my code

Firebase Cloud Messaging - Handling logout

Expo/React Native: Can't find image file after ejecting to bare workflow

Check this

1) When ejecting, expo is supposed to generate a metro.config.js file that looks like that:

module.exports = {
  transformer: {
      assetPlugins: ['expo-asset/tools/hashAssetFiles']
  }
};

2) Your metro.config.js file should have .js extensions not.ts

In my case after ejecting from expo I haven't changed this AppDelegate.m file

AppDelegate.M file line no 52 - 58

AppDelegate.M file line no 92 - 98

please, make these changes in project/ios/your_project_name/AppDelegate.m make sure to change line number 52 to 58 according to image 1. make sure to change line number 92 to 98 according to image 2.

This works fine for me. Hope you will find this helpful.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM