mattermost / mattermost-mobile

Next generation iOS and Android apps for Mattermost in React Native
https://about.mattermost.com/
Apache License 2.0
2.26k stars 1.37k forks source link

M1 Mac building for iOS Simulator, but linking in dylib built for iOS, file '/Users/xxx/Desktop/Mattermost-mobile/node_modules/react-native-webrtc/ios/WebRTC.framework/WebRTC' for architecture arm64 #6909

Open lanwenjin opened 1 year ago

lanwenjin commented 1 year ago

Per Mattermost guidelines, GitHub issues are for bug reports: http://www.mattermost.org/filing-issues/.

For troubleshooting see: http://forum.mattermost.org/. For feature proposals see: http://www.mattermost.org/feature-requests/

If you've found a bug--something appears unintentional--please follow these steps:

  1. Confirm you’re filing a new issue. Search existing tickets in Jira to ensure that the ticket does not already exist.
  2. Confirm your issue does not involve security. Otherwise, please see our Responsible Disclosure Policy.
  3. File a new issue using the format below. Mattermost will confirm steps to reproduce and file in Jira, or ask for more details if there is trouble reproducing it. If there's already an existing bug in Jira, it will be linked back to the GitHub issue so you can track when it gets fixed.

Summary

Bug report in one concise sentence

Environment Information

Steps to reproduce

How can we reproduce the issue (what version are you using?)

Expected behavior

Describe your issue in detail

Observed behavior (that appears unintentional)

What did you see happen? Please include relevant error messages, screenshots and/or video recordings.

Possible fixes

If you can, link to the line of code that might be responsible for the problem

enahum commented 1 year ago

Probably some gems needed for cocoapods are failing

I think you need to make sure ffi is installed with your arch.

Something like arch -x86_64 gem install ffi then in the ios folder run pod install

lanwenjin commented 1 year ago

I tried a lot of things. It doesn't work. Only the Rosetta mode works.

Westacular commented 1 year ago

https://github.com/mattermost/react-native-webrtc is being built and vended as a .framework, not as an XCFramework, and hasn't been rebuilt since 2019 and hasn't been built with arm64 iOS Simulator support.

For pre-built dependencies to run natively on an arm64 Mac under the iOS simulator, they need to be built with the Simulator with the arm64 architecture as one of the targets, and to avoid clashing with arm64 symbols for native iOS devices, the result needs to be packaged as an XCFramework.