【发布时间】:2021-03-26 15:58:52
【问题描述】:
我的应用程序在 Play 商店上架了 2 年,并且运行良好。但在过去两周内,突然有用户报告应用程序在使用时崩溃。
所有崩溃均针对 Android 10 用户。
结构日志显示错误为,
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检索图像时发生崩溃。。
- App 编译 SDK 版本:28
- 应用目标 SDK 版本:28
【问题讨论】:
-
请出示您的代码。没有人知道你在做什么。当然,您不需要文件提供程序。
-
你好,你是怎么解决的?当我在
ContentResolver上调用openInputStream()时,我的应用程序崩溃了。 -
您的问题解决了吗。我有一个类似的问题。如果您解决了问题,请更新
标签: android illegalstateexception