我工作了将近 2 天,以摆脱签名构建的 v4重复问题apk
。我有两个模块。连接FB的SDK
有v4支持。
我已经从任何地方排除了 v4,gradle
但我仍然得到
错误:任务“:app:transformClassesWithJarMergingForRelease”执行失败。com.android.build.api.transform.TransformException:java.util.zip.ZipException:重复条目:android/support/v4/graphics/drawable/DrawableCompat.class
摇篮:应用程序:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.madlab.wapp.sais"
minSdkVersion 9
targetSdkVersion 20
versionCode 4
versionName "2.2"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt')
}
}
dependencies {
compile ('com.android.support:appcompat-v7:25.3.1')
compile project(':getsocialize')
}
}
**Gradle: sdk:**
apply plugin: 'com.android.library'
apply plugin: 'maven'
apply plugin: 'signing'
dependencies {
compile 'com.socialize:facebook:3.1.3-SNAPSHOT'
compile 'com.socialize:ioc:3.1.3-SNAPSHOT'
compile 'com.socialize:loopy:3.1.7'
// compile 'com.socialize:library:3.1.6'
compile files('libs/commons-codec-1.4.jar')
}
android {
compileSdkVersion 20
buildToolsVersion '25.0.2'
defaultConfig {
minSdkVersion 9
targetSdkVersion 20
versionCode 1
versionName "1.0"
testApplicationId "com.socialize.test"
testInstrumentationRunner "com.socialize.SocializeTestRunner"
multiDexEnabled true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
sourceSets {
main {
manifest.srcFile 'AndroidManifest.xml'
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
androidTest {
java.srcDirs = ['src']
resources.srcDirs = ['src']
aidl.srcDirs = ['src']
renderscript.srcDirs = ['src']
res.srcDirs = ['res']
assets.srcDirs = ['assets']
}
// Move the tests to tests/java, tests/res, etc...
androidTest.setRoot('../test')
// Move the build types to build-types/<type>
// For instance, build-types/debug/java, build-types/debug/AndroidManifest.xml, ...
// This moves them out of them default location under src/<type>/... which would
// conflict with src/ being used by the main source set.
// Adding new build types or product flavors should be accompanied
// by a similar customization.
debug.setRoot('build-types/debug')
release.setRoot('build-types/release')
}
}
即使在 v7 上排除后,我也可以看到该类在 v7 和 v4 中都带有 CNtl+N。
即使我手动删除 jar 每当我运行构建时,我都会自动获取 jar
C:\Users\subash\AndroidStudioProjects\Sais\sdk\build\intermediates\exploded-aar\com.socialize\facebook\3.1.3-SNAPSHOT\jars\libs.
我也对 gradle 运行了依赖项,没有发现任何问题。我非常感谢解决问题的帮助和指导
添加外部库 V4 问题: