hansemannn / titanium-firebase-analytics

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

feat(android): update firebase to latest #36 #35

Closed hansemannn closed 5 years ago

hansemannn commented 5 years ago

wip, still need to fix the following error due to moving the analytics aar to the core:

[ERROR] Failed to compile Java source files:
[ERROR]
[ERROR] warning: [options] bootstrap class path not set in conjunction with -source 7
[ERROR] Note: [KrollBindingGen] Running Kroll binding generator.
[ERROR] Note: [KrollBindingGen] No binding data found, creating new data file: org.appcelerator.titanium.bindings/titanium-firebase-analytics.json
[ERROR] Note: [KrollBindingGen] Found binding for module TitaniumFirebaseAnalytics
[ERROR] /Users/hans/Documents/dev/titanium/titanium-firebase-analytics/android/src/firebase/analytics/TitaniumFirebaseAnalyticsModule.java:23: error: package com.google.firebase.analytics does not exist
[ERROR] import com.google.firebase.analytics.FirebaseAnalytics;
[ERROR]                                     ^
[ERROR] /Users/hans/Documents/dev/titanium/titanium-firebase-analytics/android/src/firebase/analytics/TitaniumFirebaseAnalyticsModule.java:24: error: package com.google.firebase.analytics.FirebaseAnalytics does not exist
[ERROR] import com.google.firebase.analytics.FirebaseAnalytics.Param;
[ERROR]                                                       ^
[ERROR] /Users/hans/Documents/dev/titanium/titanium-firebase-analytics/android/src/firebase/analytics/TitaniumFirebaseAnalyticsModule.java:34: error: cannot find symbol
[ERROR]   private static FirebaseAnalytics mFirebaseAnalytics;
[ERROR]                  ^
[ERROR]   symbol:   class FirebaseAnalytics
[ERROR]   location: class TitaniumFirebaseAnalyticsModule
[ERROR] /Users/hans/Documents/dev/titanium/titanium-firebase-analytics/android/src/firebase/analytics/TitaniumFirebaseAnalyticsModule.java:36: error: cannot find symbol
[ERROR]   private FirebaseAnalytics analyticsInstance()
[ERROR]           ^
[ERROR]   symbol:   class FirebaseAnalytics
[ERROR]   location: class TitaniumFirebaseAnalyticsModule
[ERROR] Note: [KrollBindingGen] Generating JSON: file:///Users/hans/Documents/dev/titanium/titanium-firebase-analytics/android/build/generated/json/org/appcelerator/titanium/bindings/titanium-firebase-analytics.json
[ERROR] 4 errors
[ERROR] 1 warning
hansemannn commented 5 years ago

@m1ga This one still doesn't want to build - even with the updated library and core. Meeh!

fahad86 commented 5 years ago

what happens when you add "play-services-measurement-api-16.3.0.aar" from ti.playservices to the lib dir??

hansemannn commented 5 years ago

@fahad86 Do you think this will change something? It seems to not find the com.google.firebase.analytics package in general.

fahad86 commented 5 years ago

@hansemannn yes. That's where you can find the class. I was able to get it to build doing that. You can unzip that .aar and inspect the classes.jar file using a tool like JD-GUI

fahad86 commented 5 years ago

Not sure why Google would put com.google.firebase.analytics classes into play-services-measurement-api-

hansemannn commented 5 years ago

@fahad86 This was just fixed in the new Ti.PlayServices release (thanks to @garymathews!). I will retry to package it next week.

jwogan5 commented 5 years ago

@hansemannn

Have you had a chance to package these changes into a release? I updated appcelerator today which bumped play services to 16.1.2. I then went ahead and updated all the firebase modules to the latest versions but I was seeing the following build error:

[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/analytics/FirebaseAnalytics; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/analytics/FirebaseAnalytics$Event; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/analytics/FirebaseAnalytics$Param; [ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/analytics/FirebaseAnalytics$UserProperty;

fahad86 commented 5 years ago

@hansemannn I'm able to compile without any problems (tested using Ti SDK 7.5.2.v20190306131103). Apply this patch and try: https://quickfileshare.org/1LM2/patch.diff

Brianggalvez commented 5 years ago

@hansemannn I'm able to compile without any problems (tested using Ti SDK 7.5.2.v20190306131103). Apply this patch and try: https://quickfileshare.org/1LM2/patch.diff

could you upload a zip with the build? Or maybe submit a PR. I'm trying to build it but I have the same error even with your diff.

fahad86 commented 5 years ago

@Brianggalvez https://github.com/hansemannn/titanium-firebase-analytics/pull/42 please make sure that you have the latest ti.playservices module in the Ti SDK

hansemannn commented 5 years ago

@fahad86 can you approve this? I think we are fine here.