weird ios libprotobuf.dylib cause crash

早过忘川 提交于 2019-12-03 21:11:15

Yes, ImageLoader on the newer devices (iPhone 5S and apparently iPad air) has its own copy of Protocol Buffers which causes symbol collisions.

I hacked around this by editing my google/protobuf/stubs/common.h and inserting the following line near the top of the file:

#define google myapp

Now, my copy of the Google protobuf implementation uses the namespace "myapp" instead of "google" and so the symbols don't collide with the system ones.

I am experiencing the same issue. Taking a queue from lincolnq I modified my protobuf build script to rename the ::google namespace to ::google_public in my build. This works around the issue with the Apple private build of protobuf.

I have published a script that creates a build of protobuf that will work. You can take a look here:

https://gist.github.com/BennettSmith/7150245

The script will produce a fat binary for the library that works with all architectures. It also builds the protoc compiler so you can run it as a custom build step to compile your .proto files.

Cheers

-- Bennett

I just ran into the problem today. I'm building with Symbols Hidden by Default set to YES (as well as the inline counterpart). After extensive examination with nm -g, this hides the exported Google protobuf symbols Apple seemed to be calling (which are different than the ones you got, but still in the same place; Image loading).

I'll update this answer after Apple approves us and I verify it works.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!