tesseract_ocr icon indicating copy to clipboard operation
tesseract_ocr copied to clipboard

Error: could not find module 'SwiftyTesseract' for target 'arm64-apple-ios-simulator';

Open MrFantuk opened this issue 3 years ago • 14 comments

Launching lib/main.dart on iPhone 11 in debug mode... lib/main.dart:1 Xcode build done. 3,1s Failed to build iOS app Error output from Xcode build: ↳ objc[14554]: Class AMSupportURLConnectionDelegate is implemented in both /usr/lib/libauthinstall.dylib (0x206e46b90) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x1068942c8). One of the two will be used. Which one is undefined. objc[14554]: Class AMSupportURLSession is implemented in both /usr/lib/libauthinstall.dylib (0x206e46be0) and /Library/Apple/System/Library/PrivateFrameworks/MobileDevice.framework/Versions/A/MobileDevice (0x106894318). One of the two will be used. Which one is undefined. ** BUILD FAILED ** Xcode's output: ↳ Command CompileSwiftSources failed with a nonzero exit code /Users/denis/Desktop/development/programms/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_tesseract_ocr-0.4.19/ios/Classes/SwiftFlutterTesseractOcrPlugin.swift:3:8: error: could not find module 'SwiftyTesseract' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator, x86_64, at: /Users/denis/Desktop/development/apps/nmo_helper/build/ios/Debug-iphonesimulator/SwiftyTesseract/SwiftyTesseract.framework/Modules/SwiftyTesseract.swiftmodule import SwiftyTesseract ^

Also removing from dev_dependencies: ... flutter_tesseract_ocr: projects works.

MrFantuk avatar Jan 27 '22 08:01 MrFantuk

I also have the same problem

renatorv avatar Jun 01 '22 14:06 renatorv

https://github.com/khjde1207/tesseract_ocr/issues/16 Can you please check if this method solves it?

khjde1207 avatar Jun 01 '22 14:06 khjde1207

Hi, I am still having this issue when attempting to run the example code mentioned in pub.dev. The issue link you mentioned issue doesn't help. Has anyone figured out the fix?

ammaarkhan avatar Apr 29 '23 06:04 ammaarkhan

I have this problem, i think its a matter of not having arm64 , ie M1, apple silicone, support in the ios library this uses. There should be a way to tell xcode not to try to make an arm64 version, but i am too newb to figure it out. The swiftytesseract library's last update was adding the arm64 support, so it is either bugged in there, or this flutter plugin is still using the version before that.

https://github.com/SwiftyTesseract/SwiftyTesseract/releases/tag/4.0.1

Edit: this is an xcode bug introduced sometime in version 12 when they prepped for m1 support. I was finally able to exclude arm64 from all simulators when it when I used the exclude setting on the podfile, not in the iOS project as a whole, as I tried for days.

gigafunk avatar May 15 '23 14:05 gigafunk

I also have the same problem, any one fixed? Swift Compiler Error (Xcode): Could not find module 'SwiftyTesseract' for target 'arm64-apple-ios-simulator'; found: x86_64-apple-ios-simulator,

Could not build the application for the simulator. Error launching application on iPhone 14 Pro.

tranquockhanh0506 avatar Nov 08 '23 16:11 tranquockhanh0506

Hey @tranquockhanh0506, I couldn't get it to work, ended up using this lib: https://github.com/naveenvignesh5/rn-ocr-lib. Hope it helps.

ammaarkhan avatar Nov 08 '23 16:11 ammaarkhan

the lib only support react-native right? @ammaarkhan

tranquockhanh0506 avatar Nov 09 '23 01:11 tranquockhanh0506

yeah.. I'm not sure I understand your question. Did you click on the link? @tranquockhanh0506

ammaarkhan avatar Nov 09 '23 04:11 ammaarkhan

l clicked, but the lib you suggest me only support react native, but l want flutter :(((( @ammaarkhan

tranquockhanh0506 avatar Nov 09 '23 04:11 tranquockhanh0506

Oh! So sorry! I thought this library was for react native! Our team was exploring flutter but we ended up switching to react native. Apologies! @tranquockhanh0506

ammaarkhan avatar Nov 09 '23 05:11 ammaarkhan

I don't know how to solve it either. If there is someone who is good at it, please help them.

khjde1207 avatar Nov 09 '23 12:11 khjde1207

@khjde1207 Have you solved it yet? :)))

tranquockhanh0506 avatar Nov 13 '23 03:11 tranquockhanh0506

Has anyone solved this yet? Still having the issue please

gideonoyekale avatar Dec 10 '23 20:12 gideonoyekale

I encountered the same problem and was able to bypass it by excluding the arm64 architecture in the build configurations. Locate the Podfile in your XCode project (if you don't have one, try running your Flutter project and see if that changes anything; it will likely be under the Pods icon on the left menu in your XCode project). Flutter has something akin to the following placed at the end of the file:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
  end
end

Change these lines in your Podfile to the following:

post_install do |installer|
  installer.pods_project.targets.each do |target|
    flutter_additional_ios_build_settings(target)
    target.build_configurations.each do |config|
      config.build_settings['EXCLUDED_ARCHS[sdk=iphonesimulator*]'] = 'arm64'
    end
  end
end

This should fix any errors that arise when using an iOS simulator with this library with M1 or M2 chips. Thanks.

satet-dev avatar Jan 06 '24 22:01 satet-dev