Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-14963] Android: Ti.Map and Ti.Cloudpush return "already added: Lcom/google/android/gms/games/achievement/Achievement"

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2014-07-07T21:49:49.000+0000
Affected Version/sRelease 3.3.0
Fix Version/s2013 Sprint 21, 2013 Sprint 21 Core, Release 3.2.0
ComponentsAndroid
Labelsandroidbuild, ay-verified, cb-verified, cloudpush, map, regression
ReporterMichael Gangolf
AssigneeChris Barber
Created2013-08-21T06:25:15.000+0000
Updated2014-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

Comments

  1. Eduardo Gomez 2013-08-27

    I'm not seeing actual TiStudio version. It may be replicated using below version though.

    TiStudio

       Titanium Studio, build: 3.1.2.201308091617
       (c) Copyright 2012-2013 by Appcelerator, Inc.  All rights reserved.
       
       Build: jenkins-titanium-rcp-master-482 (origin/master)
       Date: 09 August 2013, 16:20:52
       

    Console output

       [INFO] Compiling Android Resources... This could take some time
       [DEBUG] /Users/egomez/android-sdks/build-tools/17.0.0/dx -JXmx1536M -JXX:-UseGCOverheadLimit --dex "--output=/Users/egomez/Documents/Titanium Studio Workspace/TravisTestApp/build/android/bin/classes.dex" "/Users/egomez/Documents/Titanium Studio Workspace/TravisTestApp/build/android/bin/classes" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/ti-commons-codec-1.3.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-platform.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/android-support-v4.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/kroll-v8.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-ui.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-filesystem.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-app.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/kroll-common.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-android.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/jaxen-1.1.1.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-analytics.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-media.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-locale.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/titanium.jar" "/Library/Application Support/Titanium/modules/android/ti.map/2.1.2.old/map.jar" "/Library/Application Support/Titanium/modules/android/ti.map/2.1.2.old/lib/google-play-services.jar" "/Library/Application Support/Titanium/modules/android/ti.cloudpush/2.3.2/cloudpush.jar" "/Library/Application Support/Titanium/modules/android/ti.cloudpush/2.3.2/lib/bcprov-jdk15-146-shrink.jar" "/Library/Application Support/Titanium/modules/android/ti.cloudpush/2.3.2/lib/google-play-services.jar" "/Library/Application Support/Titanium/modules/android/ti.cloudpush/2.3.2/lib/org.eclipse.paho.client.mqttv3.jar" "/Library/Application Support/Titanium/modules/android/ti.cloudpush/2.3.2/lib/signpost-commonshttp4-1.2.1.1.jar" "/Library/Application Support/Titanium/modules/android/ti.cloudpush/2.3.2/lib/signpost-core-1.2.1.1.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/lib/titanium-verify.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/lib/titanium-debug.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/lib/titanium-profiler.jar" "/Library/Application Support/Titanium/mobilesdk/osx/3.1.2.GA/android/modules/titanium-network.jar"
       [ERROR] System Error while compiling Android classes.dex
       [ERROR] 
       [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] 	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
       
    [Moved to main project]
  2. Hieu Pham 2013-08-30

    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.
  3. Ingo Muschenetz 2013-08-30

    This appears to be a build script issue, and we should attempt to fix it as part of the new CLI.
  4. Aaron K. Saunders 2013-09-28

    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. ti.map ti.cloud facebook facebook com.appcelerator.apm com.appcelerator.apm ti.cloudpush Is there another module library that needs to be removed?
  5. Ingo Muschenetz 2013-09-30

    [~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?
  6. Joseph Sachs 2013-10-11

    +1 to this issue
  7. Hieu Pham 2013-10-12

    [~aaron@clearlyinnovative.com], the workaround works fine for me. Can you upload a sample project that failed using the workaround?
  8. Chris Barber 2013-10-19

    @Aaron This bad boy is fixed! Coming to a 3.2 SDK soon!
  9. Chris Barber 2013-10-19

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/4781
  10. Aaron K. Saunders 2013-10-19

    excellent!!
  11. Lokesh Choudhary 2013-12-17

    @Chris - I do not see any test instructions in this ticket. Can you please provide with some test steps.
  12. Chris Barber 2013-12-17

    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.
  13. Priya Agarwal 2013-12-18

    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
        [ERROR] :  Conflicting jar files detected:
        [ERROR] :  
        [ERROR] :  The following modules have different "google-play-services.jar" files
        [ERROR] :     ti.map         (version 2.1.3) (hash=82efb850d2e6b58c79616cf66b4113b1)
        [ERROR] :     ti.cloudpush   (version 2.3.3) (hash=12642887aa4720e497836724f05a3a2e)
        [ERROR] :  
        [ERROR] :  You can either select a version of these modules where the conflicting jar file is the same or you
        [ERROR] :  can try copying the jar file from one module's "lib" folder to the other module's "lib" folder.
        [ERROR] Application Installer abnormal process termination. Process exit value was 1
           
    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
        [ERROR] :  Conflicting jar files detected:
        [ERROR] :  
        [ERROR] :  The following modules have different "google-play-services.jar" files
        [ERROR] :     ti.map         (version 2.1.2) (hash=b47358dc913d151ff334144279647528)
        [ERROR] :     ti.cloudpush   (version 2.3.3) (hash=12642887aa4720e497836724f05a3a2e)
        [ERROR] :  
        [ERROR] :  You can either select a version of these modules where the conflicting jar file is the same or you
        [ERROR] :  can try copying the jar file from one module's "lib" folder to the other module's "lib" folder.
        [ERROR] Application Installer abnormal process termination. Process exit value was 1
           
    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.
  14. Lokesh Choudhary 2013-12-18

    Closing according to verifications done in the above comment by Priya as the results she saw looks like expected results.
  15. Priya Agarwal 2014-07-02

  16. Neeraj Gupta 2014-07-02

    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.
  17. Chris Barber 2014-07-02

    [~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.
  18. Neeraj Gupta 2014-07-03

    I totally get it but that is least we can do it until we figure out the right way to solve this issue.
  19. Aaron K. Saunders 2014-07-03

    :-(
  20. Eric Merriman 2014-07-07

    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.
  21. Eric Merriman 2014-07-07

    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

JSON Source