类依赖性重复“程序类型已存在”

时间:2019-05-11 05:45:58

标签: android class kotlin androidx

错误

  

程序类型已存在:androidx.versionedparcelable.NonParcelField”,“源”:[{}],“工具”:“ D8”}


我无法找出重复的条目,有人可以帮助我解决此问题吗?它会导致Androidx核心库吗?但我认为androidx核心没有重复的条目

Project.gradle

buildscript {
ext.kotlinVersion = '1.3.10'
repositories {
    google()
    jcenter()
}
dependencies {
    classpath 'com.android.tools.build:gradle:3.1.0'
    classpath 'com.getkeepsafe.dexcount:dexcount-gradle-plugin:0.6.3'
    classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
    classpath 'com.github.ben-manes:gradle-versions-plugin:0.17.0'
}
}

allprojects {
repositories {
    google()
    jcenter()
    mavenCentral()
}
}

ext {
minSdkVersion = 19
targetSdkVersion = 28
buildToolsVersion = '28.0.3'
versionName = '4.5.1'
versionCode_lite = 98
versionCode_plus = 96
}

App.gradle

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.getkeepsafe.dexcount'
apply plugin: 'jacoco'
apply plugin: 'com.github.ben-manes.versions'

android {
compileSdkVersion project.targetSdkVersion
buildToolsVersion project.buildToolsVersion

defaultConfig {
    minSdkVersion project.minSdkVersion
    targetSdkVersion project.targetSdkVersion
    versionName project.versionName
    vectorDrawables.useSupportLibrary = true
}

sourceSets {
    lightningPlus.setRoot('src/LightningPlus')
    lightningLite.setRoot('src/LightningLite')
}

buildTypes {
    debug {
        // TODO: debug cannot be used on SDK < 21
        multiDexEnabled true
        minifyEnabled false
        shrinkResources false
        proguardFiles 'proguard-project.txt'
        testCoverageEnabled true
    }

    release {
        multiDexEnabled true
        minifyEnabled true
        shrinkResources true
        proguardFiles 'proguard-project.txt'
        testCoverageEnabled false
    }
}

testOptions {
    unitTests.all {
        jacoco {
            // This option needs to be included for robolectric tests
            includeNoLocationClasses = true
        }
    }
}

flavorDimensions "capabilities"

productFlavors {
    lightningPlus {
        dimension "capabilities"
        buildConfigField "boolean", "FULL_VERSION", "Boolean.parseBoolean(\"true\")"
        applicationId "acr.browser.lightning"
        versionCode project.versionCode_plus
    }

    lightningLite {
        dimension "capabilities"
        buildConfigField "boolean", "FULL_VERSION", "Boolean.parseBoolean(\"false\")"
        applicationId "acr.browser.barebones"
        versionCode project.versionCode_lite
    }
}

lintOptions {
    abortOnError true
}

packagingOptions {
    exclude '.readme'
}
compileOptions {
    sourceCompatibility JavaVersion.VERSION_1_8
    targetCompatibility JavaVersion.VERSION_1_8
}
configurations.all {
    resolutionStrategy.force 'com.android.support:support-v4:26.1.0' // the lib is old dependencies version;
}
}

jacoco {
toolVersion = '0.7.9' // See http://www.eclemma.org/jacoco/
}

dexcount {
includeClasses = false
includeFieldCount = false
format = "tree"
orderByMethodCount = true
verbose = false
}

dependencies {
// test dependencies

testImplementation 'junit:junit:4.12'
testImplementation 'org.assertj:assertj-core:3.11.1'
testImplementation 'org.mockito:mockito-core:2.23.0'
testImplementation 'com.nhaarman:mockito-kotlin:1.6.0', {
    exclude group: 'org.jetbrains.kotlin'
}
testImplementation 'org.robolectric:robolectric:3.8'




implementation 'com.android.support:multidex:1.0.3'


// support libraries
implementation "androidx.palette:palette:1.0.0"
implementation "androidx.annotation:annotation:1.0.0"
implementation "androidx.vectordrawable:vectordrawable-animated:1.0.0"
implementation "androidx.appcompat:appcompat:1.0.0"
implementation "com.google.android.material:material:1.0.0"
implementation "androidx.recyclerview:recyclerview:1.0.0"
implementation "androidx.fragment:fragment:1.0.0"
implementation "androidx.drawerlayout:drawerlayout:1.0.0"

// html parsing for reading mode
implementation 'org.jsoup:jsoup:1.11.3'

// file reading
final def mezzanineVersion = '1.1.1'
implementation "com.anthonycr.mezzanine:mezzanine:$mezzanineVersion"
kapt "com.anthonycr.mezzanine:mezzanine-compiler:$mezzanineVersion"

// dependency injection
final def daggerVersion = '2.17'
implementation "com.google.dagger:dagger:$daggerVersion"
kapt "com.google.dagger:dagger-compiler:$daggerVersion"
compileOnly 'javax.annotation:jsr250-api:1.0'

// view binding
final def butterKnifeVersion = '9.0.0-rc1'
implementation "com.jakewharton:butterknife:$butterKnifeVersion"
kapt "com.jakewharton:butterknife-compiler:$butterKnifeVersion"

// permissions
implementation 'com.anthonycr.grant:permissions:1.1.2'

// proxy support
implementation 'net.i2p.android:client:0.8'

implementation 'com.squareup.okhttp3:okhttp:3.11.0'

// rx
implementation 'io.reactivex.rxjava2:rxandroid:2.1.0'
implementation 'io.reactivex.rxjava2:rxjava:2.2.2'
implementation 'io.reactivex.rxjava2:rxkotlin:2.3.0'

// tor proxy
final def netCipherVersion = '2.0.0-alpha1'
implementation "info.guardianproject.netcipher:netcipher:$netCipherVersion"
implementation "info.guardianproject.netcipher:netcipher-webkit:$netCipherVersion"

implementation 'com.anthonycr.progress:animated-progress:1.0'

// memory leak analysis
final def leakCanaryVersion = '1.6.1'
debugImplementation "com.squareup.leakcanary:leakcanary-android:$leakCanaryVersion"
releaseImplementation "com.squareup.leakcanary:leakcanary-android-no-op:$leakCanaryVersion"

// kotlin
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlinVersion"
implementation 'androidx.core:core-ktx:1.0.0'
}

kapt {
arguments {
    arg("mezzanine.projectPath", project.rootDir)
}
}

tasks.withType(org.jetbrains.kotlin.gradle.tasks.KotlinCompile).all {
sourceCompatibility = JavaVersion.VERSION_1_7
targetCompatibility = JavaVersion.VERSION_1_7

kotlinOptions {
    jvmTarget = '1.6'
    kotlinOptions {
        freeCompilerArgs += ['-XXLanguage:+InlineClasses']
        freeCompilerArgs += ['-progressive']
    }
}
}

task jacocoTestReport(type: JacocoReport, dependsOn: ['testLightningPlusDebugUnitTest', 'createLightningPlusDebugCoverageReport']) {

reports {
    xml.enabled = true
    html.enabled = true
}

final def fileFilter = ['**/R.class', '**/R$*.class', '**/BuildConfig.*', '**/Manifest*.*', '**/*Test*.*', 'android/**/*.*']
final def debugTree = fileTree(dir: "$buildDir/intermediates/classes/lightningPlus/debug", excludes: fileFilter)
final def kotlinDebugTree = fileTree(dir: "$buildDir/tmp/kotlin-classes/lightningPlusDebug", excludes: fileFilter)
final def mainSrc = "${project.projectDir}/src/test/java"

sourceDirectories = files([mainSrc])
classDirectories = files([debugTree], [kotlinDebugTree])
executionData = fileTree(dir: "$buildDir", includes: [
        "jacoco/testLightningPlusDebugUnitTest.exec",
        "outputs/code-coverage/connected/*coverage.ec"
])
}

Gradle.properties

kotlin.incremental=false
android.useAndroidX=true
android.enableJetifier=true
android.debug.obsoleteApi=true

0 个答案:

没有答案