: app: transformClassesWithMultidexlistForDebug задача не выполнена - PullRequest
0 голосов
/ 29 апреля 2018
    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

Я пробую эти способы:

  1. построить мой модуль
  2. чистый проект
  3. удалить .gradle && build && .idea && [module] build
  4. затем перестройте мой проект

но я не могу решить это. Кто-нибудь, кто может помочь мне решить это? Thx.

Это мой 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'

1 Ответ

0 голосов
/ 20 июня 2018

Попробуйте это:

//app
repositories{
    flatDir {
        dirs 'libs'
        dirs.project(':BcClaLibirary').files('libs')
        //or you can use this way
        //dirs 'libs', '../BcClaLibirary/libs'
    }
}
...