Skip to content

Fix swift compiler errors#19

Open
mityax wants to merge 2 commits intosalkuadrat:masterfrom
mityax:master
Open

Fix swift compiler errors#19
mityax wants to merge 2 commits intosalkuadrat:masterfrom
mityax:master

Conversation

@mityax
Copy link
Copy Markdown

@mityax mityax commented Jan 22, 2022

This fixes various issues the swift compiler complained about when I tried to build my app for iOS. Not sure whether this is due to a new swift version or something else, this was actually the first swift code I ever worked on at all.

Closes #18

@rainaakshay
Copy link
Copy Markdown

Can you please merge this request, I cannot build because it keeps saying No such module 'MLKit'

@seth35us
Copy link
Copy Markdown

seth35us commented Mar 28, 2022

@rainaakshay I didn't see that file name in the iOS classes and created it. However, when I try to compile now, I am getting the error: Swift Compiler Error (Xcode): No such module 'MLKitTranslate' in /learning-master/ios/Classes/SwiftLearningTranslatePlugin.swift:3:7

Did you see this error at all?

@rainaakshay
Copy link
Copy Markdown

@seth35us No I didn’t try manually changing the file as it will be overwritten on flutter pub get anyways. @salkuadrat merging this pull request will probably solve all these issues.

@mityax
Copy link
Copy Markdown
Author

mityax commented Mar 29, 2022

@rainaakshay @seth35us yes it does. I'm using the plugin successfully now on iOS and Android.

I'm not sure how actively maintained this is though, the author's last actvitiy was on 23rd Nov. If you need it to work fast, you can just use my fork directly in your pubspec.yaml, until this is merged:

  learning_translate:
    git:
      url: https://github.com/mityax/learning_translate.git

@seth35us
Copy link
Copy Markdown

seth35us commented Mar 29, 2022

@mityax Great news that you got it working. I just read your message, so will try it out first thing tomorrow morning. Very much appreciated.

@rainaakshay
Copy link
Copy Markdown

@mityax Can I use your fork for entity extraction as well?

@mityax
Copy link
Copy Markdown
Author

mityax commented Mar 29, 2022

@rainaakshay It wouldn't make a difference, I haven't changed anything there.

@seth35us
Copy link
Copy Markdown

seth35us commented Mar 29, 2022

@mityax After commenting everything except translation and object detection, I got the app to run with your code. However, I am getting a missing channel error when trying to do any object detection. Similar issues are #4 and #3. Is the object detection working for you on iOS, or is it not implemented?

The only other package I found to do object detection is tflite and it wouldn't compile for me on iOS.

@rainaakshay
Copy link
Copy Markdown

@mityax Did you get any error like this after your changes?

Undefined symbols for architecture x86_64:
      "_OBJC_CLASS_$_MLKEntityAnnotation", referenced from:
          objc-class-ref in SwiftLearningEntityExtractionPlugin.o
      "_OBJC_CLASS_$_MLKModelDownloadConditions", referenced from:
          objc-class-ref in SwiftLearningEntityExtractionPlugin.o
      "_OBJC_CLASS_$_MLKEntityExtractionParams", referenced from:
          objc-class-ref in SwiftLearningEntityExtractionPlugin.o
      "_OBJC_CLASS_$_MLKEntityExtractor", referenced from:
          objc-class-ref in SwiftLearningEntityExtractionPlugin.o
      "_OBJC_CLASS_$_MLKEntityExtractionRemoteModel", referenced from:
          objc-class-ref in SwiftLearningEntityExtractionPlugin.o
      "_OBJC_CLASS_$_MLKModelManager", referenced from:
          objc-class-ref in SwiftLearningEntityExtractionPlugin.o
      "_OBJC_CLASS_$_MLKEntityExtractorOptions", referenced from:
          objc-class-ref in SwiftLearningEntityExtractionPlugin.o

I made the changes in SwiftLearningEntityExtractionPlugin.swift just like you did in SwiftLearningTranslatePlugin.swift, but mine keeps throwing this error

@mityax
Copy link
Copy Markdown
Author

mityax commented Mar 29, 2022

@rainaakshay No, I haven't encountered anything like that. I can't help you, I'm afraid

@mityax
Copy link
Copy Markdown
Author

mityax commented Mar 29, 2022

@seth35us I have only used language identification and translation - no idea about the others

@fbernaly
Copy link
Copy Markdown

I noticed that most of the APIs in this plugin are only implemented for Android, and some for iOS, this other plugin works for me: google_ml_kit and has the same functionalities.

@rainaakshay
Copy link
Copy Markdown

@fbernaly This plugin was meant as a substitute for the official google ml kit that you mentioned, since at that time google_ml_kit was missing a lot of ios implementations like entity extraction and text recognition v2. Which were supported in this plugin, it was just not maintained.

@fbernaly
Copy link
Copy Markdown

Great, it is supported now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

iOS build failure: No such module 'MLKit'

4 participants