-
Notifications
You must be signed in to change notification settings - Fork 445
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] Can not work on iOS Simulator #1283
Comments
The fix is: Step 1. Run You have to build the lib for simulator by yourself. The lib in the package published to pub.dev is for iOS Phone only. The following is a screenshot after running the above script Note that there are libs for simulator arm64 and for simulator x86_64. You need to select the correct one by yourself. Step 2. Use the generated lib for simulator from step 1 to replace the one you downloaded from pub.dev For instance, find the Open Locate where In the above screenshot, you can find the directory for the package Now copy the |
@hantrungkien Does it work now? |
@csukuangfj Many thanks. I'm doing on other higher priority tasks for our release day. I will back to it on tonight or tomorrow and give you a feedback. Thanks again 🙏 |
@csukuangfj Sorry for late. I want to report about your way, it works. Many many thanks 🙏 |
Great to hear it fixes your issue! |
@csukuangfj Thanks for the solution, fixed the same issue for me as well. But I wonder if combining IOS and IOS-simulator into a single binary would be possible? Or is there another way to easily run on a simulator as well as a real device without having to change these libs every time one switches between IOS and simulator? |
yes, it is possible. The problem is that pub.dev forbids uploading packages more than 100MB If they were combined, it would be larger than 100MB. The main contribution to the file.size comes from onnxruntime |
Can you please share the method to combine them? |
One of the methods is to create a We currently don't have code for that, but it is feasible. You need to figure out how to do that by yourself. |
@csukuangfj Thanks for your suggestion, creating xcframework did the trick!
I copied Also replaced the following line @ |
@keyur2maru Thanks for your way but I got a error when building
Could you please help me? |
Would you mind posting complete logs? |
@csukuangfj sorry, let's ignore the above error for now. I'm having trouble distributing the app via Testflight. I don't know if it's really necessary to add them to pubspec.yaml?
|
please just delete them. You don't need them. |
@csukuangfj I was able to upload to testflight but it was rejected. Please help me |
@csukuangfj I tried like #1172 (comment) but still can not distribute via testflight. Please help me! |
sorry, the logs are not informative |
@csukuangfj After 1 day research, I found a reason is:
But I still don't found a solution... |
Please use the latest release v1.10.31 You don't need to change any code. |
I got a error when tap on the Generate button from the example:
[ERROR:flutter/runtime/dart_vm_initializer.cc(41)] Unhandled Exception: Invalid argument(s): Failed to load dynamic library 'libsherpa-onnx-c-api.dylib': dlopen(libsherpa-onnx-c-api.dylib, 0x0001): tried: '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRootlibsherpa-onnx-c-api.dylib' (no such file), '/Library/Developer/CoreSimulator/Volumes/iOS_21F79/Library/Developer/CoreSimulator/Profiles/Runtimes/iOS 17.5.simruntime/Contents/Resources/RuntimeRoot/usr/lib/swift/libsherpa-onnx-c-api.dylib' (no such file), '/usr/lib/swift/libsherpa-onnx-c-api.dylib' (no such file, not in dyld cache), '/Users/kienht/Library/Developer/CoreSimulator/Devices/5E910182-EC7E-48A6-99AC-E2FA3CBDF9D4/data/Containers/Bundle/Application/91543D27-FF1F-4554-B087-036C4127DDB2/Runner.app/Frameworks/libsherpa-onnx-c-api.dylib' (mach-o file (/Users/kienht/Library/Developer/CoreSimulator/Devices/5E910182-EC7E-48A6-99AC-E2FA3CBDF9D4/data/<…>
The text was updated successfully, but these errors were encountered: