Problem uploading to app store

(jeremy) #1

I’m getting some errors when I try to upload my [working on sim/device directly] app, which has the dropbox framework. Any ideas?:

Package Summary:

1 package(s) were not uploaded because they had problems:
/var/folders/zf/c_52lkhd1qgd5xc8kk9wdv5m0000gn/T/387E74BA-9CDA-48E9-8461-3F0650C2A56C/1252240821.itmsp - Error Messages:
ERROR ITMS-90087: “Unsupported Architectures. The executable for Tower contains unsupported architectures ‘[x86_64, i386]’.”
ERROR ITMS-90209: “Invalid Segment Alignment. The app binary at ‘Tower’ does not have proper segment alignment. Try rebuilding the app with the latest Xcode version.”
ERROR ITMS-90125: “The binary is invalid. The encryption info in the LC_ENCRYPTION_INFO load command is either missing or invalid, or the binary is already encrypted. This binary does not seem to have been built with Apple’s linker.”

(marc hoffman) #2

sounds like your uploading a simulator build?

(jeremy) #3

Nope, definitely it is built for iOS Device+watch

(marc hoffman) #4

an yeah. i think the problem is that your framework contains simulator architectures as well. you need to strip those out.

(jeremy) #5

Ok, thanks I’ll have a look. Presumably I have to rebuild the framework with Xcode then do Fxgen on it again?

(marc hoffman) #6

You won’t need rot redo fxgen, just make sure the binary only has device slices. you might also be able to split and re-merge the exiting binary with the lipo command line tool.

(jeremy) #7

Ok, ta. I have no clue what that means but will investigate regardless :grin:

(marc hoffman) #8, “man lipo” ;).

The lipo command creates or operates on ``universal’’ (multi-architecture) files. It only ever produces one output file, and never alters the input file. The operations that lipo performs are: listing the architecture types in a universal file; creating a single universal file from one or more input files; thinning out a single universal file to one specified architecture type; and extracting, replacing, and/or removing architectures types from the input file to create a single new universal output file.

“and/or removing architectures types from the input file to create a single new universal output file.” is what you want, to drop the i386 and x86_64 slices from the framework binary.

(nasty, nasty habit, building libraries that mix iOS and Sim, and once Apple starts shipping ARM Macs, it’s gonna blow in everyone’s faces, this that hack :wink:

(jeremy) #9

Got the idea. I now have done it manually, but get

E: No matching CPU architecture "arm64" in reference "/Users/Jeremy/towervisit/TowerVisit/Carthage/Build/iOS/ObjectiveDropboxOfficial/iOS/ObjectiveDropboxOfficial/iOS/ObjectiveDropboxOfficial.fx"

Even though

lipo -info /Users/Jeremy/towervisit/TowerVisit/Carthage/Build/iOS/ObjectiveDropboxOfficial/iOS/ObjectiveDropboxOfficial/iOS/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial

Now gives me

Architectures in the fat file: /Users/Jeremy/towervisit/TowerVisit/Carthage/Build/iOS/ObjectiveDropboxOfficial/iOS/ObjectiveDropboxOfficial/iOS/ObjectiveDropboxOfficial.framework/ObjectiveDropboxOfficial are: armv7 arm64

Mmm, more to it as now the build also says that the namespace “ObjectiveDropboxOfficial” is unknown, where it’s used.

Is there a way in Fire we can run a script, as suggested (with the script to fix this issue in Xcode) here preferably only in the event it’s building the ipa file?

(marc hoffman) #10

Hmm, the build should only look at the .fx files, not at whats in the actual binary. stripping the binary should have no effect on what the compiler sees, at all. something else must have gone wrong.

not currently.

I suppose (regardless of. general post-build script feature) I could could do the lips stuff as part of the regular build, but it seems hacky — its really the input file thats already broken, and running this on the .framework prior to build should be the proper solution…

(marc hoffman) #11

Note that this, too, only refers to the .fx file. Somehow you now have a .fx that doesn’t doesn’t contain arm64 anymore.

(jeremy) #12

In case anyone else finds this, the final steps to get this on the app store were to copy to a new folder, do the lipo stuff and after making the merged one the new one, remove the other executables left in the framework that were used in merging (so the structure is identical to the original) and then re-import the framework into Fire, and all works. I just have to remove the project reference to the framework when I’m working on it with the simulator and add the original one in, then flip back when building for a release.