Skip to content

Troubleshooting

  • Check onError: it’s called with a message saying what went wrong, e.g. the HTTP status code.
  • A photo library url (ph://) on iOS and tvOS needs the app to have access to the photo library: see photo library images.
  • On Android, a require()d placeholder (or defaultSource) doesn’t show in debug builds: see placeholder.
  • If your Android app has its own Glide AppGlideModule, see Android build settings.
  • An image that changed on the server keeps showing the cached one until its url or cacheKey changes: see when an image changes.
  • With Expo, FastImage needs a development build: it isn’t in Expo Go.

After installing or updating FastImage, or when a build fails for no clear reason, try:

  • iOS: cd ios && pod install (pod install --repo-update if a pod’s version isn’t found), then Xcode’s Product › Clean Build Folder, or delete Xcode’s derived data (~/Library/Developer/Xcode/DerivedData).
  • Android: cd android && ./gradlew clean.
  • Expo: npx expo prebuild --clean, which makes the native projects again.
  • Metro’s cache: npx react-native start --reset-cache, or with Expo npx expo start --clear.
  • Watchman: watchman watch-del-all.
  • Dependencies: delete node_modules and install them again.

If pod install says it can’t find compatible versions for SDWebImage after updating FastImage (which needs 5.21.5 or later), update it: cd ios && pod update SDWebImage. If another pod pins an older SDWebImage, update that pod too.

FastImage includes AndroidSVG for SVG images as com.caverock:androidsvg-aar. If your app (or another library) has its other package, com.caverock:androidsvg, which has the same classes, the Android build fails with “Duplicate class com.caverock.androidsvg…”. Leave FastImage’s out in android/app/build.gradle; FastImage works with either package:

configurations.all {
exclude group: 'com.caverock', module: 'androidsvg-aar'
}