Pushwoosh / pushwoosh-appcelerator-titanium

Other
33 stars 16 forks source link

Module doesn't work on android with map #35

Closed MahmoudElmoghazy closed 6 years ago

MahmoudElmoghazy commented 7 years ago

[ERROR] Failed to run dexer: [ERROR]
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/common/ErrorDialogFragment; [ERROR] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122) [ERROR] at com.android.dx.dex.file.DexFile.add(DexFile.java:161) [ERROR] at com.android.dx.command.dexer.Main.processClass(Main.java:732) [ERROR] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) [ERROR] at com.android.dx.command.dexer.Main.access$300(Main.java:83) [ERROR] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) [ERROR] at com.android.dx.command.dexer.Main.processOne(Main.java:632) [ERROR] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) [ERROR] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) [ERROR] at com.android.dx.command.dexer.Main.run(Main.java:246) [ERROR] at com.android.dx.command.dexer.Main.main(Main.java:215) [ERROR] at com.android.dx.command.Main.main(Main.java:106) [ERROR]
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/internal/zzrn; [ERROR] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122) [ERROR] at com.android.dx.dex.file.DexFile.add(DexFile.java:161) [ERROR] at com.android.dx.command.dexer.Main.processClass(Main.java:732) [ERROR] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) [ERROR] at com.android.dx.command.dexer.Main.access$300(Main.java:83) [ERROR] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) [ERROR] at com.android.dx.command.dexer.Main.processOne(Main.java:632) [ERROR] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) [ERROR] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) [ERROR] at com.android.dx.command.dexer.Main.run(Main.java:246) [ERROR] at com.android.dx.command.dexer.Main.main(Main.java:215) [ERROR] at com.android.dx.command.Main.main(Main.java:106) [ERROR]
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/zzc; [ERROR] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:122) [ERROR] at com.android.dx.dex.file.DexFile.add(DexFile.java:161) [ERROR] at com.android.dx.command.dexer.Main.processClass(Main.java:732) [ERROR] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673) [ERROR] at com.android.dx.command.dexer.Main.access$300(Main.java:83) [ERROR] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:602) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:284) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:166) [ERROR] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:144) [ERROR] at com.android.dx.command.dexer.Main.processOne(Main.java:632) [ERROR] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:510) [ERROR] at com.android.dx.command.dexer.Main.runMonoDex(Main.java:280) [ERROR] at com.android.dx.command.dexer.Main.run(Main.java:246) [ERROR] at com.android.dx.command.dexer.Main.main(Main.java:215) [ERROR] at com.android.dx.command.Main.main(Main.java:106) [ERROR] 3 errors; aborting

wfhm commented 7 years ago

Hi,

Looks like there is another lib in your project containing google-play-services. Could you please check?

MahmoudElmoghazy commented 7 years ago

I updated my map to the the version of the push woosh and remove and lib from the module unless the Pushwoosh.jar

macasfaj commented 7 years ago

Did you fix that? What version of Ti.map are you using?

juanagu commented 7 years ago

Hello! I have the same issue, I use Pushwoosh 3.0.0, Ti.Map 3.1.0 and SDK 6.0. Any solution?

viridanti commented 7 years ago

Hi,

The root cause of this issue is a conflict between different plugins containing play services libs, it occurs when you use more than one plugin with the lib. For more info please refer to the following documentation:

http://docs.pushwoosh.com/docs/resolving-google-play-services-conflicts#2-unity-appcelerator-titanium

safadig commented 7 years ago

True, but it is very common as many apps use Ti.map

perdona commented 7 years ago

This is so frustrating. Still nothing on this issue?

perdona commented 7 years ago

@viridanti the docs don't show any resolution. For those who PAY for pushwoosh, don't u guys think it's time to solve this? Release a version for using along with ti.map, without the conflicting classes...

wfhm commented 7 years ago

You can find conflicting libs in the following directory:

https://github.com/Pushwoosh/pushwoosh-appcelerator-titanium/tree/master/Push-Notifications-Module/modules/android/com.pushwoosh.module/3.0.0/lib

Please try this solution offered by @MahmoudElmoghazy. Just check which plugin requires a higher version of google-play-services and leave this version in your app.

perdona commented 7 years ago

@wfhm thanks for the feedback, but where do I find the complete google-play-services.jar ? When I leave only the ti.map jars, my app crashes due to libraries missing from the pushwoosh jars I deleted. When I delete ti.map jars, the app crashes due to missing libs on map jars I deleted.

perdona commented 7 years ago

Guys, finally made it work. In my case, I removed all pushwoosh JARs and copied, in the /lib folder along with pushwoosh.jar, google-play-services-gcm.jar and google-play-services-iid.jar from NATIVE ti.cloudpush /lib folder.

csemrm commented 6 years ago

Hello @vveysner ,

Anyone facing Ti.map and pushwoosh android module in Ti SDK 6.2.2GA?

Please share your workaround for latest Ti SDK and pushwoosh module in Android platform.

Thanks

wfhm commented 6 years ago

@csemrm

You can find the google-play-services libs in Pushwoosh plugin: https://github.com/Pushwoosh/pushwoosh-appcelerator-titanium/tree/master/Push-Notifications-Module/modules/android/com.pushwoosh.module/3.4.0/lib

Ti.Map uses the same libs, but of another versions:

https://github.com/appcelerator-modules/ti.map/tree/master/android/lib

Just update, change or remove it either for Pushwoosh module or for Ti.Map to have just one instance of this lib in your project. Please note that Pushwoosh module requires 11.+ version of google-play-services to function.

csemrm commented 6 years ago

@wfhm I tried several ways. But still no success. Do you have any demo code with Ti.MAP and Pushwoosh modules?

Thanks

perdona commented 6 years ago

Following this cause I had the same issue every time I need to update Titanium SDK. Sharing @wfhm struggle, we hope you can provide us with a workaround, because this is very frustrating... Thanks in advance!

beaur commented 6 years ago

Also facing issues with this module and google play services and none of my usual tricks I've used in the past are working. It would be great to have some versions that worked with other common modules that cause conflicts eg. ti-ga (google analytics) and ti.map. I have a conflict with ti-ga myself.

wfhm commented 6 years ago

@MahmoudElmoghazy to fix this issue we need the latest version of Titanium, which currently is in beta. Once it is release we will roll the fix out.

safadig commented 6 years ago

I thought Titanium 7.0 GA addressed this issue specifically. Its already out, not in beta? https://www.appcelerator.com/blog/2017/12/ga-release-of-titanium-sdk-7-0-0-hyperloop-cli-7-0-0-appcelerator-studio-5-0-0/

wfhm commented 6 years ago

@safadig @MahmoudElmoghazy fixed in 5.5.2 version. You should also update your Titanium SDK to the latest one.