-
Notifications
You must be signed in to change notification settings - Fork 444
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
Flutter (Dart) apps fail Apple's submission validation, likely due to libsherpa dylib being present in root of Frameworks folder #1172
Comments
I will work on this issue and post an update tomorrow. I will also see if I can find and fix the issue in sherpa-onnx itself, if so, I'll open a PR of course. |
Thank you! |
Quick update, I've written a script that fixes this issue. Script expects 1 argument that points to the file path of the affected .xcarchive and fixes it. I haven't had time to look into the sherpa-onnx source itself, but I'm pretty confident that I can solve this here too. If I can't find and fix the issue in sherpa-onnx itself in the upcoming days, I'll share my script. That way, we can fix it together in sherpa-onnx. |
Update: I discovered an issue regarding missing symbols during runtime when I tested my test app from TestFlight. I'll post here once I've figured it out. Just adding this note for reference, it's related to the issue I am facing (the error message) and the observation I made (the .dylib in the Frameworks folder): Here are some more links with valuable info:
I'll need some more time to figure this out. Okay, 1 hour after I placed this comment and it's fixed. What a pain to work with Apple's confusing dev requirements but here's what I did in short:
I will review my own changes over the next days and will try to keep it to a mimimum. |
Hello, I followed your method, but encountered a problem. Can you share detail steps, like screenshots |
@BrutalCoding Hello, I found a problem that uploading to testFlight |
any update on this? i'm trying to build for iOS and encountering same error. bash build-ios-shared.sh
cd build-ios-shared/ios-arm64-simulator/
lipo -create libsherpa-onnx-c-api.dylib -output SherpaOnnx |
@BrutalCoding I did like #1283 (comment) but I got a error #1283 (comment) Do you have any solution for that? Many thanks! |
This is the complete solution for everyone having the same problem as me: Step 1. git clone https://github.com/k2-fsa/sherpa-onnx.git && \
cd sherpa-onnx && \
sh build-ios-shared.sh && \
cd build-ios-shared Step 2. mkdir ios-arm64_x86_64-simulator && \
lipo -create \
ios-arm64-simulator/libsherpa-onnx-c-api.dylib \
ios-x86_64-simulator/libsherpa-onnx-c-api.dylib \
-output ios-arm64_x86_64-simulator/libsherpa-onnx-c-api.dylib Step 3. cd ios-arm64 && \
mkdir libsherpa-onnx-c-api.framework && \
lipo -create libsherpa-onnx-c-api.dylib -output libsherpa-onnx-c-api && \
mv libsherpa-onnx-c-api libsherpa-onnx-c-api.framework/ && \
rm -rf libsherpa-onnx-c-api.dylib && \
cd libsherpa-onnx-c-api.framework && \
install_name_tool -change @rpath/libsherpa-onnx-c-api.dylib @rpath/libsherpa-onnx-c-api.framework/libsherpa-onnx-c-api libsherpa-onnx-c-api && \
install_name_tool -id "@rpath/libsherpa-onnx-c-api.framework/libsherpa-onnx-c-api" libsherpa-onnx-c-api && \
chmod +x libsherpa-onnx-c-api && \
cd .. && \
cd .. Step 4. cd ios-arm64_x86_64-simulator && \
mkdir libsherpa-onnx-c-api.framework && \
lipo -create libsherpa-onnx-c-api.dylib -output libsherpa-onnx-c-api && \
mv libsherpa-onnx-c-api libsherpa-onnx-c-api.framework/ && \
rm -rf libsherpa-onnx-c-api.dylib && \
cd libsherpa-onnx-c-api.framework && \
install_name_tool -change @rpath/libsherpa-onnx-c-api.dylib @rpath/libsherpa-onnx-c-api.framework/libsherpa-onnx-c-api libsherpa-onnx-c-api && \
install_name_tool -id "@rpath/libsherpa-onnx-c-api.framework/libsherpa-onnx-c-api" libsherpa-onnx-c-api && \
chmod +x libsherpa-onnx-c-api && \
cd .. && \
cd .. Step 5. Add
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
<key>BuildMachineOSBuild</key>
<string>{YOUR_MACHINE_BUILD}</string>
<key>CFBundleDevelopmentRegion</key>
<string>en</string>
<key>CFBundleExecutable</key>
<string>libsherpa-onnx-c-api</string>
<key>CFBundleIdentifier</key>
<string>{YOUR_BUNDLE_ID}</string>
<key>CFBundleInfoDictionaryVersion</key>
<string>6.0</string>
<key>CFBundleName</key>
<string>libsherpa-onnx-c-api</string>
<key>CFBundlePackageType</key>
<string>FMWK</string>
<key>CFBundleShortVersionString</key>
<string>1.0.0</string>
<key>CFBundleSupportedPlatforms</key>
<array>
<string>iPhoneOS</string>
</array>
<key>CFBundleVersion</key>
<string>1</string>
<key>MinimumOSVersion</key>
<string>{YOUR_MINIMUM_VERSION}</string>
</dict>
</plist> Step 7.
Step 8. Copy Step 9. Only get 2 packages from sherpa-onnx repository
Step 10. Modify
|
@hantrungkien @csukuangfj 有计划什么时候推送线上更新吗?手动改这个挺麻烦的,更新也不方便 |
@w-rui You can fork this repo and make your script follow as my guide to automatically build and publish your library. |
没计划。 因为,pub.dev限制每个包解压后,不超过100MB。我们没法把simulator相关的库也上传到pub.dev |
明白了,想要更新线上,只能将 framework 相关的大文件上传 cocopods,然后才能上传 pub。 |
不需要手动改了。目前最新版 v1.10.31 支持了. 不需要做任何代码改动。@w-rui |
@hantrungkien Thank you for sharing. We have integrated it into our latest release v1.10.31 You don't need to change any code now. |
@csukuangfj Many thanks and what is the commit that's related with v1.10.31? I ask because I don't find it. |
please see #1547 |
Does it work now? |
@csukuangfj sorry, I don't have time to upgrade to v1.10.31 yet. Maybe I will do that in next week... |
Heya,
First off, many thanks for working on bringing this package to Dart. I have been working with this package since several months ago in Flutter in my own way and today I tried to check out your official Dart version on pub.dev - it's great!
TTS, STT, VAD (the new v5) are all working perfect on my physical iPhone 12 Pro, so the features are not an issue here.
There is an issue though when deploying an app for App Store because sherpa-onnx bundles the dynamic library
libsherpa-onnx-c-api.dylib
in the root of the Frameworks directory and that gets automatically rejected by Apple when validating an app app for submission. It must be packaged as a framework. Note: This is an issue on at least iOS, as I haven't tried sherpa-onnx (Dart plugin) on macOS yet, but it's likely an issue there too.Misleading error message:
ITMS-90426: Invalid Swift Support - The SwiftSupport folder is missing. Rebuild your app using the current public (GM) version of Xcode and resubmit it.
(Doesn't help - already on latest version. See below for suspected real cause of error in this case).Here's what I've tried:
Failed submission of Runner.ipa with Transporter.app
flutter build ios
During the validation stage, Transporter will show this error:
Failed submission of Runner.xcarchive via XCode
Identified issues
The error message is misleading, since I am running the latest Xcode and I have submitted it in all possible ways. This led me to investigate the contents of the Runner.xcarchive to see how sherpa-onnx is shipped with the app, and I found an issue here:
We can not ship an app with a dylib thrown in the root of the Frameworks folder, instead, it must be packaged in it's own contained "framework" (just a folder structure with a couple files for metadata e.g. info.plist).
I'm sorry to not have the specific details at hand, I just wanted to highlight this issue before I'm fixing this. A quick work-around that I will try first is not fixing any source code, but by modifying the contents of the archive and re-attempting to upload the app for submission.
Better way would be to fix this in the source code of course. Some changes are likely required where you build with CMake against the C API, after producing the the shared library (the .dylib) we could add a few more lines to produce a xcframework folder and move the .dylib in there.
If there's anything unclear, ask away.
edit:
The text was updated successfully, but these errors were encountered: