bendyworks / cap-ml

Text Detection Capacitor Plugin
Other
16 stars 16 forks source link

Plugin failing to initialize with default firebase error at TextDetector.detectText #15

Open bot101 opened 4 years ago

bot101 commented 4 years ago

Android Studio Logcat error message:

E/Capacitor/Plugin: Default FirebaseApp is not initialized in this process io.ionic.starter. Make sure to call FirebaseApp.initializeApp(Context) first. java.lang.IllegalStateException: Default FirebaseApp is not initialized in this process io.ionic.starter. Make sure to call FirebaseApp.initializeApp(Context) first. at com.google.firebase.FirebaseApp.getInstance(com.google.firebase:firebase-common@@19.3.0:184) at com.google.firebase.ml.vision.FirebaseVision.getInstance(com.google.firebase:firebase-ml-vision@@24.0.1:1) at com.bendyworks.capML.TextDetector.detectText(TextDetector.kt:23) at com.bendyworks.capML.CapML.detectText(CapML.java:47) at java.lang.reflect.Method.invoke(Native Method) at com.getcapacitor.PluginHandle.invoke(PluginHandle.java:99) at com.getcapacitor.Bridge$1.run(Bridge.java:521) at android.os.Handler.handleCallback(Handler.java:938) at android.os.Handler.dispatchMessage(Handler.java:99) at android.os.Looper.loop(Looper.java:223) at android.os.HandlerThread.run(HandlerThread.java:67)

CapML version is ^1.0.1

vennelakodali commented 4 years ago

hm.. I'm not able to reproduce the issue right away - have you tried a Build -> Clean Project before running again?

Oh, looks like a conflicting AndroidStudio version and FirebaseServices version issue. AndroidStudio 4.0 has conflicts with the kotlin version and Firebase MLKit's version. I'm running Android Studio 3.6, so didn't catch the issue.

Will push an upgrade soon for AndroidStudio 4.0