收藏
回答

Android11分享图片到朋友圈提示图片不存在,预览图也不展示

1、我们的App 目标版本是26

2、用户的手机系统是Android 11

3、图片分享使用的FileProvider方式进行

4、其他版本的手机如9、10系统的,

分享朋友圈时,微信重启闪退两次;

发送给朋友时,微信正常调起,点击分享直接微信闪退,崩溃信息如下:第一个是朋友圈异常,第二个是朋友

授权代码:
val contentUri = FileProvider.getUriForFile(context,
        "com.fanggeek.agent.fileprovider.CustomFileProvider",  // 要与`AndroidManifest.xml`里配置的`authorities`一致,假设你的应用包名为com.example.app
        file)

// 授权给微信访问路径
context.grantUriPermission("com.tencent.mm",  // 这里填微信包名
        contentUri, Intent.FLAG_GRANT_READ_URI_PERMISSION)
return contentUri.toString() // contentUri.toString() 即是以"content://"开头的用于共享的路径


Process: com.tencent.mm, PID: 28806
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.tencent.mm/com.tencent.mm.plugin.sns.ui.SnsUploadUI}: java.lang.SecurityException: Permission Denial: opening provider com.fanggeek.agent.fileprovider.CustomFileProvider from ProcessRecord{a8520e1 28806:com.tencent.mm/u129a198} (pid=28806, uid=12910198) that is not exported from UID 10514
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3894)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4077)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2458)
        at android.os.Handler.dispatchMessage(Handler.java:110)
        at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:8375)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
     Caused by: java.lang.SecurityException: Permission Denial: opening provider com.fanggeek.agent.fileprovider.CustomFileProvider from ProcessRecord{a8520e1 28806:com.tencent.mm/u129a198} (pid=28806, uid=12910198) that is not exported from UID 10514
        at android.os.Parcel.createException(Parcel.java:2071)
        at android.os.Parcel.readException(Parcel.java:2039)
        at android.os.Parcel.readException(Parcel.java:1987)
        at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:5092)
        at android.app.ActivityThread.acquireProvider(ActivityThread.java:7502)
        at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2939)
        at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:2155)
        at android.content.ContentResolver.openTypedAssetFileDescriptor(ContentResolver.java:1682)
        at android.content.ContentResolver.openAssetFileDescriptor(ContentResolver.java:1514)
        at android.content.ContentResolver.openInputStream(ContentResolver.java:1198)
        at com.tencent.mm.vfs.ContentsSchemeResolver$ContentProviderFileSystem.openRead(SourceFile:58)
        at com.tencent.mm.vfs.a.bgz(SourceFile:22)
        at com.tencent.mm.vfs.NativeFileSystem.e(SourceFile:500)
        at com.tencent.mm.vfs.NativeFileSystem.f(SourceFile:34)
        at com.tencent.mm.vfs.NativeFileSystem$c.d(SourceFile:404)
        at com.tencent.mm.vfs.a.c(SourceFile:79)
        at com.tencent.mm.vfs.q.ne(SourceFile:352)
        at com.tencent.mm.plugin.sns.ui.ap.az(SourceFile:206)
        at com.tencent.mm.plugin.sns.ui.SnsUploadUI.aC(SourceFile:1911)
        at com.tencent.mm.plugin.sns.ui.SnsUploadUI.onCreate(SourceFile:256)
        at android.app.Activity.performCreate(Activity.java:8121)
        at android.app.Activity.performCreate(Activity.java:8109)
        at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1320)
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3867)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:4077) 
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:91) 
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:149) 
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:103) 
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2458) 
        at android.os.Handler.dispatchMessage(Handler.java:110) 
        at android.os.Looper.loop(Looper.java:219) 
        at android.app.ActivityThread.main(ActivityThread.java:8375) 
        at java.lang.reflect.Method.invoke(Native Method) 
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513) 
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055


Process: com.tencent.mm, PID: 21312
    java.lang.SecurityException: Permission Denial: opening provider com.fanggeek.agent.fileprovider.CustomFileProvider from ProcessRecord{a693371 21312:com.tencent.mm/u129a198} (pid=21312, uid=12910198) that is not exported from UID 10514
        at android.os.Parcel.createException(Parcel.java:2071)
        at android.os.Parcel.readException(Parcel.java:2039)
        at android.os.Parcel.readException(Parcel.java:1987)
        at android.app.IActivityManager$Stub$Proxy.getContentProvider(IActivityManager.java:5092)
        at android.app.ActivityThread.acquireProvider(ActivityThread.java:7502)
        at android.app.ContextImpl$ApplicationContentResolver.acquireUnstableProvider(ContextImpl.java:2939)
        at android.content.ContentResolver.acquireUnstableProvider(ContentResolver.java:2155)
        at android.content.ContentResolver.query(ContentResolver.java:939)
        at android.content.ContentResolver.query(ContentResolver.java:891)
        at android.content.ContentResolver.query(ContentResolver.java:840)
        at com.tencent.mm.vfs.ContentsSchemeResolver$ContentProviderFileSystem.bgD(SourceFile:85)
        at com.tencent.mm.vfs.q.bgN(SourceFile:231)
        at com.tencent.mm.ui.transmit.SendAppMessageWrapperUI.a(SourceFile:962)
        at com.tencent.mm.ui.transmit.SendAppMessageWrapperUI.a(SourceFile:26788)
        at com.tencent.mm.ui.transmit.SendAppMessageWrapperUI$7.a(SourceFile:718)
        at com.tencent.mm.pluginsdk.ui.applet.o$10.onClick(SourceFile:513)
        at com.tencent.mm.ui.widget.a.d$4.onClick(SourceFile:697)
        at android.view.View.performClick(View.java:7281)
        at android.view.View.performClickInternal(View.java:7255)
        at android.view.View.access$3600(View.java:828)
        at android.view.View$PerformClick.run(View.java:27924)
        at android.os.Handler.handleCallback(Handler.java:900)
        at android.os.Handler.dispatchMessage(Handler.java:103)
        at android.os.Looper.loop(Looper.java:219)
        at android.app.ActivityThread.main(ActivityThread.java:8375)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:513)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1055)
     Caused by: android.os.RemoteException: Remote stack trace:
        at com.android.server.am.ActivityManagerService.getContentProviderImpl(libmapleservices.so:5651088)
        at com.android.server.am.ActivityManagerService.getContentProvider(libmapleservices.so:5668252)
        at android.app.IActivityManager$Stub.onTransact(libmapleframework.so:5488216)
        at com.android.server.am.ActivityManagerService.onTransact(libmapleservices.so:6774416)
        at com.android.server.am.HwActivityManagerService.onTransact(libmaplehwServices.so:1435196)
最后一次编辑于  2020-12-23
回答关注问题邀请回答
收藏

2 个回答

  • 杰克
    杰克
    2021-02-20

    分享至分身朋友圈有重启闪退问题,分享至分身好友图片发送后聊天列表并没有图片的问题

    2021-02-20
    有用
    回复
  • Cjiang
    Cjiang
    2020-12-23

    你好,是必现的吗?请提供下具体的机型,微信版本号,系统版本号。麻烦在手机微信那里上传下日志: 我->设置->帮助与反馈右上角有个上报日志的入口,麻烦提供一下微信号,时间点(具体到分钟)

    2020-12-23
    有用
    回复 4
    • Felix 、
      Felix 、
      2020-12-23
      机型:华为Mate 30 Pro 5G
      微信版本号:7.0.21
      系统:Android 10
      微信号:
      时间点:日志上传 2020-12-23 20:26-20:28
      崩溃发生时间点:20:25
      2020-12-23
      回复
    • Felix 、
      Felix 、
      2020-12-23
      微信号:wxid_t7I0uqq0kred22
      2020-12-23
      回复
    • Felix 、
      Felix 、
      2020-12-23
      是必现的问题
      2020-12-23
      回复
    • Felix 、
      Felix 、
      2020-12-25
      有结论么,线上部分用户都在反馈了
      2020-12-25
      回复
登录 后发表内容
问题标签