Uploaded image for project: 'Titanium SDK/CLI'
  1. Titanium SDK/CLI
  2. TIMOB-27156

Firebase In-App Messaging Android integration crashes the app on the startup

    Details

    • Type: Bug
    • Status: Open
    • Resolution: Unresolved
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: Android
    • Labels:
      None
    • Environment:

      Mac 10.14.4 Mojave Ti SDK 7.5.0 +

      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

        Attachments

          Activity

            People

            • Assignee:
              Unassigned
              Reporter:
              kenjorai Kai Lu
            • Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:

                Backbone Issue Sync

                • Backbone Issue Sync is enabled for your project, but we do not have any synchronization info for this issue.

                  Git Source Code