iTunes Connect : Invalid Bundle due to achitectures mismatch


        Hi Guys, this one is the problem that was not unclearly from iTunes Connect feedback mail, since i've check all dylib search path and fixed as i can, it's never resolve this issue. The real problem is Invalid Bundle is various and big field of issue, we must get diving into point by self, so mean we're tired again...

        My app was produced by Unity3d on MacOS High Sierra then it's had even release many version until we added new plugin OpenCV (actually is opencv2.framework). Without any error every step until we submit to TestFlight and so after a while when proceed finished, we've got this error.


And you've got an email from iTune Connect like top thread "Invalid Bundle ...". I've change method without submit to TestFlight, from Xcode i've archive file and try to export ipa file and BANG! this gonna be happen... to me.


"Failed to verify Bitcode in ..." but don't get the wrong point, the last line in the reason "i386" this is the desktop architectures, not iOS architectures.

Back to Unity3d, the opencv2.framework is included all architectures i386, x86_64, Armv7 and Arm64. For iOS we need only Armv7 and Arm64 but we still need i386 and x86_64 for development on desktop, i've decided to leave it included and do nothing.

The next solution is "how to remove desktop architectures from Xcode".
this incredible guy "Daniel Kennett" was explain all about that Here.

http://ikennd.ac/blog/2015/02/stripping-unwanted-architectures-from-dynamic-libraries-in-xcode/

You can read through out until understood what is it and what affective in your project before doing like that.

For me, i've simple use like this.
1. Goto project in Xcode "Build Phases" tab and scroll to bottom page.
2. Move section "Run Script" to the end of the page.
3. And check, section "Embed Frameworks" must be on top of section "Run Script".
4. Use script from "Daniel Kennett" put in the textfield first.
5. Leave original script this line "$PROJECT_DIR/MapFileParser.sh" and the end of "Run Script".


Then test by archive file again, and now i can get rid i386 and x86_64 from opencv2.framework completely.


Now i can submit TestFlight again without error "Invalid Bundle", hope this could be help you out too :)



Comments