arleyandrada / PushClient

FREE and Open Source - Titanium PushClient Module
Other
44 stars 17 forks source link

Compatibility with ti.map #105

Closed vasilestefirta closed 8 years ago

vasilestefirta commented 8 years ago

Hello, My project uses both PushClient and ti.map module. When I try to run the app I get the following error (it disappears after I remove the ti.map module):

[ERROR] Application Installer abnormal process termination. Process exit value was 1 [ERROR] : Failed to run dexer: [ERROR] :
[ERROR] : UNEXPECTED TOP-LEVEL EXCEPTION: [ERROR] : java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/LifecycleDelegate; [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/maps/GoogleMap$13; [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] : 2 errors; aborting

Could you please give me a solution for this?

Thanks!

arleyandrada commented 8 years ago

It is true that there may be conflicts between modules that use different versions of google-play-services.

Probably the Appcelerator updated version of its modules, creating a mismatch again.

I will to update my workspace and repeat all the tests.

I'm sorry for the late reply. I've been missing in recent months because of health problems and unable to work on my projects. I am currently checking and solving all pending issues. Please check back me if I can help in something else. Thank you!

vasilestefirta commented 8 years ago

Sounds good!

Can you please leave a comment here as soon as you will release a new version on the Appcelerator Marketplace?

Thanks

arleyandrada commented 8 years ago

Of course! Wait for a new version this week.

donCarlosOne commented 8 years ago

I just posted my own issue regarding this. The issue here is that google play services is now selectively compiled, so instead of a single google-play-services.jar, there is now google-play-services-base.jar, and any number of specific service jar files. PushClient needs google-play-services-base.jar, plus google-play-services-gcm.jar, and ti.map uses google-play-services-base.jar plus google-play-services-maps.jar. It used to be that you needed to make sure that all modules were referencing the same version of google-play-services.jar (the most recent, usually), so now it will need to be google-play-services-base.jar, etc. The reason you're seeing the dexer error is because the classes are first loaded by PushClient using google-play-services.jar, and then ti.map tries to load them again using google-play-services-base.jar (since it doesn't reference google-play-services.jar any longer). It should be a simple matter to rebuild PushClient using references to google-play-services-base.jar and google-play-services-gcm.jar, and including those two jar files in the distribution.

arleyandrada commented 8 years ago

Yes, exactly! I'm working in a new release with this and others issues and new features. Thanks!

donCarlosOne commented 8 years ago

great. looking forward to it (even without the new features)

arleyandrada commented 8 years ago

Hi vasilestefirta, Hi domCarlosOne,

I was unable to identify your email and also your PushClient license, only by your github username, to be able to send a new version of PushClient module to you.

I released a new version of my module, but the Appcelerator Marketplace is very lazy.

Regards,

Arley

vasilestefirta commented 8 years ago

Hi Arley,

Thanks for the new version. I can confirm that now I'm not getting any errors when I have both ti.map and PushClient modules enabled for my Android app.

My GitHub username and Appcelerator Marketplace username are different so that's why you couldn't find my email address ;)

Thanks again for your help, Vasile