Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27156] Firebase In-App Messaging Android integration crashes the app on the startup

GitHub Issuen/a
TypeBug
Priorityn/a
StatusOpen
ResolutionUnresolved
Affected Version/sn/a
Fix Version/sn/a
ComponentsAndroid
Labelsn/a
ReporterKai Lu
AssigneeUnknown
Created2019-05-03T02:59:23.000+0000
Updated2019-06-16T09:06:10.000+0000

Description

Hi Titans, I was trying to integrate the firebase in-app messaging feature with Titanium and I believe I have strictly followed the instructions from the official website: https://firebase.google.com/docs/in-app-messaging/get-started?platform=android but here is the issue I've been pulling my hair these days trying to figure out: I have written my own firebase in-app messaging by including all of the dependencies/libraries pulling from Gradle. The module does not have any exposed method in it as it just provide all those libraries to the firebase.core module to enable the in-app messaging feature. However if I included the platform/android/res/values/strings.xml file with the google_app_id value in the test project the app will crash instantly upon the startup. I think it crashed somewhere in the auto-init process provided by firebase but there is no specific log on the crash.
[INFO] App successfully installed
[INFO] Starting app: com.kt.test/.TestActivity
[DEBUG] Trying to start the app...
[INFO] Application pid: 18129
[INFO] Project built successfully in 1m 18s 6ms
-- Start application log -----------------------------------------------------
[WARN] zygote: Unexpected CPU variant for X86 using defaults: x86
[INFO] TiApplication: (main) [0,0] checkpoint, app created.
[INFO] MultiDex: VM with version 2.1.0 has multidex support
[INFO] MultiDex: Installing application
[INFO] MultiDex: VM has multidex support, MultiDex support library is disabled.
[DEBUG] AndroidRuntime: Shutting down VM
If I don't include the strings.xml file then the firebase won't initialize properly and when I call the configure() function in firebase.core module [https://github.com/hansemannn/titanium-firebase-core] it gives me the following error message:
[ERROR] TiExceptionHandler: Error: Unsatisfied dependency for component Component<[class com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay]>{2, type=0, deps=[Dependency{anInterface=class com.google.firebase.FirebaseApp, type=required, direct=true}, Dependency{anInterface=interface com.google.firebase.analytics.connector.AnalyticsConnector, type=required, direct=true}, Dependency{anInterface=class com.google.firebase.inappmessaging.FirebaseInAppMessaging, type=required, direct=true}]}: interface com.google.firebase.analytics.connector.AnalyticsConnector
..........
[ERROR] TiExceptionHandler:
[ERROR] TiExceptionHandler:     com.google.firebase.components.ComponentRuntime.validateDependencies(com.google.firebase:firebase-common@@16.1.0:167)
[ERROR] TiExceptionHandler:     com.google.firebase.components.ComponentRuntime.processInstanceComponents(com.google.firebase:firebase-common@@16.1.0:86)
[ERROR] TiExceptionHandler:     com.google.firebase.components.ComponentRuntime.<init>(com.google.firebase:firebase-common@@16.1.0:70)
[ERROR] TiExceptionHandler:     com.google.firebase.FirebaseApp.<init>(com.google.firebase:firebase-common@@16.1.0:553)
[ERROR] TiExceptionHandler:     com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:365)
[ERROR] TiExceptionHandler:     com.google.firebase.FirebaseApp.initializeApp(com.google.firebase:firebase-common@@16.1.0:332)
[ERROR] TiExceptionHandler:     firebase.core.TitaniumFirebaseCoreModule.configure(TitaniumFirebaseCoreModule.java:137)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Runtime.nativeRunModule(Native Method)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.runtime.v8.V8Runtime.doRunModule(V8Runtime.java:180)
[ERROR] TiExceptionHandler:     org.appcelerator.kroll.KrollRuntime.runModule(KrollRuntime.java:247)
[ERROR] V8Exception: Exception occurred at /root/app/shared/cloud/firebase_api.js:33: Uncaught Error: Unsatisfied dependency for component Component<[class com.google.firebase.inappmessaging.display.FirebaseInAppMessagingDisplay]>{2, type=0, deps=[Dependency{anInterface=class com.google.firebase.FirebaseApp, type=required, direct=true}, Dependency{anInterface=interface com.google.firebase.analytics.connector.AnalyticsConnector, type=required, direct=true}, Dependency{anInterface=class com.google.firebase.inappmessaging.FirebaseInAppMessaging, type=required, direct=true}]}: interface com.google.firebase.analytics.connector.AnalyticsConnector
I have checked the said "com.google.firebase.analytics.connector.AnalyticsConnector" interface is included in the lib/firebase-measurement-connector-17.0.1.aar file of my firebase.inappmessaging module. I've been stumped by this problem for several days now and have tried all sorts of different versions and combinations of the libraries/configuration and could not fix it. Could you guys please have a look to see what's causing the issue? I've tried Ti SDK 7.5.0 + and all have this issue. Here is the test project which should demonstrate the issue with all the modules I packaged for this firebase integration. https://www.dropbox.com/s/rnc81u3gy19liow/test.zip?dl=0 Please let me know if there is anything I can help with for quickly resolving this issue as we are desperately waiting on this module to work to ship our app. Thanks, Kai

Comments

  1. Rakhi Mitro 2019-05-03

    Hello, Thanks for reporting this. Can you please test on 8.0.0.GA and let us know how it goes. It would be helpful if you can share complete console logs here.
  2. Kai Lu 2019-05-03

    Hi Rakhi, I've tried 8.0.0.GA as well, same result. I don't think the rest of the log would matter that much since it crashed instantly without launching anything. I've also attached the dropbox link in the description above to my sample app for you. Please let me know if you need anything else. Thanks, Kai
  3. Kai Lu 2019-05-16

    It's been two weeks now. Could someone please take a look at the issue? At least point me to the right direction for fixing it myself if possible?
  4. Rakhi Mitro 2019-06-16

    [~kenjorai], Thanks for your feedback. We are able to reproduce the issue on our end. We are working to fix this. You will be notified soon.

JSON Source