com.android.build.api.transform.TransformException :
Error while generating the main dex list.
com.android.tools.r8.errors.CompilationError:
Program type already present: com.xyja.bcclalib.BuildConfig
我尝试过这些方法:
这是我的build.gradle
(应用)。
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.xyja.bcclalib"
minSdkVersion 19
targetSdkVersion 26
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
repositories{
flatDir {
dirs 'libs'
}
}
dependencies {
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation project(':BcClaLibirary')
implementation 'com.android.support:multidex:1.0.3'
}
这是我build.gradle
(BcClaLibirary)的一部分。
apply plugin: 'com.android.library'
android {
...
}
dependencies {
implementation files('libs/bcprov-jdk15on-157.jar')
implementation files('libs/ksoap2-android-assembly-3.6.0-jar-with-dependencies.jar')
implementation files('libs/sun.misc.BASE64Decoder.jar')
implementation (name: 'ESecurityLib-release', ext: 'aar')
}
configurations.all {
resolutionStrategy.cacheChangingModulesFor 0, 'seconds'
}
apply from: './nexus_maven.gradle'
答案 0 :(得分:0)
尝试一下:
//app
repositories{
flatDir {
dirs 'libs'
dirs.project(':BcClaLibirary').files('libs')
//or you can use this way
//dirs 'libs', '../BcClaLibirary/libs'
}
}