Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to verify bitcode in Alamofire #835

Closed
Stormsabre opened this issue Oct 4, 2015 · 10 comments
Closed

Failed to verify bitcode in Alamofire #835

Stormsabre opened this issue Oct 4, 2015 · 10 comments
Assignees
Milestone

Comments

@Stormsabre
Copy link

I am getting this error and no idea why. I have tried with bitcode both on and off, and went down from v3.0 beta 3 to version 2 just to see if that would help. This only happened after i started use xcode 7. I already converted project to swift 2.0 as well, app works fine when i install it from xcode. I use carthage to build build the framework. Any help would be greatly appreciated, as i was supposed to pass along a build and i have been very delayed because of it. Here is the full error:

Failed to verify bitcode in Alamofire.framework/Alamofire:
error: Bundle only contains bitcode-marker /var/folders/r3/j_762c094837jhnv929gq1mw0000gn/T/XCodeDistPipeline.TvV/Root/Payload/my.app/Frameworks/Alamofire.framework/Alamofire (armv7)

bitcode stripping fails as well.

@cnoon
Copy link
Member

cnoon commented Oct 4, 2015

The carthage build works properly on 3.0.0-beta.3.

cnoon:~/Desktop/CarthageTester$ carthage update --platform iOS
*** Fetching Alamofire
*** Checking out Alamofire at "3.0.0-beta.3"
*** xcodebuild output can be found in /var/folders/s7/qpm0b2pn3d56rjlpl7g3_4fh0000gn/T/carthage-xcodebuild.eI0AZs.log
*** Building scheme "Alamofire iOS" in Alamofire.xcworkspace
cnoon:~/Desktop/CarthageTester$

Support questions like this are better suited for Stack Overflow. If you do end up finding an actual issue in the Alamofire project, please comment back on this issue and I'll be happy to re-open if necessary.

Best of luck!

@cnoon cnoon closed this as completed Oct 4, 2015
@cnoon cnoon self-assigned this Oct 4, 2015
@Stormsabre
Copy link
Author

I never said the issue was compiling, it was with creating an adhoc dstribution. I found this about the issue:

A framework with bitcode enabled requires the following flag to create and fill the bitcode section, -fembed-bitcode. However, this flag is available only in archive builds, not in normal builds where it's used the flag -fembed-bitcode-marker which creates a bitcode section but has a size of 1.

Carthage doesn't use archive action to build frameworks which means the resulting framework will contain a bitcode section but not properly filled as expected, leading to some issues in the submission of apps to TestFlight for example.

it is from thoughtbot/Argo#260

@Stormsabre
Copy link
Author

A user-defined-setting of "BITCODE_GENERATION_MODE" set to "bitcode" is what is needed in the framework project before it will be able to work from a carthage compilation.

@cnoon cnoon reopened this Oct 5, 2015
@cnoon
Copy link
Member

cnoon commented Oct 5, 2015

Thanks for adding more detail @Silver619. You original question simply did not have enough info to go on.

After digging in to understand what's going on, I tracked down Carthage #535 which contains quite a few details about the required change. It appears that bitcode support is compiled differently between normal builds and archived builds. To allow Carthage to work properly, I have added the BITCODE_GENERATION_MODE user defined setting with a value of bitcode to all three framework targets in f6e1967.

This should fix up the issue. If you could possibly test this @Silver619, I'd really appreciate it. Thanks again!

@cnoon cnoon closed this as completed Oct 5, 2015
@cnoon cnoon added this to the 3.0.0 milestone Oct 5, 2015
@Stormsabre
Copy link
Author

I have actually already tested it myself with a test project where i had manually added it into the checkout. I am manually adding it to all the other projects i have got downloaded from carthage and in the process of building it for my main project.

If i want to test your latest change with the test project how can i do that with carthage? Do i use "head" in the cartfile?

@cnoon
Copy link
Member

cnoon commented Oct 5, 2015

You would use:

github "Alamofire/Alamofire" "master"

@Stormsabre
Copy link
Author

It works now.

@dmcrodrigues
Copy link

@cnoon please note that you don't need to set BITCODE_GENERATION_MODE=bitcode to both release and debug configurations, only release configurations requires this for posterior submission. For debug configurations you can simply set BITCODE_GENERATION_MODE=marker.

@cnoon
Copy link
Member

cnoon commented Oct 5, 2015

Yeah that makes sense. Updated all frameworks in 4a213eb and 373293c.

@dmcrodrigues
Copy link

👍

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants