Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

xcode - invalid bitcode

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.

like image 700
Bill Avatar asked Apr 04 '17 18:04

Bill


People also ask

What is Bitcode in Xcode?

Bitcode is an Apple technology that enables you to recompile your app to reduce its size. The recompilation happens when you upload your app to App Store Connect or export it for Ad Hoc, Development, or Enterprise distribution. To learn more about bitcode, see Distribution Options.

Is Bitcode required iOS?

For iOS apps, bitcode is the default, but optional. If you provide bitcode, all apps and frameworks in the app bundle need to include bitcode. For watchOS and tvOS apps, bitcode is required. As per apple document bitcode is default but currently optional so your app will get approval until it is compulsory.

How do I disable Bitcode?

To disable Bitcode, go to the Build Settings tab of your workspace, scroll down to Build Options , and set Enable Bitcode to No.


3 Answers

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).

like image 120
Florian Avatar answered Oct 18 '22 03:10

Florian


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

like image 5
HA S Avatar answered Oct 18 '22 02:10

HA S


This trick worked for me:

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

enter image description here

like image 3
Sean Choe Avatar answered Oct 18 '22 02:10

Sean Choe