hansemannn / titanium-firebase-cloud-messaging

Use the Firebase Cloud Messaging SDK in Axway Titanium 🚀 Edit
Other
43 stars 31 forks source link

Cannot build for Android #11

Closed ghost closed 6 years ago

ghost commented 6 years ago

Im using Titanium SDK @ 7.1.0.GA. Configuration looks like:

<module platform="android" version="1.0.1">firebase.cloudmessaging</module>
<module platform="android" version="2.1.0">firebase.core</module>

Results in error message:

[ERROR] An error occurred during build after 22s 346ms
[ERROR] Conflicting Android Libraries with package name "com.google.firebase.iid" detected:
[ERROR]   /Users/xx/Library/Application Support/Titanium/modules/android/firebase.cloudmessaging/1.0.1/lib/firebase-iid-11.0.4.aar (hash: 2e2a2bf3cf156227413286f9693ced2390685878, origin: Module)
[ERROR]   /Users/xx/Library/Application Support/Titanium/modules/android/firebase.core/2.1.0/lib/firebase-iid-15.0.0.aar (hash: b0db3336a2ffeebda40a006e15e8dc91dac5e55a, origin: Module)
[ERROR]   
[ERROR] Please either select a version of these modules where the conflicting .aar file is the same or you can try removing the .aar file from one module's "lib" folder.

Then, after removing firebase-iid-11.0.4.aar, it comes further in the build process but eventually throws:

[ERROR] Failed to run dexer:
[ERROR]   
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/zzb;
[ERROR] 1 error; aborting
m1ga commented 6 years ago

Use this core version: https://github.com/hansemannn/titanium-firebase-core/releases/tag/android-2.0.1 the newer version uses 15, this version uses 11.0.4

hansemannn commented 6 years ago

https://github.com/hansemannn/titanium-firebase-cloud-messaging/releases/tag/android-1.0.2

We are currently blocked by Ti.PlayServices not using 15.0.0. Until that is done, I added a Gradle file that only uses 11.0.4 for Cloud Messaging.

ghost commented 6 years ago

Still unable to build with:

<module platform="android" version="1.0.2">firebase.cloudmessaging</module>
<module platform="android" version="2.1.0">firebase.core</module>
[ERROR] Failed to run dexer:
[ERROR]   
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/firebase/zzb;
[ERROR] 1 error; aborting
m1ga commented 6 years ago

I have an app with core 2.0.1 and messaging 2.0.0 which works fine. Please try that combination

ghost commented 6 years ago

typo? latest is 1.0.2 for firebase.cloudmessaging

m1ga commented 6 years ago

oh sorry. I had a custom build where I raised the number to 2.0.0! I just looked at my modules folder.

It's https://github.com/hansemannn/titanium-firebase-cloud-messaging/releases/tag/android-1.0.1 with some test code in it :smiley:

ghost commented 6 years ago

what Ti SDK are you using? If you redownload both

https://github.com/hansemannn/titanium-firebase-cloud-messaging/releases/tag/android-1.0.1 https://github.com/hansemannn/titanium-firebase-core/releases/tag/android-2.0.1

you will get issues. At least thats what I get

ghost commented 6 years ago

nvm i had 2.1.0 wrongly selected, it appears to build correctly now with the spec above

ghost commented 6 years ago
Message: Uncaught No static method zzcL(Ljava/lang/String;)Z in class Lcom/google/android/gms/common/util/zzt; or its super classes (declaration of 'com.google.android.gms.common.util.zzt'...

cant utilize this combination without runtime errors

m1ga commented 6 years ago
<modules>
    <module platform="android">ti.playservices</module>
    <module>firebase.core</module>
    <module>firebase.analytics</module>
    <module>firebase.cloudmessaging</module>
</modules>

analytics 2.0.1 fcm 1.0.1 core 2.0.1

no error, compiling and working fine :)

m1ga commented 6 years ago

@Cratyz using any other module that uses playservices that is NOT using ti.playservices? Like ti.ga, old maps version or so?

hansemannn commented 6 years ago

@m1ga With FCM 1.0.2 as well? https://github.com/hansemannn/titanium-firebase-cloud-messaging/releases/tag/android-1.0.2

m1ga commented 6 years ago

@hansemannn

checked analytics: 2.0.1 fcm: 1.0.2 core: 2.0.1

:heavy_check_mark: no compiling error :heavy_check_mark: sending a notification to the token works fine

BTW: latest analytics 2.1.0 [filename is actually 2.0.2, tag-version is different] crashed the app! But will check that separately