我正在使用钛SDK 6.0.1.GA并编译为Android。
我有这个错误。
[ERROR] Failed to run dexer:
[ERROR]
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/MessengerCompat;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/MessengerCompat$1;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/MessengerCompat$zza;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/zzb;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/zzb$zza;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/zzb$zza$zza;
[ERROR] 6 errors; aborting
也许它与geolocation.jar有关我想虽然,但找不到任何解决方案。
我正在将ti.map和ti.ga用于此应用程序。
以下是对日志的描述。
[INFO] Running dexer: /Library/Java/JavaVirtualMachines/jdk1.8.0_92.jdk/Contents/Home/bin/java "-Xmx1024M" "-XX:-UseGCOverheadLimit" "-Djava.ext.dirs=/Users/whitebear/Library/Android/sdk/platform-tools" "-jar" "/Users/whitebear/Library/Android/sdk/build-tools/23.0.2/lib/dx.jar" "--dex" "--multi-dex" "--output=/Users/whitebear/CodingWorks/httproot/okayamaARNew/build/android/bin/dexfiles" "/Users/whitebear/CodingWorks/httproot/okayamaARNew/build/android/bin/classes" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/lib/titanium-verify.jar" "/Users/whitebear/Library/Application Support/Titanium/modules/android/com.wikitude.ti/6.0.0/wikitudeand.jar" "/Users/whitebear/Library/Application Support/Titanium/modules/android/com.wikitude.ti/6.0.0/lib/wikitudesdk_32bit.jar" "/Users/whitebear/Library/Application Support/Titanium/modules/android/ti.map/3.1.0/map.jar" "/Users/whitebear/Library/Application Support/Titanium/modules/android/ti.map/3.1.0/lib/google-play-services-base.jar" "/Users/whitebear/Library/Application Support/Titanium/modules/android/ti.map/3.1.0/lib/google-play-services-map.jar" "/Users/whitebear/CodingWorks/httproot/okayamaARNew/modules/android/ti.ga/3.0.7/tiga.jar" "/Users/whitebear/CodingWorks/httproot/okayamaARNew/modules/android/ti.ga/3.0.7/lib/google-play-services-analytics.jar" "/Users/whitebear/CodingWorks/httproot/okayamaARNew/modules/android/nl.vanvianen.android.gcm/1.7/gcm.jar" "/Users/whitebear/CodingWorks/httproot/okayamaARNew/modules/android/nl.vanvianen.android.gcm/1.7/lib/gcm-server.jar" "/Users/whitebear/CodingWorks/httproot/okayamaARNew/modules/android/nl.vanvianen.android.gcm/1.7/lib/google-play-services-gms.jar" "/Users/whitebear/CodingWorks/httproot/okayamaARNew/modules/android/nl.vanvianen.android.gcm/1.7/lib/gson-2.3.1.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/kroll-v8.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-analytics.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/aps-analytics.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-android.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/jaxen-1.1.1.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/ti-commons-codec-1.3.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/kroll-common.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/titanium.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/android-support-multidex.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-filesystem.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-app.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-ui.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/nineoldandroids-appc-2.4.0.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-media.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-appcompat.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/android-support-v4.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/android-support-v7-appcompat.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-cardview.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/cardview-v7-23.0.1.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-locale.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-network.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-xml.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-platform.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-gesture.jar" "/Users/whitebear/Library/Application Support/Titanium/mobilesdk/osx/6.0.1.GA/android/modules/titanium-geolocation.jar"
[ERROR] Failed to run dexer:
[ERROR]
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/MessengerCompat;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/MessengerCompat$1;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/MessengerCompat$zza;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/zzb;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/zzb$zza;
[ERROR] Uncaught translation error: java.lang.IllegalArgumentException: already added: Lcom/google/android/gms/iid/zzb$zza$zza;
[ERROR] 6 errors; aborting
答案 0 :(得分:1)
从〜/ Library / Application Support / Titanium / modules / android获取google-play-services-base.jar并将其替换为所有模块,这样您就可以确保它们之间不会发生冲突。 现在你必须摆脱其他jar中的类(例如google-play-services-analytics.jar),这些类已经在google-play-services-base.jar中,所以解压缩有罪的库,删除重复的类,并使用以下命令重新创建jar:
jar cf google-play-services-analytics.jar ./com
为了做这些事情你也可以使用proguard,但上面的程序就足够了。我在我的博客http://mpic.it/snellire-la-libreria-google-play-services-jar-con-proguard/上写过这个问题,但它是用意大利文写的。