OpenFlutter / fluwx

Flutter版微信SDK.WeChat SDK for flutter.
Apache License 2.0
3.1k stars 505 forks source link

4.5.6 iOS端分享网络文件的时候,报错,无法拉起微信,整个应用直接卡死掉了;Andriod上分享正常 #647

Open zjypp opened 1 week ago

zjypp commented 1 week ago

版本:4.5.6上。 // 创建待分享的文件模型 WeChatFile weChatFile = WeChatFile.network(fileNetUrl); WeChatShareFileModel fileModel = WeChatShareFileModel(weChatFile, title:title, description: desc, scene: wxScene, );

try {
  Global.fluwx.share(fileModel);
}catch(e){
  print(e);
}

这个地方直接导致app卡死了。在Xcode上看到报错: Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull data]: unrecognized selector sent to instance 0x20a0fbd40' First throw call stack: (0x1a2850f20 0x19a6fb2b8 0x1a295a480 0x1a27edfb4 0x1a27ed8d0 0x103aef1e4 0x104d60b98 0x104d627bc 0x104d72d58 0x104d7290c 0x1a2823710 0x1a2820914 0x1a281fcd8 0x1e72751a8 0x1a4e5aae8 0x1a4f0ed98 0x1039e0ab0 0x1c5fff154) libc++abi: terminating due to uncaught exception of type NSException

在安卓手机上,没有问题,可以正常分享文件;

是iOS需要做什么配置吗?但是iOS上分享图片是正常的。

JarvanMo commented 1 week ago

分享图片和分享不是文件不是一个逻辑。iOS文件分享我也不是太了解

zjypp commented 1 week ago

哦。我想着图片和文件,都是网络图片和网络文件。iOS上分享图片正常,我想着和网络文件逻辑一样。 没想到app就卡死了。 谢谢

JarvanMo commented 1 week ago

看样子应该是取数据有问题,但是看不到具体代码行数,等我有时间看看能不能复现吧

LiWenHui96 commented 1 week ago

Xcode 16,iOS 18.0.1 系统拉起直接卡死

LiWenHui96 commented 1 week ago

Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[NSNull data]: unrecognized selector sent to instance 0x1feefb748' First throw call stack: (0x199f7d08c 0x19727f2e4 0x19a0837c8 0x199f1a888 0x199f1a1b0 0x107e822dc 0x1069a4a30 0x1069a671c 0x1069b6de8 0x1069b69a4 0x199f4ff64 0x199f4d188 0x199f4c5b8 0x1e59e21c4 0x19caa22c0 0x19cb50ddc 0x106fe3eec 0x1bf720d34) libc++abi: terminating due to uncaught exception of type NSException

zjypp commented 1 week ago

和我问题现象看起来一样

LiWenHui96 commented 1 week ago

我的问题现象看起来一样

是的,目前看起来是Xcode改了内容导致的,一会去微信开放社区看下吧

LiWenHui96 commented 1 week ago

https://developers.weixin.qq.com/community/develop/doc/00088eda7c44d8763222e25886d000?highLine=Xcode%252016%25E5%2588%2586%25E4%25BA%25AB 有解决方案了,一会在蹲下看看

JarvanMo commented 1 week ago

666了

LiWenHui96 commented 1 week ago

作者大大如果解决的话,可以适配下4.x版本吗

JarvanMo commented 1 week ago

作者大大如果解决的话,可以适配下4.x版本吗

fluwx 没有版本管理,所以适配不了。我现在安装不了xcode 16

LiWenHui96 commented 1 week ago

好吧,那目前也只能先降低至4.5.5版本去使用了

LiWenHui96 commented 1 week ago

4.5.54.5.6 的区别只是 #639,可这对拉起有啥影响吗?

LiWenHui96 commented 6 days ago

@zjypp 我已经升级到Flutter 3.24.3,fluwx 5.0.3,目前都是正常的

zjypp commented 4 days ago

我升级到flutter 3.24,fluwx是5.0.3.在分享图片的时候,app直接崩溃退出了: 分享的是本地图片。 这是图片读取的权限问题吗?之前的老版本没这样的现象吧?

信息如下:

java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/com.xxx.app/cache/fluwxSharedData/1729650781669lwqf.jpg E/AndroidRuntime(19968): at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:867) E/AndroidRuntime(19968): at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:467) E/AndroidRuntime(19968): at com.jarvan.fluwx.handlers.FluwxShareHandler$DefaultImpls.getFileContentUri(FluwxShareHandler.kt:310) E/AndroidRuntime(19968): at com.jarvan.fluwx.handlers.FluwxShareHandler$DefaultImpls.access$getFileContentUri(FluwxShareHandler.kt:45) E/AndroidRuntime(19968): at com.jarvan.fluwx.handlers.FluwxShareHandler$shareImage$1.invokeSuspend(FluwxShareHandler.kt:140) E/AndroidRuntime(19968): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/AndroidRuntime(19968): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) E/AndroidRuntime(19968): at android.os.Handler.handleCallback(Handler.java:942) E/AndroidRuntime(19968): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(19968): at android.os.Looper.loopOnce(Looper.java:240) E/AndroidRuntime(19968): at android.os.Looper.loop(Looper.java:351) E/AndroidRuntime(19968): at android.app.ActivityThread.main(ActivityThread.java:8370) E/AndroidRuntime(19968): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(19968): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:568) E/AndroidRuntime(19968): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013) E/AndroidRuntime(19968): Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@e8b33d7, Dispatchers.Main] E/CrashReport(19968): Java Crash Happen cause by main(2) I/CrashReport(19968): this class has handled this exception E/CrashReport(19968): current process die

JarvanMo commented 3 days ago

我升级到flutter 3.24,fluwx是5.0.3.在分享图片的时候,app直接崩溃退出了: 分享的是本地图片。 这是图片读取的权限问题吗?之前的老版本没这样的现象吧?

信息如下:

java.lang.IllegalArgumentException: Failed to find configured root that contains /storage/emulated/0/Android/data/com.xxx.app/cache/fluwxSharedData/1729650781669lwqf.jpg E/AndroidRuntime(19968): at androidx.core.content.FileProvider$SimplePathStrategy.getUriForFile(FileProvider.java:867) E/AndroidRuntime(19968): at androidx.core.content.FileProvider.getUriForFile(FileProvider.java:467) E/AndroidRuntime(19968): at com.jarvan.fluwx.handlers.FluwxShareHandler$DefaultImpls.getFileContentUri(FluwxShareHandler.kt:310) E/AndroidRuntime(19968): at com.jarvan.fluwx.handlers.FluwxShareHandler$DefaultImpls.access$getFileContentUri(FluwxShareHandler.kt:45) E/AndroidRuntime(19968): at com.jarvan.fluwx.handlers.FluwxShareHandler$shareImage$1.invokeSuspend(FluwxShareHandler.kt:140) E/AndroidRuntime(19968): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/AndroidRuntime(19968): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) E/AndroidRuntime(19968): at android.os.Handler.handleCallback(Handler.java:942) E/AndroidRuntime(19968): at android.os.Handler.dispatchMessage(Handler.java:99) E/AndroidRuntime(19968): at android.os.Looper.loopOnce(Looper.java:240) E/AndroidRuntime(19968): at android.os.Looper.loop(Looper.java:351) E/AndroidRuntime(19968): at android.app.ActivityThread.main(ActivityThread.java:8370) E/AndroidRuntime(19968): at java.lang.reflect.Method.invoke(Native Method) E/AndroidRuntime(19968): at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:568) E/AndroidRuntime(19968): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1013) E/AndroidRuntime(19968): Suppressed: kotlinx.coroutines.internal.DiagnosticCoroutineContextException: [StandaloneCoroutine{Cancelling}@e8b33d7, Dispatchers.Main] E/CrashReport(19968): Java Crash Happen cause by main(2) I/CrashReport(19968): this class has handled this exception E/CrashReport(19968): current process die

FileProvider 的问题,但是我有点看不出来因为什么

wahkim commented 2 days ago

有解决办法了吗? 我现在也换不起来微信也没有报错。

LiWenHui96 commented 2 days ago

有解决办法了吗? 我现在也换不起来微信也没有报错。

使用4.5.5