应用程序在Android 10上崩溃?

问题描述 投票:2回答:1

我的应用程序在Play商店上使用了2年,并且运行良好。但是在过去的两周内,突然有用户报告说应用程序在使用时崩溃了。

所有崩溃均适用于Android 10用户。

Fabric日志显示错误为,

java.lang.IllegalStateException: Only owner is able to interact with pending media content://media/external/images/media/259525
        at android.os.Parcel.createException(Parcel.java:2079)
        at android.os.Parcel.readException(Parcel.java:2039)
        at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:188)
        at android.database.DatabaseUtils.readExceptionWithFileNotFoundExceptionFromParcel(DatabaseUtils.java:151)
        at android.content.ContentProviderProxy.openTypedAssetFile(ContentProviderNative.java:705)
        at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1687)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1503)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1420)
        at android.graphics.ImageDecoder$ContentResolverSource.createImageDecoder(ImageDecoder.java:277)
        at android.graphics.ImageDecoder.decodeDrawableImpl(ImageDecoder.java:1743)
        at android.graphics.ImageDecoder.decodeDrawable(ImageDecoder.java:1736)
        at android.widget.ImageView.getDrawableFromUri(ImageView.java:1022)
        at android.widget.ImageView.resolveUri(ImageView.java:991)
        at android.widget.ImageView.setImageURI(ImageView.java:568)
        at androidx.appcompat.widget.AppCompatImageView.setImageURI(AppCompatImageView.java:116)
        at androidx.databinding.adapters.ImageViewBindingAdapter.setImageUri(ImageViewBindingAdapter.java:46)

此屏幕上发生的事情是,用户应该捕获屏幕快照。我保存此屏幕截图,并稍后在ImageView上显示。我通过URI检索了截屏图像。

当我使用URI检索图像时发生崩溃。

  1. App Compile SDK版本:28
  2. App Target SDK版本:28

我的应用程序在Play商店上使用了2年,并且运行良好。但是在过去的两周内,突然有用户报告说应用程序在使用时崩溃了。所有的崩溃都是针对...

android illegalstateexception
1个回答
0
投票

将文件提供程序用于图像URI。

© www.soinside.com 2019 - 2024. All rights reserved.