Search code examples
titaniumappceleratortitanium-mobileappcelerator-titaniumtitanium-modules

Multidex error when using ti.map and ti.goosh module


I am making an Appcelerator Titanium application which use maps and notifications. To provide such functionality I want to use use:

  • ti.map (official Appcelerator Titanium module for maps),
  • ti.goosh.

The problem is that both requires Google Play Services and Appcelerator Titanium does not support multidex, so during compilation I always get an error:

[ERROR] :  Failed to run dexer:
[ERROR] :  
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzd$zza$zza;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzg$zza;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzd;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzd$zza;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zzg;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/dynamic/zze;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/playlog/internal/zza;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/playlog/internal/zzb;
[ERROR] :  Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/playlog/internal/zzd;
[ERROR] :  
[ERROR] :  UNEXPECTED TOP-LEVEL EXCEPTION:
[ERROR] :  java.lang.RuntimeException: Translation has been interrupted
[ERROR] :   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:608)
[ERROR] :   at com.android.dx.command.dexer.Main.runMonoDex(Main.java:311)
[ERROR] :   at com.android.dx.command.dexer.Main.run(Main.java:277)
[ERROR] :   at com.android.dx.command.dexer.Main.main(Main.java:245)
[ERROR] :   at com.android.dx.command.Main.main(Main.java:106)
[ERROR] :  Caused by: java.lang.InterruptedException: Too many errors
[ERROR] :   at com.android.dx.command.dexer.Main.processAllFiles(Main.java:600)
[ERROR] :   ... 4 more

I was suggested that I should create my own .jar file with Google Play Services as described here.

Unfortunately I cannot manage to create proper proguard.conf file, so I always end up with similar error.

To be specific:

  • I am able to create proguard.conf file (but it content must be wrong),
  • I create .jar file and I switch it with original.

Thanks in advance for any help.


Solution

  • The only way to make it working is to create special version of SDK providing necessary functionality for both modules. It is described as medium.com article but it is really complicated matter.

    Fortunately guys from caffeinalab provided jar libraries with good description how to implement them.

    If you still have any problem than it is good to check this thread which can help you with common mistakes.