hansemannn / titanium-firebase-analytics

Use the Firebase Analytics SDK in Axway Titanium 🚀
Other
35 stars 18 forks source link

Failed resolution of: Lcom/google/android/gms/measurement/internal/zzbw #48

Closed mobileappsr closed 3 years ago

mobileappsr commented 5 years ago

Hi @hansemannn we just downloaded and integrated FireBase Analytics and Core latest modules 3.0.0 and 5.0.0 respectively and seeing the issue Failed resolution of: Lcom/google/android/gms/measurement/internal/zzbw

[ERROR] : TiExceptionHandler: Ti.App.FirebaseAnalytics.log('click' [ERROR] : TiExceptionHandler: ^ [ERROR] : TiExceptionHandler: Error: Failed resolution of: Lcom/google/android/gms/measurement/internal/zzbw; [ERROR] : TiExceptionHandler: at Label. (/app.js:36:28)

[ERROR] : TiExceptionHandler: com.google.firebase.analytics.FirebaseAnalytics.getInstance(Unknown Source) [ERROR] : TiExceptionHandler: firebase.analytics.TitaniumFirebaseAnalyticsModule.analyticsInstance(TitaniumFirebaseAnalyticsModule.java:37) [ERROR] : TiExceptionHandler: firebase.analytics.TitaniumFirebaseAnalyticsModule.log(TitaniumFirebaseAnalyticsModule.java:46) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.nativeFireEvent(Native Method) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.runtime.v8.V8Object.fireEvent(V8Object.java:63) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.doFireEvent(KrollProxy.java:978) [ERROR] : TiExceptionHandler: org.appcelerator.kroll.KrollProxy.handleMessage(KrollProxy.java:1207) [ERROR] : TiExceptionHandler: org.appcelerator.titanium.proxy.TiViewProxy.handleMessage(TiViewProxy.java:265) [ERROR] : TiExceptionHandler: android.os.Handler.dispatchMessage(Handler.java:98)

We haven't included any other third party module in the sample app. Can you please suggest what exactly is going wrong. We are using Ti 7.5.2GA SDK and play services 16.x.

Sample app previously used to work with FireBase Analytics and Core 2.1.0 and 3.0.0 respectively.

Any help is appreciated @hansemannn

Thanks in advance.

mobileappsr commented 5 years ago

Hi @hansemannn ,

Waiting for your response. We are stuck and unable to proceed. Any help is appreciated @hansemannn

hansemannn commented 5 years ago

Sorry, I am not able to provide open source support right now.

mobileappsr commented 5 years ago

Thanks @hansemannn

ErikDohmen commented 5 years ago

@mobileappsr did you manage to solve this issue?

hansemannn commented 5 years ago

Please use this combination (note the exact versions):

    <!-- Ti.PlayServices -->
    <module platform="android" version="16.1.3">ti.playservices</module>

    <!-- Firebase Core -->
    <module platform="android" version="5.0.0">firebase.core</module>

    <!-- Firebase Cloud Messaging -->
    <module platform="android" version="2.0.2">firebase.cloudmessaging</module>

    <!-- Firebase Analytics -->
    <module platform="android" version="3.0.0">firebase.analytics</module>
ErikDohmen commented 5 years ago

@hansemannn you mention firebase cloudmessaging 2.0.2, but there's only a version 2.0.1 as far as I know. I tried the 2.0.1 version, but that didn't work out

jwogan5 commented 4 years ago

@ErikDohmen

Cloud Messaging 2.0.2 showed up in the releases yesterday. I just tried it and everything worked except that the module could not get the firebase instance id. I did some research and found that when I placed these lines in my tiapp.xml file everything started to work with the latest modules.

<service android:name="com.google.firebase.components.ComponentDiscoveryService" >
          <meta-data android:name="com.google.firebase.components:com.google.firebase.iid.Registrar" android:value="com.google.firebase.components.ComponentRegistrar" />
        </service>
ErikDohmen commented 4 years ago

@jwogan5 Hi Jason, How do you initialize the core/cloudmessaging and analytics? Can you show me? Or drop me an email?

jwogan5 commented 4 years ago

Within alloy.js I have the following lines. The android google-services.json is stored in app/assets/android/ I also have the google_app_id string located at platform/android/res/values/strings.xml

The modules in tiapp.xml are all pointing to the newest versions.

const FirebaseCore = require('firebase.core');

// This line is in a different file form me but I just require the module here.   require('firebase.cloudmessaging');
// This line is in a different file form me but I just require the module here.   require('firebase.analytics');

    try {
        if (Ti.Platform.name == 'android') {
            FirebaseCore.configure({
                file: '/google-services.json'
            });
        } else {
            FirebaseCore.configure({
                file: 'GoogleService-Info.plist'
            });
        }
    } catch (e) {}
ErikDohmen commented 4 years ago

And you include the firebase cloudmessage and analytics before or after the configuration?

jwogan5 commented 4 years ago

You include it before the config and after the firebase core require. In the example above the 2 lines commented are we I include them, I just have the requires in other files that I included before the config call.

ErikDohmen commented 4 years ago

I was using 16.1.5 of the ti.playservices which had an extra issue with the androidx classification. Went back to the 16.1.4 version, but that gave me other errors. Finally removed the play-services-ads-lite.aar from this version and it started to work again. Took a while, but I'm there now. Thanks for all the help @jwogan5