title: Image Share is not working all Google Pixel device
body: <p>I am sharing an image from my app using intent. It works fine on all devices but when it comes to Google Pixel 2 XL the image is not loading on skype and gmail. On Gmail, it says: could not attach file. Here is the code snippet</p>
  <pre><code> private fun shareImageFromURI(url: String?) {
      Glide.with(this)
          .asBitmap()
          .load(url)
          .into(object : CustomTarget&lt;Bitmap&gt;() {
              override fun onResourceReady(resource: Bitmap, transition: Transition&lt;in Bitmap&gt;?) {
                  val intent = Intent(Intent.ACTION_SEND)
                  intent.type = &quot;image/*&quot;
                  intent.putExtra(Intent.EXTRA_STREAM, getBitmapFromView(resource))
                  startActivity(Intent.createChooser(intent, &quot;Share Image&quot;))
              }
  
              override fun onLoadCleared(placeholder: Drawable?) {
  
              }
          })
  }
  
  fun getBitmapFromView(bmp: Bitmap?): Uri? {
      var bmpUri: Uri? = null
      try {
          val file = File(this.externalCacheDir, System.currentTimeMillis().toString() + &quot;.jpg&quot;)
  
          val out = FileOutputStream(file)
          bmp?.compress(Bitmap.CompressFormat.JPEG, 90, out)
          out.close()
          bmpUri = Uri.fromFile(file)
  
      } catch (e: IOException) {
          e.printStackTrace()
      }
      return bmpUri
  }
  </code></pre>