8

I'm getting this error

error: Invalid bitcode signature

clang: error: linker command failed with exit code 1 (use -v to see invocation)

I am using cocoapods and I have verified that all enable bitcodes match, I've tried all options Yes, No and ${inherited} for the enable bitcode field.

Not sure how to debug this further, how to I use the -v option / will that even give me more information.

Some back ground, I'm merging two code bases together iPhone and iPad so that it's a universal app.

1
  • 1
    I am experiencing the same situation. I am not using Cocoapods, each static/dynamic frameworks are built successfully, however the project fails to build the main app with this error. I have turn on/off bitcode, but it didn't change. However, this error only occurs on iPhones, not on the simulator. Commented Mar 31, 2018 at 11:00

10 Answers 10

6

In my project I fixed this by setting all "Bitcode enabled" options to "No". That includes all targets and all projects in the workspace (main project, Cocoa Pod project).

Sign up to request clarification or add additional context in comments.

Comments

5

error: Invalid bitcode signature clang: error: linker command failed with exit code 1 (use -v to see invocation)

Note: If you are building for the target phone 9 or 10 the following solution solves the issue

Solution

  1. Open Podfile
  2. Uncomment this line ~> platform :ios, '9.0'
  3. From the command line run the following command where Podfile resides
  4. pod update
  5. In the xcode select Product > clean and then Product > Build

Hope this solves the problem

2 Comments

By far the simplest and most relevant answer. I recently moved my target iOS down from 11 to 10 and hadn't updated my Podfile or updated. The above is accurate, save for the fact that instead of commenting out the platform line you can also just update it to the version you are targeting. Thank you @HA SHAH!!
@BK- I am glad it helped you. Best of luck !
3

This trick worked for me:

Select project file -> Select target -> General -> Linked Frameworks and Libraries -> Delete libPods.a

enter image description here

2 Comments

How did you figure out that this library was causing the problem?
@OdedHarth I followed Suresh.D's instruction, but I couldn't get the same error on the new project. So I was comparing the old project to the new project one by one, and found out the libPods.a is the only difference.
3

If you have a static library (ends with .a), It's possible that its bitcode settings is not agreeing to your workspace / project.

1 Comment

This pointed me in the right direction. In my case I had a static library that was missing the new arm64_32 architecture for watchOS. Thank you!
1

Using pod deintegrate and pod install again resolved my problem. It might be helpful to other who have this question.

Comments

0

I got the same error after doing a pod update - restarting Xcode did the trick for me.

Comments

0

Cleaning Derived data folder worked for me.

Comments

0

For me it helped to "update project to recommended settings" and clean, credits to Rocksaurus: https://stackoverflow.com/a/47336130/1884907

Comments

0

I was having this problem since adding Cocoapods (actually added to start using ResearchKit).

I had gone through and ensured bitcode enabled was set to NO, but thought it odd that the 'Pods' project (within the project workspace) didn't have a definition for 'Bitcode Enabled' under Build Settings. After lots of frustration, I tried adding the 'Bitcode Enabled' setting for the ResearchKit project (I just cut&pasted the key/values from my main app project for accuracy).

Hey presto! This got me past this error, and I just had to fix some arch related things and I was up and running again.

I guess if there isn't a Bitcode Enabled key/value defined, it defaults to YES.

Comments

-1

Maybe the issue because of a third party SDK integrated into your project using Cocoapods.

do the following:

  • Create a new Xcode project
  • Copy the Podfile from your original project to the newly created project's directory
  • Do pod install
  • Remove one or more of the pods⋆
  • Archive the new project, and see if it succeeds, if not repeat step 4 till you are able to archive.

    (you can also try something like binary search, wherein you delete the first half pods in your Podfile and see if the new project archives)

Once you've figured out the library causing the issue, keep downgrading the library by explicitly specifying the version in Podfile, until the project archives successfully.

Or if you don't mind disabling bitcode: Go to build settings search bitcode and change "Enable Bitcode" to "No".

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.