Firebase-ios-sdk: Zip builder binary framework generation does not support bitcode

Created on 27 Aug 2020  路  6Comments  路  Source: firebase/firebase-ios-sdk

  • Xcode version: 11.6
  • Firebase SDK version: 6.27.0

I use Carthage and would like to build FirebaseFirestoreSwift. As mentioned in #5287 I am trying to use ZipBuilder.
Everything works great but when I try to create an archive build I get an error to bitcode support. So my question is how to support bitcode, when I build a binary framework with Zip builder?

Here's the command I used:
swift run ReleasePackager -templateDir $(pwd)/Template -zipPods pods.json

And this is the zipPods files pods.json:

[
  {
    "name": "FirebaseFirestoreSwift"
  }
]

Here is the error message:

bitcode bundle could not be generated because '/Users/erno/Library/Developer/Xcode/DerivedData/HorseRider-cmwsijeipqkrmbdpxmmyvqjbivnh/Build/Intermediates.noindex/ArchiveIntermediates/HorseRiderRelease/BuildProductsPath/Release-iphoneos/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift(CodableErrors.o)' was built without full bitcode. All object files and libraries for bitcode must be generated from Xcode Archive or Install build file '/Users/erno/Library/Developer/Xcode/DerivedData/HorseRider-cmwsijeipqkrmbdpxmmyvqjbivnh/Build/Intermediates.noindex/ArchiveIntermediates/HorseRiderRelease/BuildProductsPath/Release-iphoneos/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift' for architecture arm64 
zip-builder

All 6 comments

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

@agergely Thanks for the report A few follow up questions:

What Xcode version was the xcframework built with? What Xcode version is the app built with?

Does bitcode show in the binary. From this stackoverflow post:

$ otool -l FirebaseFirestoreSwift.xcframework/ios-arm64_armv7/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift  | grep __LLVM | head
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
$ otool -l FirebaseFirestoreSwift.xcframework/ios-arm64_armv7/FirebaseFirestoreSwift.framework/FirebaseFirestoreSwift  | grep bitcode | head
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode

BTW, the build is faster with
swift run ReleasePackager -templateDir $(pwd)/Template -zipPods pods.json -buildDependencies NO

@paulb777 Thanks for your reply.

The framework and the app were built with the same version: XCode 11.6

Thanks for the suggestion. I've checked the tool and got the same result as you.

.../FirebaseFirestoreSwift | grep __LLVM | head
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM
   segname __LLVM

And

.../FirebaseFirestoreSwift | grep bitcode | head
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode
  sectname __bitcode

But I still cannot make a successful archive build. Do you have any idea?

@agergely Sorry about the inconvenience and thanks for the report.

I was able to reproduce the issue, track down a fix, and successfully archive an app with the rebuilt FirebaseFirestoreSwift.xcframework.

See #6366

@paulb777 Thank you so much, it sounds great!
I am excited about your MR and I'm waiting for it to try it out.

I've tested and It is working. Thank you so much again for the quick fix!

Was this page helpful?
0 / 5 - 0 ratings