Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-20278] Android: java.lang.IllegalArgumentException when ti.map and ti.geofence modules were added

GitHub Issuen/a
TypeBug
PriorityHigh
StatusClosed
ResolutionFixed
Resolution Date2016-10-11T13:02:37.000+0000
Affected Version/sn/a
Fix Version/sRelease 6.0.0
ComponentsAndroid
Labelsn/a
ReporterEduardo Gomez
AssigneeGary Mathews
Created2016-01-27T23:51:42.000+0000
Updated2016-10-11T22:12:59.000+0000

Description

Steps to reproduce

1) Create a sample app 2) Attach both modules 3) Run through CLI: $ appc run -p android -T device 4) Monitor console output

Stack Trace

[ERROR] Failed to run dexer:
[ERROR]   
[ERROR] UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/maps/LocationSource;
[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] 1 error; aborting

Work around

Downgrading ti.map to 2.3.1 instead of 2.3.4
<modules> 
<module platform="android" version="2.3.1">ti.map</module> 
<module platform="android" version="1.1.2">ti.geofence</module> 
</modules> 

Comments

  1. Gary Mathews 2016-10-11

    Fixed by https://github.com/appcelerator-modules/ti.geofence/pull/36
  2. Lokesh Choudhary 2016-10-11

    Verified the fix. No java.lang.IllegalArgumentException when ti.map & ti.admob are added to the project. Closing. Environment: Appc Studio : 4.8.0.201610060953 Ti SDK : 6.0.0.v20161011102836 Ti CLI : 5.0.10 Alloy : 1.9.2 MAC El Capitan : 10.11.6 Appc NPM : 4.2.8-7 Appc CLI : 6.0.0-57 Node: 4.6.0 Nexus 6 - Android 6.0.1 ti.map : 3.0.1 ti.geofence : 2.0.1

JSON Source