firebase_mlkit_language icon indicating copy to clipboard operation
firebase_mlkit_language copied to clipboard

Build failed for iOS

Open alexwestcott1 opened this issue 5 years ago • 9 comments

Although I've managed to implement the firebase_mlkit_language package for an Android application, I receive the following error when trying to run the application on iOS.

Launching lib/main.dart on iPhone 11 Pro Max in debug mode...
Running pod install...
Running Xcode build...
Xcode build done.                                            9.4s
Failed to build iOS app
Error output from Xcode build:
↳
    ** BUILD FAILED **


Xcode's output:
↳
    /Users/alexwestcott/dev/flutter/.pub-cache/hosted/pub.dartlang.org/firebase_mlkit_language-1.1.2/ios/Classes/ViewModels.m:9:39: error: no visible @interface for 'FIRModelManager' declares the selector 'availableTranslateModelsWithApp:'
          [[FIRModelManager modelManager] availableTranslateModelsWithApp:FIRApp.defaultApp];
           ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    1 error generated.

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

I've set up Firebase for the project, and it runs as expected for Android, but it's giving me this error on iOS. Any help would be appreciated!

alexwestcott1 avatar Oct 14 '19 11:10 alexwestcott1

Hi,

I'm getting the same issue and still no luck. While it's working fine on Android. I'm using the latest version (11.2.1)of Xcode.

Any help would be really appreciated!

Thank you

ankitch29 avatar Dec 09 '19 16:12 ankitch29

Hey, anyone found a solution to this yet?

zxcvbnmmohd avatar Dec 20 '19 14:12 zxcvbnmmohd

Hours later I figured out a solution. Basically open up your app and the example project they give you in XCode. in your app build it and when the errors come up (for me was 3) locate those files and then locate those same files in their example project. I've already solved it so I forgot which files exactly (was playing around with it and it happened to work). When you locate those files, in your project I just tapped on the function when pressed jump to definition, then find the same path in their example project and you'll see that there are those functions missing in your project. Simply copy the rest of the functions to your xcode files and it'll work.

zxcvbnmmohd avatar Dec 21 '19 13:12 zxcvbnmmohd

@zxcvbnmmohd For me still not working :(

ankitch29 avatar Dec 23 '19 16:12 ankitch29

Solved the problem for now in this commit. There were breaking changes in the Firebase upstream from iOS. A bit of a problem is that the latest version of Firebase is currently being used. Someone still needs to lock the version in podspec, but I'm a beginner with Objective C. I would be happy if someone would take over. Let me know if I should submit a PR, but the project looks unmaintained at the moment.

friebetill avatar Feb 03 '20 19:02 friebetill

Hi guys, How did you manage to make it work for android?. I get error:- java:3: error: package android.support.annotation does not exist. Opened an issue describing it. https://github.com/rishabnayak/firebase_mlkit_language/issues/38

kumudamulgund avatar Aug 12 '20 09:08 kumudamulgund

I'm also having this issue ... have set iOS target to 9 like required and doesn't work .. using version 1.1.3

Any news?

carman247 avatar Nov 11 '20 12:11 carman247

Hours later I figured out a solution. Basically open up your app and the example project they give you in XCode. in your app build it and when the errors come up (for me was 3) locate those files and then locate those same files in their example project. I've already solved it so I forgot which files exactly (was playing around with it and it happened to work). When you locate those files, in your project I just tapped on the function when pressed jump to definition, then find the same path in their example project and you'll see that there are those functions missing in your project. Simply copy the rest of the functions to your xcode files and it'll work.

What?!

carman247 avatar Nov 11 '20 12:11 carman247

any update !!!?

niypoo avatar Nov 25 '20 11:11 niypoo