-
Notifications
You must be signed in to change notification settings - Fork 24.4k
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
[v0.75.2] macOS (Catalyst) builds fail with hermes.framework: bundle format is ambiguous (could be app or framework)
#46213
Comments
|
|
@sunshinezxq that looks likes an attempt to trick users into downloading a malware, I got it reported to GitHub :) |
Thanks for reporting the user. QQ: How do I repro it? |
Yes, I just verified, a clean app created with |
Yeah 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 |
I tried to remove all caches I may think of — all installed / generated files in the clean app template, entire Have you tested it with the new architecture build? May it be caused by me still having an old Intel-based mac mini, rather than latest Apple Silicon one? |
@cipolleschi Here is the detailed error I get: Anything else I can check? |
Interestingly it might be a symlink issue: https://stackoverflow.com/questions/25969946/osx-10-9-5-code-signing-v2-signing-a-framework-with-bundle-format-is-ambiguou |
well, the Anatomy of Framework Bundle, referenced in the StackOverflow thread you referred to, says that Resources folder on top level of a proper framework bundle should be a symlink, and Versions should be the only real directory... that's not what I end up with - in my case Resources is just a regular folder with Info.plist file inside it. Not sure, if/how I can manually force it to be a symlink, to double-check it is the problem, though. |
The only difference I see is that |
I am trying it all with Debug build.
|
I guess, that stripping step does not take place if you target new Apple Silicon hardware? Btw, although the build fails, it turns out the app bundle it creates before the failure, runs seemingly fine 0.o |
Wut! if that's the case, it feels like an Xcode issue more than a RN one. Do you have any chance to test on a Silicon machine? |
Not yet; but I guess if I am starting to run into such problems, it is a high time to get myself a new Apple machine, which I'll probably do :) |
The same error happens on my Apple Silicon mac as well, both for debug and archive. |
Something definitely has changed from 0.74 to 0.75. These are the different hermes.tar.gz file structures after unzipping:
|
Ok I think the symlinks are broken in the 0.75 hermes build. To fix the symlinks, go to your project root and run: cd ios/Pods/hermes-engine/destroot/Library/Frameworks/universal/hermes.xcframework/ios-arm64_x86_64-maccatalyst/hermes.framework
rm -r hermes Resources
ln -s Versions/Current/Resources Resources
ln -s Versions/Current/hermes hermes
cd Versions && rm -r Current && ln -s 0 Current # this is important Verify hermes.framework looks like this:
@cipolleschi does RN do the packaging for hermes or is this indeed a hermes issue (that we should forward back to the hermes repo)? |
@robertying I believe OP was referred to the react-native github project by Hermes devs due to them not doing the packaging (facebook/hermes#1492). FWIW, I'm seeing the same symptoms, but for react-native-macos. I'll try the symlink fixes soon. |
@robertying Thanks for your investigation. That helps a lot. React Native is responsible to package and distribute Hermes, so that's actually a React Native issue. What we changes w.r.t. 0.74 is that we had to move the whole build and release pipeline from CircleCI to GitHub Actions. I'll try to double check and do some extra checks today, but with React Universe coming up I'm not sure whether a fix will arrive soon. It might have to wait for a week or so. Meanwhile, I'll reopen the issue. |
Thanks @cipolleschi! Thankfully we have a workaround so it's not too urgent I guess. |
For (my) future references, Nightlies has the same issue. 🤔
|
Looking in the I guess we have to add a custom step to revert those changes before creating the archive. @hsjoberg that's expected, as the |
#46301 this seems to fix the issue. It is not done yet, I only verified that there are symlinks in the generated artifacts. |
Hello there! I think I fixed the issue in the above PR. You can download the hermes tarball from this link And then you can install pods using this command:
and try to build again. |
Hi @cipolleschi, not sure if we can use this link directly But after pointing it to a local path I got |
nono, you have to download the tarball locally first! 😄 |
Thank you for looking into this issue @cipolleschi. 🙏
Hermes Pod folder becomes empty after running
EDIT: I'm checking if I can find the correct file in https://github.com/facebook/react-native/actions/runs/10671527175/ EDIT2: I found this job with this artifact: https://github.com/facebook/react-native/actions/runs/10671527175/artifacts/1883232802 (slice-catalyst-Release.zip). Unfortunately I'm seeing the same error with that one, and the symlinks broken. Which job is the one I should try? |
Sorry, my bad. This is the right link |
Even when using this new link I still get |
@cipolleschi I'm not sure exactly what I should make of this, but it appears to almost work for react-native-macos. @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 |
@cipolleschi Gotcha, yes that makes sense. 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: |
Description
Migrating my libraries / app from [email protected] to the latest [email protected]. 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 info
Stacktrace or Logs
Reproducer
N/A
Screenshots and Videos
No response
The text was updated successfully, but these errors were encountered: