我的gradle Dependency看起来像这样,
dependencies { compile files('libs/Shutterbug-1.0.0.jar') compile files('libs/VolleyWithJsonArrayRequest.jar') compile files('libs/android-async-http-1.4.3.jar') compile files('libs/geonames-1.1.12.jar') compile files('libs/jdom-1.0.jar') compile files('libs/kenburnsview-1.0.6.jar') compile files('libs/libGoogleAnalyticsServices.jar') compile files('libs/multiselectlistpreferencecompat.jar') compile files('libs/universal-image-loader-1.9.1.jar') compile 'com.android.support:support-v4:23.1.1' compile 'com.google.android.gms:play-services:8.3.0' compile 'com.android.support:appcompat-v7:23.1.1' compile 'com.google.android.gms:play-services-ads:8.3.0' compile 'com.google.android.gms:play-services-identity:8.3.0' compile 'com.google.android.gms:play-services-gcm:8.3.0' compile 'com.google.android.gms:play-services-analytics:8.3.0' }
但是当在android studio 1.5上运行应用程序时,我收到以下错误:
Error:Execution failed for task ':app:transformClassesWithJarMergingForDebug'. > com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry: com/google/android/gms/analytics/internal/Command$1.class
小智.. 10
您很可能libs/libGoogleAnalyticsServices.jar
在com.google.android.gms:play-services-analytics:8.3.0
依赖项之间存在重复项.
如果您尝试使用最新的SDK(v4),请注释/删除该libGoogleAnalyticsServices.jar
行并重建.
如果您尝试使用v3 SDK,请注释/删除com.google.android.gms:play-services-analytics:8.3.0
编译行并重建.
来源:Google Analytics的最新API文档https://developers.google.com/analytics/devguides/collection/android/v4/
您很可能libs/libGoogleAnalyticsServices.jar
在com.google.android.gms:play-services-analytics:8.3.0
依赖项之间存在重复项.
如果您尝试使用最新的SDK(v4),请注释/删除该libGoogleAnalyticsServices.jar
行并重建.
如果您尝试使用v3 SDK,请注释/删除com.google.android.gms:play-services-analytics:8.3.0
编译行并重建.
来源:Google Analytics的最新API文档https://developers.google.com/analytics/devguides/collection/android/v4/