Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct
Qt 5.2 Mac Appstore Would Reject QtWebkit - How to Fix it
This is my 3rd day working on this issue. This post serves the purpose of documenting what I tried, keep myself sane, and hopefully collaborate with someone.
For those that are using Qt5.2 rc1 QML/QuickControl/Webkit/etc and plan to submit to Mac app store, don't get your hopes up when you got through the hurdle of deploying QtQuick lib properly. Apple would reject QtWebkit on calling their private API.
The first one isn't bad. I changed bootstrap_look_up2 to bootstrap_look_up and brute force removed bootstrap_register2. This downside of this work around is you can use C++ webkit but not qml webkit. QML webkit is too slow anyway and deploying QtWebProcess is a pain. Confirm everything working.
This is the one that drives me up the wall. ICU is open source and heavily used by QtWebkit. www.icu-project.org/ However, Mac QtWebkit links with /usr/lib/libicucore.A.dylib which is meant to be private. The following is what I tried:
- Dispute with App Store review rep and even opened Tech support case that ICU is open source. No go. Not allowing the usage of private API is a hard rule that cannot be waved.
- Embed libicucore.A.dylib into bundle. Some app got into Appstore this way in 2012. I submitted it for review and was dancing my way when I found ... Aww $!@#, Maverick libicucore is not cross-compatible with 10.8 or older. At first it works, but as soon as WebKit do some form-based Op it would crash. 10.8 libicucore would crash on 10.9 and 10.9 libicucore would crash on 10.8.
- Tried to compile Apple open source ICU lib. Idea is compile my own to remove OS dependency. Well, the versioning is a mess and they don't compile.
- Change QtWebkit WTF (no kidding, that is what they call it) to link with regular open source ICU. Undefined reference of _u_charDirection, ... start flying out from libWTF. Found out WTF have its own hard copy of Apple specific ICU.
Again, compiling ... Crossing my fingers.
I am not familiar with building Qt libraries from source. Can someone tell me how to cleanly build QtWebkit each time?
What happen is after each try, the QtWebkit is tainted with previous headers/build config. Make clean actually break things even more. After cleanly checkout from git several time, now I just keep clean copy and clone them when needed.
Building from QtWebkit only also doesn't work. Seems like QtWebkit have dependency from the top make. So each time I need to start over and build from the top to build QtWebkit properly.
Is there a better way?
Kevins-MacBook-Pro-2:qt5 kevin0722$ otool -L qtbase/lib/QtWebKit.framework/Versions/5/QtWebKit
/usr/lib/libsqlite3.dylib (compatibility version 9.0.0, current version 9.6.0)
/System/Library/Frameworks/IOKit.framework/Versions/A/IOKit (compatibility version 1.0.0, current version 275.0.0)
libicui18n.52.dylib (compatibility version 52.0.0, current version 52.1.0)
libicuuc.52.dylib (compatibility version 52.0.0, current version 52.1.0)
../lib/libicudata.52.1.dylib (compatibility version 52.0.0, current version 52.1.0)
Hacked my app together and it works on dev machine. Seems promising.
Need to update my build automation, add install_name_tool to correct path, and test build on 10.8 and 10.9. I will report back later.