[TIMOB-19407] Unable to build project with latest android tooling
GitHub Issue | n/a |
---|---|
Type | Bug |
Priority | Low |
Status | Resolved |
Resolution | Fixed |
Resolution Date | 2019-10-29T18:17:03.000+0000 |
Affected Version/s | Release 5.1.1 |
Fix Version/s | Release 7.0.0 |
Components | CLI |
Labels | cb-tooling, supportTeam |
Reporter | Rick Blalock |
Assignee | Abir Mukherjee |
Created | 2015-08-25T21:16:42.000+0000 |
Updated | 2019-12-02T23:06:27.000+0000 |
Description
It keeps hanging on dexer. Once I upped the memory size to 512, i finally got an error back (after waiting about 10 minutes).
Dexer command:
[INFO] Running dexer: /Library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk/Contents/Home/bin/java "-Xmx512M" "-XX:-UseGCOverheadLimit" "-Djava.ext.dirs=/androidsdk/platform-tools" "-jar" "/androidsdk/build-tools/21.0.1/lib/dx.jar" "--dex" "--output=/Users/rickblalock/titanium_repos/Fish Rules App/build/android/bin/classes.dex" "/Users/rickblalock/titanium_repos/Fish Rules App/build/android/bin/classes" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/lib/titanium-verify.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/facebook/4.0.5/facebook.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/facebook/4.0.5/lib/bolts-android-1.1.2.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/facebook/4.0.5/lib/facebooksdk.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/ti.imagefactory/2.2.1/imagefactory.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/ti.map/2.3.1/map.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/ti.map/2.3.1/lib/google-play-services.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/ti.cloudpush/3.4.0/cloudpush.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/ti.cloudpush/3.4.0/lib/aps-cloudpush-1.1.4.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/ti.cloudpush/3.4.0/lib/google-play-services-base.jar" "/Users/rickblalock/Library/Application Support/Titanium/modules/android/ti.cloudpush/3.4.0/lib/google-play-services-gcm.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/kroll-v8.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-analytics.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/aps-analytics.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-android.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/jaxen-1.1.1.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/ti-commons-codec-1.3.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/kroll-common.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/titanium.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-app.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-ui.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/nineoldandroids-appc-2.4.0.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-filesystem.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-media.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-appcompat.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/android-support-v4.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/android-support-v7-appcompat.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-locale.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-network.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/thirdparty.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-xml.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-platform.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-database.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-gesture.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-geolocation.jar" "/Users/rickblalock/Library/Application Support/Titanium/mobilesdk/osx/4.0.0.GA/android/modules/titanium-utils.jar"
Error I finally get back:
[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:82)
[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:279)
[ERROR] at com.android.dx.command.dexer.Main.run(Main.java:245)
[ERROR] at com.android.dx.command.dexer.Main.main(Main.java:214)
[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/gcm/GoogleCloudMessaging$1;
[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:82)
[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:279)
[ERROR] at com.android.dx.command.dexer.Main.run(Main.java:245)
[ERROR] at com.android.dx.command.dexer.Main.main(Main.java:214)
[ERROR] at com.android.dx.command.Main.main(Main.java:106)
[ERROR]
[ERROR] UNEXPECTED TOP-LEVEL ERROR:
[ERROR] java.lang.OutOfMemoryError: Java heap space
[ERROR] at java.util.HashMap.resize(HashMap.java:703)
[ERROR] at java.util.HashMap.putVal(HashMap.java:628)
[ERROR] at java.util.HashMap.put(HashMap.java:611)
[ERROR] at com.android.dx.ssa.LocalVariableInfo.addAssignment(LocalVariableInfo.java:197)
[ERROR] at com.android.dx.ssa.LocalVariableExtractor.processBlock(LocalVariableExtractor.java:180)
[ERROR] at com.android.dx.ssa.LocalVariableExtractor.doit(LocalVariableExtractor.java:89)
[ERROR] at com.android.dx.ssa.LocalVariableExtractor.extract(LocalVariableExtractor.java:55)
[ERROR] at com.android.dx.ssa.SsaConverter.convertToSsaMethod(SsaConverter.java:49)
[ERROR] at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:98)
[ERROR] at com.android.dx.ssa.Optimizer.optimize(Optimizer.java:72)
[ERROR] at com.android.dx.dex.cf.CfTranslator.processMethods(CfTranslator.java:297)
[ERROR] at com.android.dx.dex.cf.CfTranslator.translate0(CfTranslator.java:137)
[ERROR] at com.android.dx.dex.cf.CfTranslator.translate(CfTranslator.java:93)
[ERROR] at com.android.dx.command.dexer.Main.processClass(Main.java:729)
[ERROR] at com.android.dx.command.dexer.Main.processFileBytes(Main.java:673)
[ERROR] at com.android.dx.command.dexer.Main.access$300(Main.java:82)
[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:279)
[ERROR] at com.android.dx.command.dexer.Main.run(Main.java:245)
[ERROR] at com.android.dx.command.dexer.Main.main(Main.java:214)
[ERROR] at com.android.dx.command.Main.main(Main.java:106)
Environment:
Android Environment
✓ sdk installed (/androidsdk)
! tools untested version 24.3.4; may or may not work
! platform tools untested version 23; may or may not work
✓ build tools installed (v21.0.1)
✓ adb installed /androidsdk/platform-tools/adb
✓ android installed /androidsdk/tools/android
✓ emulator installed /androidsdk/tools/emulator
✓ mksdcard installed /androidsdk/tools/mksdcard
✓ zipalign installed /androidsdk/build-tools/21.0.1/zipalign
✓ aapt installed /androidsdk/build-tools/21.0.1/aapt
✓ aidl installed /androidsdk/build-tools/21.0.1/aidl
✓ targets installed (40 found)
✓ avds installed (2 found)
✓ ndk installed (r8e (64-bit))
✓ ndk-build installed (/android-ndk/ndk-build)
[~cbarber] - what else do you need to troubleshoot this?
[~hpham] What do you make of the error above? Is this related in any way to the multi dex stuff? Is this new with the latest Android build tools?
Duplicate library - particularly cloudpush libraries. My guess is you're running an incompatible version of either map, ti.admob, or cloudpush, or any modules that involve google-play-services library. If you can, please upload the project. Thanks,
I see. Here are the modules I'm using.
Cloudpush is 3.4.0 Ti.Map is 2.3.3 Facebook is 4.0.5
I removed the modules and it compiles.
Ok narrowed it down to the ti.map module. I'll test the version numbers now.
Tried all the versions of the ti.map module that I have: 2.3.3, 2.3.1, 2.3.0, 2.2.3 - And it will always hang at the DexAr (<--- that was for [~cbarber]) part. Also, not sure if this matters but I'm using Ti SDK 4.0.0 GA. I have tried all of the above using 4.1 and 5.0 (master) and still get the same issue.
When I try this dexer command this is what I get:
I upped it to 2 GB
And the previous dexer command completed
So I can get the app to build with just ti.map module. When I have both ti.map and cloud push, I get
Seems like this is a long standing issue. https://developer.appcelerator.com/question/155815/already-added-lcomgoogleandroidgmsgamesachievementachievement
Ok figured it out. For some reason ti.map, that comes with master (it's ti.map 2.3.3) had the google-play-services.jar in it. This is what was causing the last issue mentioned in the comment above. I removed it and it works. Not sure how that got in there.
So, it's not your computer. Whew.
Hmm, did you update to latest master? The packaged ti.map module should contain the right libraries(google-play-services-base.jar and google-play-services-maps.jar)
[~hpham] I just downloaded master and the correct jars are there now. I must've had a really bad download for some reason.
Its still issue. SDK: 5.1.1.GA CLI: 5.1.0 *Modules: * ti.cloudpush 3.3.7 ti.map 2.3.4
if it helps, I'm having the same problem with a module that uses the google-play-services.jar file. I can't compile the project if the file is included with in the module. Weird thing is that there's not any other module using it.
I'm having the same problem with a module that uses the google-play-services.jar file. Any solution?
We appear to be having the same problem with Google Play Services in ti.map when we also use ti.googleanalytics — on Android only, not on iOS.
Hi, Please include these properties in your tiapp.xml and let me know if you get error again. *
Question - why is the possibility of setting these properties not documented in the Documentation? I decreased my build times by about 5 times setting those
[~dieskim] It is documented: http://docs.appcelerator.com/platform/latest/#!/guide/Titanium_CLI_Options.
@Chris Barber - yes the properties are explained there but being able to set them via "