title: Bundled image in React Native not found on Android
body: <p>I'm building a React Native App for both ios and android. Assets (images, sounds, etc.) are all stored locally and preloaded during App's launch by a manager for later use.</p>
  
  <p>Everything works fine on ios in debug &amp; release modes and on android in debug mode but images won't display on android in release mode, even after bundling them.</p>
  
  <p>First assets are preloaded from the Asset Manager in <code>src/assets/index.js</code></p>
  
  <pre><code>import { Image } from 'react-native'
  
  const assets = {
      images: {
          'icon.png': require('./images/icon.png')
      }
  }
  
  const preloadedAssets = {}
  
  const getImage = (name, extension = 'png') =&gt; {
      return getAsset('images', `${name}.${extension}`)
  }
  
  const getAsset = (type, name) =&gt; {
      return preloadedAssets[type][name]
  }
  
  const preloadImages = () =&gt; {
      preloadedAssets.images = {}
  
      return Promise.all(
          Object.keys(assets.images).map(name =&gt; {
              const source = Image.resolveAssetSource(assets.images[name])
  
              return Image
                  .prefetch(source.uri)
                  .then(() =&gt; {
                      preloadedAssets.images[name] = {
                          source: assets.images[name],
                          ...source
                      }
                  })
          })
      )
  }
  
  const preload = () =&gt; {
      return preloadImages()
  }
  
  export default {
      preload,
      getImage
  }
  </code></pre>
  
  <p>Then images are rendered as follow</p>
  
  <pre><code>import AssetManager from '../assets'
  const asset = AssetManager.getImage('icon.png')
  &lt;Image source={asset.source} style={{ width: ..., height: ... }} /&gt;
  </code></pre>
  
  <p>I bundled with the following command</p>
  
  <pre><code>react-native bundle --platform android --dev false --entry-file index.js --bundle-output android/app/src/main/assets/index.android.bundle --assets-dest android/app/src/main/res/
  </code></pre>
  
  <p>I also tried to copy all assets to <code>android/app/src/main/assets/</code> folder and replace <code>require('./images/icon.png')</code> with <code>{ uri: 'file:///android_asset/images/icon.png' }</code> but images are still not displayed.</p>
  
  <p>Project structure</p>
  
  <p><img src="https://i.postimg.cc/VksHCNbc/Capture-d-e-cran-2019-04-05-a-15-55-05.png" alt="project"></p>