Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

asset validation failed invalid executable. the executable 'myapp.app/frameworks/cardio.framework/cardio' contains bitcode

I encountered this problem after updating to macOS 15 Sequoia and the latest version of Xcode 16. I'm getting this error when trying to publish the build from Xcode.

Does anyone know the solution?

like image 955
Pankaj Avatar asked Aug 30 '25 17:08

Pankaj


2 Answers

I was getting the same issue after upgraded to Xcode 16 and iOS 18.

You can solve this issue by following this.

  1. Open Podfile

  2. Search for word post_install

  3. If post_install not found then just directly paste the below code just before the last end keyword

     post_install do |installer|
    
     bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
       def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
         framework_path = File.join(Dir.pwd, framework_relative_path)
         command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
         puts "Stripping bitcode: #{command}"
         system(command)
       end
    
       framework_paths = [
         "Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket",
         "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/hermes",
         "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/Current/hermes",
         "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64/hermes.framework/hermes",
         "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes"
       ]
    
       framework_paths.each do |framework_relative_path|
         strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
       end
    
  4. In case you have already post_install has been used then copy and past the below script inside that.

       bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
       def strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
         framework_path = File.join(Dir.pwd, framework_relative_path)
         command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
         puts "Stripping bitcode: #{command}"
         system(command)
       end
    
       framework_paths = [
         "Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket",
         "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/hermes",
         "Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/Current/hermes",
         "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64/hermes.framework/hermes",
         "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes"
       ]
    
       framework_paths.each do |framework_relative_path|
         strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
       end
    
  5. Do pod install

  6. Run build now :)

like image 127
Avtar Singh Avatar answered Sep 02 '25 06:09

Avtar Singh


What is bitcode?

Bitcode is an intermediate representation of an app’s compiled code that allows Apple to optimize app performance and compatibility.

With Xcode 16, Apple has deprecated bitcode for all platforms, meaning that builds with bitcode enabled are no longer accepted.

Execute this command in Pods folder of your project:

xcrun bitcode_strip -r YOUR_PATH/USED_FRAMEWORK -o YOUR_PATH/USED_FRAMEWORK

Notes:

  • Replace YOUR_PATH with your own used framework directory path.
  • Replace USED_FRAMEWORK with your own used framework name.

Example:

xcrun bitcode_strip -r Pods/FBSDKLoginKit/XCFrameworks/FBSDKLoginKit.xcframework/ios-arm64/FBSDKLoginKit.framework/FBSDKLoginKit -o Pods/FBSDKLoginKit/XCFrameworks/FBSDKLoginKit.xcframework/ios-arm64/FBSDKLoginKit.framework/FBSDKLoginKit

Repeat this command for your all used frameworks which are reported as "contains bitcode" in the errors/logs panel when you’re uploading app to AppStore.

like image 27
Reza Roshan Avatar answered Sep 02 '25 06:09

Reza Roshan