openimsdk / open-im-sdk-ios

An OpenIM SDK in Objective-C for iOS
https://openim.io
MIT License
156 stars 142 forks source link

After introducing openIM, the app cannot be started in iOS12.0 #29

Closed zzyhappyzzy closed 1 year ago

zzyhappyzzy commented 1 year ago
image

想确认下openIMSDKCore(2.3.5+2)支持的最低iOS版本是iOS11还是iOS13,确认Podfile配置的最低版本是iOS11(platform :ios, '11.0'),实际测试下来在iOS11、iOS12系统无法启动app,出现错误如下: dyld: lazy symbol binding failed: Symbol not found: _objc_alloc_init Expected in: /Library/Developer/CoreSimulator/Profiles/Runtimes/iOS12.0.simruntime/Contents/Resources/RuntimeRoot/usr/lib/libobjc.A.dylib

如果不降低openIMSDK的版本号,除了将最低支持版本升级到iOS13,是否还有其它解决办法?

std-s commented 1 year ago

@zzyhappyzzy 从iOS13开始支持。

printlin commented 6 months ago

你好,你解决这个问题了吗?

zzyhappyzzy commented 6 months ago

@printlin 没有回退IM版本,被迫升级了app的最低适配版本为iOS 13.0。 之前稍微查找了下问题原因,应该是IM库从go编译时哪里配置没指定最低版本导致的。可以尝试从源码go通过修改make文件自己编译,项目时间问题后来放弃了。

printlin commented 6 months ago

Hello, I also found that the SDK does not support iOS 12 system, causing the app to crash every time it is opened. I noticed in the gomobile documentation that there is mention of the -iosversion option, which defaults to 13.0. After modifying it to 12.0 and recompiling, the app can run normally. Please note that this method is for reference only, and thorough testing is recommended. You can find information about gomobile at: https://pkg.go.dev/golang.org/x/mobile@v0.0.0-20240320162201-c76e57eead38/cmd/gomobile. You need to modify the compilation instructions for iOS in the openim-sdk-core/Makefile at line 221, adding -iosversion 12.0. After modification, it should look like this: GOARCH=arm64 gomobile bind -v -trimpath -iosversion 12.0 -ldflags "-s -w" -o build/OpenIMCore.xcframework -target=ios ./open_im_sdk/ ./open_im_sdk_callback/.

printlin commented 6 months ago

我在解决后才看到您的回复,真是可惜,我们的思路是一样的,感谢你

zzyhappyzzy commented 6 months ago

@printlin 非常感谢!