我尝试添加fire base messaging以使用推送通知和google play服务分析来使用google analytics跟踪我的应用。当我现在构建syns时它没问题,但是当我运行app时它显示错误
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
我尝试使用
添加Myapplication.class@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}
并在构建中添加multiDexEnabled,但它不起作用 这是我的build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion "23.0.2"
defaultConfig {
applicationId "hoatv.videotrailer"
minSdkVersion 15
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
packagingOptions {
exclude 'META-INF/LICENSE'
exclude 'META-INF/LICENSE-FIREBASE.txt'
exclude 'META-INF/NOTICE'
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.2.1'
compile 'com.android.support:design:23.2.1'
provided 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
compile 'com.squareup.picasso:picasso:2.3.2'
compile 'com.jpardogo.materialtabstrip:library:1.1.0'
compile files('libs/valuepotion.jar')
compile files('libs/universal-image-loader-1.9.3.jar')
compile 'com.github.Commit451.YouTubeExtractor:youtubeextractor:2.1.0'
compile 'org.lucasr.twowayview:twowayview:0.1.4'
compile 'com.google.firebase:firebase-messaging:9.0.0'
compile 'com.google.android.gms:play-services-ads:9.0.0'
compile 'com.google.android.gms:play-services-analytics:9.0.0'
}
apply plugin: 'com.google.gms.google-services'

我该如何解决?请帮我!非常感谢!