Bitcode bundle could not be generated (while archiving) because Static Framework (.framework) was built without full bitcode
Asked Answered
B

2

14

We are trying to enable Bitcode fully in our Static Framework but we are receiving the following error while archiving the app when the framework is integrated with it though we are able to build it on the simulator or device.

ld: bitcode bundle could not be generated because '.framework/p-iOS(PTFWOperationPrepareTransaction.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build file '.framework/p-iOS' for architecture armv7

We have verified Bitcode state through otool -l Versions/A/p-iOS | grep __bitcode and seems like it is enabled correctly enter image description here.

Following are our project settings for bitcode on framework's end, enter image description here

And following are our project settings for bitcode on app's end, enter image description here

A humble request: Please review our settings in the above screenshots as we have already checked all the related queries on SO so please do not give them as a reference. enter image description here

Also, we have already tried Static Libraries, Frameworks, and Bitcode to get our things fixed.

Thanks in advance.

Benson answered 3/7, 2018 at 9:21 Comment(3)
Any update on this? @BensonPskov
Also struggling with this... Did you solved it? I have created another issue: #54082611Debate
any updates on this issue?Madge
L
11

I also had this problem with a framework I built. This is what worked for me:

  1. In Build Settings of the framework project set Other C Flags to -fembed-bitcode

  2. In the Build Settings of the framework target add a user defined flag called BITCODE_GENERATION_MODE with the value of bitcode

  3. Both in the framework project and target, Enable Bitcode should be set on Yes

Lingo answered 17/2, 2020 at 14:57 Comment(0)
I
0

This problem has been bothering me for a long time and like you I did everything I could and it still didn't work. Finally I found out it was a stupid configuration I made in Podfile:

target 'MySDK' do
  project 'Src/MySDK.xcodeproj'
end
target 'Demo' do
  project 'Demo/Demo.xcodeproj'

  pod 'MySDK', :path => $spec_path
end

Since my SDK doesn't have any dependencies, I added such a target to automatically add my SDK project to the workspace created by cocoapods.

As a result, even though this target doesn't have any dependencies, this action creates libPods-MySDK.a in my SDK and adds it in Build Phases - Link Binary With Libraries.

This causes the same problem as yours.

The solution is simple, delete the empty targets in the podfiles, delete the invalid Pods and Frameworks directories, and delete the pod-related config in Build Phases.

Impassable answered 25/10, 2021 at 10:6 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.