Repository navigation
[v0.75.2] macOS (Catalyst) builds fail with hermes.framework: bundle format is ambiguous (could be app or framework) #46213
Description
Activity
- addedNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.
on Aug 26, 2024 ⚠️ Missing Reproducible Example ℹ️ We could not detect a reproducible example in your issue report. Please provide either: - If your bug is UI related: a Snack
- If your bug is build/update related: use our Reproducer Template. A reproducer needs to be in a GitHub repository under your username.
⚠️ Missing Reproducible Example ℹ️ We could not detect a reproducible example in your issue report. Please provide either: - If your bug is UI related: a Snack
- If your bug is build/update related: use our Reproducer Template
@sunshinezxq that looks likes an attempt to trick users into downloading a malware, I got it reported to GitHub :)
Reacted by Riccardo Cipolleschi- addedNeeds: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.and removed
on Aug 26, 2024 Thanks for reporting the user.
QQ: How do I repro it?
I create a new app and try to archive for macCatalyst?QQ: How do I repro it?
I create a new app and try to archive for macCatalyst?Yes, I just verified, a clean app created with
@react-native-community/cli, macCatalyst build fails exactly this same way for me.Reacted by zahid hussainYeah same thing is happening here
I just created a new app with 0.75.2 and I can't reproduce the issue for catalyst (See the screenshot).
We had a similar report back then, but I couldn't repro either.
Can you try run
pod deintegrateand try again. I'm afraid that cocoapods cached a wrong version of hermes in your system and tries to use that one to run macCatalyst for some reason.
28 remaining items
- added a commit that references this issue
on Sep 8, 2024 Sorry, my bad. This is the right link

Sorry, my bad. This is the right link
Even when using this new link I still get
ReactCommon/hermes/inspector-modern/chrome/Registration.h:15:10: 'hermes/hermes.h' file not found
@cipolleschi I'm not sure exactly what I should make of this, but it appears to almost work for react-native-macos.
I'm getting some undefined symbols, but perhaps react-native(-macos) 0.76 would be needed for it to work?

@gabrieldonadel did you unzip the zip-file first in order to get the tarball? Looks like it's failing pretty early.
Can you guys try with a nightly? I already applied the same changes to main, so yesterday nightly contains all the proper fixes. If you can safely build catalyst or MacOS using the Nightly, we should be good to go.
@hsjoberg yes, MacOS might have to catch up on the changes my colleagues made for the Debugger. The inspector_modern symbol you see there is the inspector for the new Debugger in the React Native Dev Tools
@hsjoberg yes, MacOS might have to catch up on the changes my colleagues made for the Debugger. The inspector_modern symbol you see there is the inspector for the new Debugger in the React Native Dev Tools
@cipolleschi Gotcha, yes that makes sense.
I think react-native-macos usually pulls in commits after there's a new release line for react-native core.Pinging @Saadnajmi so that you're aware of this issue.
I don't expect React Native macOS to hit the same issue, since it's technically a different platform. But yes, working on merging up to 0.76 right now..
Well, I'm currently seeing the same symptoms as OP on react-native-macos 0.75.
From what I can tell react-native-macos pulls in iOS Hermes, so I thought this was related to OPs issue:
https://github.com/microsoft/react-native-macos/blob/042cd6c36b23c21d20de628bc9756793e01ce282/packages/react-native/sdks/hermes-engine/hermes-utils.rb#L237-L257Reacted by Saad Najmi- removedNeeds: ReproThis issue could be improved with a clear list of steps to reproduce the issue.This issue could be improved with a clear list of steps to reproduce the issue.Needs: AttentionIssues where the author has responded to feedback.Issues where the author has responded to feedback.
on Sep 11, 2024 In my case I had to disable the prebuilts to get it working on Mac Catalyst.
ENV['RCT_USE_RN_DEP'] = '0' ENV['RCT_USE_PREBUILT_RNCORE'] = '0'
This issue seems to have come back when I upgraded to 0.83.1
I had to redo the same steps I previously commented to fix the framework for it to build for Mac Catalyst
cd ios/Pods/hermes-engine/destroot/Library/Frameworks/universal/hermesvm.xcframework/ios-arm64_x86_64-maccatalyst/hermesvm.framework rm -r hermesvm Resources ln -s Versions/Current/Resources Resources ln -s Versions/Current/hermesvm hermesvm cd Versions && rm -r Current && ln -s 0 Current # this is importantReacted by Dr. Sergey Pogodin and 高昇+1. For me macOS builds broke again after the upgrade from RN@0.82.1 to RN@0.83.0, and neither work with RN@0.83.1, but I had no capacity to report or investigate; thus thanks @robertying for your message 👏
The release build for Mac Catalyst (building x86_64 target on an ARM Mac) seems to be broken on 0.83.1 with Hermes 0.14 as well...
ld: warning: ignoring file '/Users/rying/Library/Developer/Xcode/DerivedData/learnX-bqofrgctsoxzlefwjjfqtyqdttvd/Build/Intermediates.noindex/ArchiveIntermediates/learnX/BuildProductsPath/Release-maccatalyst/XCFrameworkIntermediates/hermes-engine/Pre-built/hermesvm.framework/hermesvm': found architecture 'arm64', required architecture 'x86_64'Turns out the bundled
hermesvmfile doesn't contain x86_64 binary so it was built wrong in the first place:Non-fat file: ~/Downloads/hermes-ios-0.14.0-debug/destroot/Library/Frameworks/universal/hermesvm.xcframework/ios-arm64_x86_64-maccatalyst/hermesvm.framework/hermesvm is architecture: arm64
Description
Migrating my libraries / app from RN@0.74 to the latest RN@0.75.2. When building for macOS (Catalyst) target my build fails with that error
hermes.framework: bundle format is ambiguous (could be app or framework). I first posted the issue to the Hermes repo (facebook/hermes#1492), but I was told there, it must be an issue on RN side, how it packages stuff.Steps to reproduce
N/A
React Native Version
0.75.2
Affected Platforms
Build - MacOS
Output of
npx react-native infoStacktrace or Logs
Reproducer
N/A
Screenshots and Videos
No response