[TIMOB-14963] Android: Ti.Map and Ti.Cloudpush return "already added: Lcom/google/android/gms/games/achievement/Achievement"
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | High |
Status | Closed |
Resolution | Fixed |
Resolution Date | 2014-07-07T21:49:49.000+0000 |
Affected Version/s | Release 3.3.0 |
Fix Version/s | 2013 Sprint 21, 2013 Sprint 21 Core, Release 3.2.0 |
Components | Android |
Labels | androidbuild, ay-verified, cb-verified, cloudpush, map, regression |
Reporter | Michael Gangolf |
Assignee | Chris Barber |
Created | 2013-08-21T06:25:15.000+0000 |
Updated | 2014-07-07T21:49:49.000+0000 |
Description
I'm trying to add Push to my app (iOS/Android) but I'm getting the following error message when I compile the android version:
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/games/achievement/Achievement;
[ERROR] at com.android.dx.dex.file.ClassDefsSection.add(ClassDefsSection.java:123)
[ERROR] at com.android.dx.dex.file.DexFile.add(DexFile.java:163)
[ERROR] at com.android.dx.command.dexer.Main.processClass(Main.java:490)
[ERROR] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:459)
[ERROR] at com.android.dx.command.dexer.Main.access$400(Main.java:67)
[ERROR] at com.android.dx.command.dexer.Main$1.processFileBytes(Main.java:398)
[ERROR] at com.android.dx.cf.direct.ClassPathOpener.processArchive(ClassPathOpener.java:245)
[ERROR] System Error while compiling Android classes.dex
[ERROR] at com.android.dx.cf.direct.ClassPathOpener.processOne(ClassPathOpener.java:131)
[ERROR] at com.android.dx.cf.direct.ClassPathOpener.process(ClassPathOpener.java:109)
[ERROR] at com.android.dx.command.dexer.Main.processOne(Main.java:422)
[ERROR] at com.android.dx.command.dexer.Main.processAllFiles(Main.java:333)
[ERROR] at com.android.dx.command.dexer.Main.run(Main.java:209)
[ERROR] at com.android.dx.command.dexer.Main.main(Main.java:174)
[ERROR] at com.android.dx.command.Main.main(Main.java:91)
[ERROR] 1 error; aborting
Modules added:
<modules>
<module platform="android">ti.cloudpush</module>
<module platform="android">com.acktie.mobile.android.qr</module>
<module platform="commonjs">ti.cloud</module>
<module platform="iphone">com.acktie.mobile.ios.qr</module>
<module platform="android">facebook</module>
<module platform="android">ti.map</module>
<module platform="iphone">facebook</module>
</modules>
other users confirm that ti.cloudpush and ti.map inside the same project will cause this error for them too.
Thread: http://developer.appcelerator.com/question/155815/already-added-lcomgoogleandroidgmsgamesachievementachievement
I'm not seeing actual TiStudio version. It may be replicated using below version though.
TiStudio
Console output
[Moved to main project]
This is b/c both ti.cloudpush and ti.map requires google-play-services.jar. One quick workaround is to go inside one of the modules and delete the jar to prevent duplication during compile time. I.e: remove /modules/ti.cloudpush/[version]/lib/google-play-services.jar from your app's directory.
This appears to be a build script issue, and we should attempt to fix it as part of the new CLI.
any idea when this will be resolved... impacting client release for end of October. I have removed the jar from the map module and still having the issue.
[~aaron@clearlyinnovative.com] Since it is a build script issue, we have to wait until the script rewrite is done as part of version 3.2.0. However, I'm puzzled why the workaround wouldn't work. [~hpham], any thoughts on what other module might be causing the problem? Maybe the APK modules?
+1 to this issue
[~aaron@clearlyinnovative.com], the workaround works fine for me. Can you upload a sample project that failed using the workaround?
@Aaron This bad boy is fixed! Coming to a 3.2 SDK soon!
Pull request: https://github.com/appcelerator/titanium_mobile/pull/4781
excellent!!
@Chris - I do not see any test instructions in this ticket. Can you please provide with some test steps.
To test: 1) create an app for Android 2) enable Ti.Map and Ti.Cloudpush 3) build the app You must try different versions of Ti.Map and Ti.Cloudpush. The goal is to find two versions where the google-play-services.jar files (from each module's lib dir) are different.
Tested Environment: Appcelerator Studio: 3.2.0.201312171913 SDK:3.2.0.v20131217190633 alloy: 1.3.0-cr2 acs: 1.0.10 npm: 1.3.2 titanium: 3.2.0-cr3 titanium-code-processor: 1.1.0-cr2 Xcode:5.0.2 OS: Mac OSX 10.9 Device: Google Nexus7(v4.4.2) I followed the above mentioned test steps. Scenario 1: Used ti.map:2.1.3(latest) and ti.cloudpush: 3.2.0(latest) Result: App build and launched successfully Scenario 2: Used ti.map:2.1.3(latest) and ti.cloudpush: 2.4.0 Result: App build and launched successfully Scenario 3: Used ti.map:2.1.3(latest) and ti.cloudpush: 2.3.3 and 2.3.2 and 2.3.0 Result: Got error as
Scenario 4: Used ti.map:2.1.3(latest) and ti.cloudpush: 2.2.0 Result: App build and launched successfully Scenario 5: Used ti.map: 2.1.2 and ti.cloudpush: 3.2.0(latest),2.4.0 and 2.3.3 Result: Got error as
Scenario 6: Used ti.map: 2.1.2 and ti.cloudpush: 2.3.2,2.3.0 and 2.2.0 Result: App build and launched successfully Hence as per above observations, the issue seems to be resolved and fixed using the latest modules. Please confirm then will close the issue.
Closing according to verifications done in the above comment by Priya as the results she saw looks like expected results.
I would suggest that we at least use the same Google Play Service version in ti.cloudpush module so that it can work with ti.map.
[~ngupta] Cool, but that doesn't solve the problem. The next version of either ti.cloudpush or ti.map will use a newer google-play-services.jar file and the problem remains.
I totally get it but that is least we can do it until we figure out the right way to solve this issue.
:-(
We plan to do the following: Validate this particular issue can be closed again. We will then use: TIMODOPEN-417 to track the cloud push jar sync. MOD-1726 to track the geofence sync. TIMODOPEN-421 to track the map sync. TIMODOPEN-420 to track the improvement request for the jar conflicts in general. All tickets will be linked to this.
We were able to validate this issue was reopened in error. The issue mentioned is not related to this ticket and is tracked elsewhere. Re-closing