我的应用级等级
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 23
buildToolsVersion "24.0.2"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.mss.triplestar"
minSdkVersion 15
targetSdkVersion 23
multiDexEnabled true
}
//====================Add below two line=============
dexOptions {
javaMaxHeapSize "4g" //specify the heap size for the dex process
preDexLibraries = false //delete the already predexed libraries
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.txt'
}
}
}
dependencies {
compile 'com.android.support:support-v4:23.4.0'
compile files('libs/dagger-1.2.2.jar')
compile files('libs/javax.inject-1.jar')
compile files('libs/libGoogleAnalyticsServices.jar')
// compile files('libs/libGoogleAnalyticsV2.jar')
compile 'com.google.android.gms:play-services-analytics:9.0.0'
compile files('libs/nineoldandroids-2.4.0.jar')
compile files('libs/vungle-publisher-adaptive-id-3.3.1.jar')
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile project(':wheelLib')
compile 'com.google.android.gms:play-services:9.0.0'
// compile 'com.google.android.gms:play-services-gcm:9.0.0'
compile 'org.apache.httpcomponents:httpclient:4.5'
compile 'com.scottyab:aescrypt:0.0.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:24.2.0'
}
我的日志输出
Information:Gradle tasks [:app:assembleDebug]
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5 is ignored for debug as it may be conflicting with the internal version provided by Android.
Warning:WARNING: Dependency org.apache.httpcomponents:httpclient:4.5 is ignored for release as it may be conflicting with the internal version provided by Android.
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
Information:BUILD FAILED
Information:Total time: 2.579 secs
Information:1 error
Information:2 warnings
Information:See complete output in console
这是我的日志输出,我正在尝试构建和更新我的项目,但是如果我删除了分析jar而不是简单的跟踪器错误,.please帮助我就会给我这个错误,在这一点上我被困住了,没有任何线索.tried所有的解决方案,提前.Thanks
发布于 2016-09-17 03:54:39
由于您正在为Android添加Google的遗留版本,所以您应该删除它。
移除:
compile files('libs/libGoogleAnalyticsServices.jar')
还将插件添加到应用程序级别的 build.gradle
的底部。
apply plugin: 'com.google.gms.google-services'
也没有理由同时使用:
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services:9.0.0'
你不应该使用compile 'com.google.android.gms:play-services:9.0.0'
,因为它包括所有的Google服务库--只使用您需要的API。
https://stackoverflow.com/questions/39544151
复制相似问题