Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Asset validation failed, hermes contains bitcode. XCode 16 #1525

Closed
1 of 2 tasks
Drzaln opened this issue Sep 25, 2024 · 20 comments
Closed
1 of 2 tasks

Asset validation failed, hermes contains bitcode. XCode 16 #1525

Drzaln opened this issue Sep 25, 2024 · 20 comments
Labels
bug Something isn't working

Comments

@Drzaln
Copy link

Drzaln commented Sep 25, 2024

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

@Drzaln Drzaln added the bug Something isn't working label Sep 25, 2024
@tmikov
Copy link
Contributor

tmikov commented Sep 25, 2024

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.

@tmikov tmikov closed this as completed Sep 25, 2024
@davideluque
Copy link

davideluque commented Sep 26, 2024

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

@Shivangigupta01
Copy link

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.

@avnshproinfo
Copy link

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

@anilokcuoglu
Copy link

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.

This is the solution that worked for me.

@abid-mahmood-TS
Copy link

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

This was the life saviour, thanks @avnshproinfo

@ahmedfaraz587
Copy link

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)

@fonderkin
Copy link

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

@SiHyun-Lee113
Copy link

Please tell me how to find the framework path.

image

@anilokcuoglu
Copy link

anilokcuoglu commented Oct 2, 2024 via email

@musti-91
Copy link

musti-91 commented Oct 3, 2024

It will depends on the framework you're having.
I added for Shakebugs SDK also below in the pods
"Pods/LogRocket/LogRocket.xcframework/ios-arm64/LogRocket.framework/LogRocket", "Pods/Shake/Sources/Shake.xcframework/ios-arm64/Shake.framework/Shake", # <----- this line "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"

@Linuhusainnk
Copy link

Linuhusainnk commented Oct 5, 2024

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

@junocean
Copy link

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)

you can insert these into Podfile which mentioned, but change to

  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/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",
    ]

    framework_paths.each do |framework_relative_path|
      strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    end

@Linuhusainnk
Copy link

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)

you can insert these into Podfile which mentioned, but change to

  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/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",
    ]

    framework_paths.each do |framework_relative_path|
      strip_bitcode_from_framework(bitcode_strip_path, framework_relative_path)
    end

How to get these paths for the error, am having issues with OneSignal, JitsiMeet ....

@Parth8733
Copy link

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.

@junocean
Copy link

@Linuhusainnk You can open any code editor and navigate to your project’s root directory. From there, go to ios > Pods, where you'll find relevant folders. The folder names may differ slightly from the examples I provided. Once located, replace them as needed. Remember run pod install to take effect.

@LukePJN
Copy link

LukePJN commented Oct 17, 2024

I found specifying xCode 15.2 in my build scripts solved the issue for me

@xi-co
Copy link

xi-co commented Nov 6, 2024

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

Saved my week.

solved my updated Xcode Issue.

@josephattechjays
Copy link

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

@jigarsolanki0212
Copy link

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests