hermes: Asset validation failed, hermes contains bitcode. XCode 16

Bug Description

When trying to upload my app to AppStore using XCode 16, I get this error

Asset validation failed (90482)
Invalid Executable. The executable '***.app/Frameworks/hermes.framework/hermes' contains bitcode. (ID: 37fb02b5-0173-4c01-8d79-88a9cf6a33d8)

I’m already disable bitcode in the Build Settings

  • I have run gradle clean and confirmed this bug does not occur with JSC
  • The issue is reproducible with the latest version of React Native.

Hermes git revision (if applicable): React Native version: 0.72.4 OS: iOS Platform (most likely one of arm64-v8a, armeabi-v7a, x86, x86_64):

Steps To Reproduce

  1. Enable hermes with react native 0.72.4
  2. Upload the app to AppStore using XCode 16

code example:

The Expected Behavior

About this issue

  • Original URL
  • State: closed
  • Created 2 years ago
  • Reactions: 25
  • Comments: 31 (1 by maintainers)

Commits related to this issue

Most upvoted comments

Yeah same link worked for me, you can fix it by following these steps: fix

I was facing this same issue in RN version: “0.72.6”, and was able to resolve it by following this link.

After making the required changes, make sure to clean the project, derived data, install pods again and it should work.

I installed Xcode 15.4 alongside Xcode 16 and managed to build my app.

To do this, I downloaded Xcode 15.4 from https://xcodereleases.com/, unzipped the .xip file, renamed it to Xcode15_4, and moved it to the Applications folder. After launching Xcode15_4 and signing in with my account, I built and distributed the app without any issues.

Edit note: Xcode 15.4 does not run on MacOS 15

This solution helped me

this

react_native_post_install(
   installer,
   # Set `mac_catalyst_enabled` to `true` in order to apply patches
   # necessary for Mac Catalyst builds
   :mac_catalyst_enabled => false
 )
 __apply_Xcode_12_5_M1_post_install_workaround(installer)

replace with

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

Hi, IIRC, Apple changed their mind on bitcode and and went back and forth about it.

Unfortunately RN 0.72 is no longer supported, but if you upgrade to 0.73 or even better to 0.75, this should address your problem.

Build uploaded successfully but received this warning how to get rid of this image

I am getting this issue in XCode 16 but none of the answers help me to resolve that issue

Upload failed error: Asset validation failed Invalid Executable. The executable ‘’ contains bitcode. (ID: 2aa62af7-6fed-46e2-8405-4946368da620) error: Asset validation failed Invalid Executable. The executable ‘mc.app/Frameworks/FBSDKCoreKit.framework/FBSDKCoreKit’ contains bitcode. (ID: 1581a6ec-f5d5-4946-908d-18d778fee573) error: Asset validation failed Invalid Executable. The executable ‘mc.app/Frameworks/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics’ contains bitcode. (ID: e6505282-d042-44f2-9285-995859f32aea) error: Asset validation failed Invalid Executable. The executable ‘mc.app/Frameworks/FBSDKLoginKit.framework/FBSDKLoginKit’ contains bitcode. (ID: cb690141-2be7-422c-a6c5-2374a91bc335) error: Asset validation failed Invalid Executable. The executable ‘mc.app/Frameworks/FBSDKShareKit.framework/FBSDKShareKit’ contains bitcode. (ID: 727dc5e1-7bae-40dd-a17a-5f4d0eb4fa18)

I added the following code to the post-install section of the Podfile, and after creating a new archive, it worked fine for me.

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

I had the same issue, and here’s how I resolved it step by step:

  1. Check Hermes Paths
    The paths in the original code might not be correct for your setup. First, you need to find all the Hermes frameworks and their paths within your Pods directory. Run the following command to find all instances of Hermes:

    find Pods/hermes-engine -name hermes
    
  2. Update Podfile
    Once you have the correct paths, update the framework_paths array in your Podfile to include them. Here’s an example of how to do it:

    framework_paths = [
      # Replace these paths with the correct ones you found
      "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-simulator/hermes.framework/hermes"
    ]
    
  3. Strip Bitcode
    Ensure that your Podfile includes the bitcode stripping logic:

    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
    
  4. Clean and Build
    After updating the paths, clean your project folder, Then build your project again.

  5. Create the Build
    Finally, try creating the build again (e.g., using eas build or Xcode) and check the result.

The shell script handle_bitcode.sh from the link did the work in my RN 0.72.5 project and Xcode 16.2.

Solution from @Drzaln helped me on RN 0.72.4. I slightly modified it to find hermes files in whatever file structure is (in case using Bitrise and can have different paths)

post_install do |installer|
    # Strip bitcode from any hermes binaries found
    bitcode_strip_path = `xcrun --find bitcode_strip`.chomp
    def strip_bitcode_from_framework(bitcode_strip_path, framework_path)
      command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
      puts "🔧 Stripping bitcode: #{command}"
      system(command)
    end

    Dir.glob("Pods/hermes-engine/**/*.framework/hermes").each do |hermes_bin|
      puts "🔍 Found Hermes binary: #{hermes_bin}"
      strip_bitcode_from_framework(bitcode_strip_path, hermes_bin)
    end
  end

Thanks, it’s worked for me, this way completely solves the bitcode problem of hermes engine

Solution from @Drzaln helped me on RN 0.72.4. I slightly modified it to find hermes files in whatever file structure is (in case using Bitrise and can have different paths)

post_install do |installer|
    # Strip bitcode from any hermes binaries found
    bitcode_strip_path = `xcrun --find bitcode_strip`.chomp
    def strip_bitcode_from_framework(bitcode_strip_path, framework_path)
      command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
      puts "🔧 Stripping bitcode: #{command}"
      system(command)
    end

    Dir.glob("Pods/hermes-engine/**/*.framework/hermes").each do |hermes_bin|
      puts "🔍 Found Hermes binary: #{hermes_bin}"
      strip_bitcode_from_framework(bitcode_strip_path, hermes_bin)
    end
  end

How can i get the path to be added inside framework paths

@Karthik-V26 I’m using this because I use Xcode Cloud

project_root = File.expand_path('..', Dir.pwd)

  bitcode_strip_path = `xcrun --find bitcode_strip`.chop!
  def strip_bitcode_from_framework(bitcode_strip_path, framework_path)
    command = "#{bitcode_strip_path} #{framework_path} -r -o #{framework_path}"
    puts "Stripping bitcode: #{command}"
    system(command)
  end
  
  framework_paths = [
    "#{project_root}/Pods/hermes-engine/destroot/bin/hermes",
    "#{project_root}/Pods/hermes-engine/destroot/include/hermes",
    "#{project_root}/Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-simulator/hermes.framework/hermes",
    "#{project_root}/Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/Versions/0/hermes",
    "#{project_root}/Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes",
    "#{project_root}/Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64/hermes.framework/hermes",
    "#{project_root}/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/0/hermes",
    "#{project_root}/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/hermes",
    "#{project_root}/Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket",
    "#{project_root}/Pods/hermes-engine/destroot/Library/Frameworks/macosx/hermes.framework/Versions/Current/hermes",
  ]
  
  framework_paths.each do |framework_path|
    if File.exist?(framework_path)
      puts "Found file: #{framework_path}"
      strip_bitcode_from_framework(bitcode_strip_path, framework_path)
    else
      puts "Warning: File not found: #{framework_path}"
    end
  end

These were the libs which were causing the issues for us:

framework_paths = [
      "Pods/FBSDKCoreKit/XCFrameworks/FBSDKCoreKit.xcframework/ios-arm64/FBSDKCoreKit.framework/FBSDKCoreKit",
      "Pods/FBSDKShareKit/XCFrameworks/FBSDKShareKit.xcframework/ios-arm64/FBSDKShareKit.framework/FBSDKShareKit",
      "Pods/FBAEMKit/XCFrameworks/FBAEMKit.xcframework/ios-arm64/FBAEMKit.framework/FBAEMKit",
      "Pods/FBSDKCoreKit_Basics/XCFrameworks/FBSDKCoreKit_Basics.xcframework/ios-arm64/FBSDKCoreKit_Basics.framework/FBSDKCoreKit_Basics",
      "Pods/FBSDKGamingServicesKit/XCFrameworks/FBSDKGamingServicesKit.xcframework/ios-arm64/FBSDKGamingServicesKit.framework/FBSDKGamingServicesKit",
      "Pods/FBSDKLoginKit/XCFrameworks/FBSDKLoginKit.xcframework/ios-arm64/FBSDKLoginKit.framework/FBSDKLoginKit",
      "Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework/hermes",
      "Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket",
    ]

Might be helpful for someone else to see another few locations.