Open DmitryDNKK opened 1 year ago
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.
Hey~ I apologize. I did manage to compile successfully on both the simulator and the real device, but when I tried to upload the package, Apple rejected it. It was then that I realized the xcframework contains a .a file, while typically, an xcframework should contain something like what’s shown in the picture.
Asset validation failed (90432) Unexpected file found in Frameworks. The “XXX.app/Frameworks/libopencore-amrnb.a” file is in the Frameworks directory, but the Swift runtime libraries are the only files permitted in that directory.
@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.
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.
There is no build for iOS simulators running on Apple's new arm processors.