-
Notifications
You must be signed in to change notification settings - Fork 70
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
iOS Simulator on Apple Silicon M1 #11
Comments
I’m encountering the same issue. I reviewed the iosbuild.sh script for libwebp, and it also doesn’t include separate builds for Apple Silicon simulators. From my understanding, it should be similar to Carthage, with one framework for iPhoneOS arm64 and another for x86_64 & arm64 for the simulator, then compiled into an XCFramework. I’m not very experienced with this, so I hope someone can handle it. As a temporary solution, I’m using x86_64 and arm64 .a files. Xcode shows many yellow warnings, but it doesn’t affect functionality. |
@EchoLunar I've updated the build script to output XCFramework. Please give a try. |
I’m really surprised and impressed that you managed to solve my issue so quickly! I’ve successfully compiled and run it on both the M2 simulator and the iPhone device. Thank you so much for your help! |
glad to hear that. |
@EchoLunar try the prebuilt xcframeworks. They are built by github actions with xcodebuild. |
I have tried, but the result remains the same. When I package and submit it to TestFlight, I receive the following error: “The X.app/Frameworks/libopencore-amrnb-iphoneos.a file is in the Frameworks directory, but the Swift runtime libraries are the only files permitted in that directory.” I noticed that the xcframework.sh script for libwebp does something similar, where it creates a fat_a and then packages it into an xcframework, I attempted to package the libwebp xcframework into the project for submission, but it still failed to pass validation. I checked the .app file, and it seems that all other libraries are packaged as frameworks, but libopencore-amrnb remains as a .a file, which seems to be disallowed. |
I have resolved this issue. I created an Objective-C Framework using Xcode and included the header and .a files (compiled twice using different .a files for each compile). I used ‘xcodebuild archive’ to compile the two Frameworks, and then combined them into an xcframework using ‘xcodebuild -create-xcframework’ I tested it on both real devices and simulators, and everything works fine. It has also been successfully uploaded to TestFlight. However, I completed these steps manually. If you are interested, you might consider further refining this project. |
Per Apple XCFramework documentation,it should be valid to pass .a with -lib to xcodebuild to create XCFrameworks. I will check this later or maybe just change the way creating XFramework,doing it by combine frameworks. |
I confirm the problem and the following solution: according to this, this type of library should have "Do not embed" in the frameworks list and required in Build Phases\Link Binary With Libraries. |
There is no build for iOS simulators running on Apple's new arm processors.
The text was updated successfully, but these errors were encountered: