0

我得到了例外

'程序类型已经存在:jpos.JposException '

尝试重建应用程序时,在我添加 、 和 之后出现了问题bixolon_printer_v127.jar,并且icu4j-58_1.jar在此之前它运行良好,jpos117-controls.jarxerces.jar

谁能帮忙?

build.gradle(模块)

apply plugin: 'com.android.application'

android {
    compileSdkVersion 27

    defaultConfig {
        applicationId "com.andalus.mobilesales"
        minSdkVersion 17
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
        multiDexEnabled true
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }

    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
}

configurations.all {
    resolutionStrategy.dependencySubstitution {
        substitute module('org.apache.commons:commons-io:1.3.2') with module('commons-io:commons-io:1.3.2')
    }
}

dependencies {
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation files('libs/ksoap2-android-assembly-3.2.0-jar-with-dependencies.jar')
    implementation files('libs/Sewoo_Android_1076B.jar')
    implementation 'com.android.support:recyclerview-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.octo.android.robospice:robospice:1.4.12'
    implementation 'com.toptoche.searchablespinner:searchablespinnerlibrary:1.3.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    implementation 'com.android.support:cardview-v7:27.1.1'
    implementation 'io.reactivex.rxjava2:rxandroid:2.0.2'
    implementation 'io.reactivex.rxjava2:rxjava:2.1.12'
    testImplementation 'junit:junit:4.12'
    implementation files('libs/bixolon_printer_v127.jar')
    implementation files('libs/icu4j-58_1.jar')
    implementation files('libs/jpos117-controls.jar')
    implementation files('libs/xerces.jar')
}

build.gradle(项目:应用程序)

// Top-level build file where you can add configuration options common to all sub-projects/modules.

buildscript {
    repositories {
        jcenter()
        google()
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }
}

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

task clean(type: Delete) {
    delete rootProject.buildDir
}
4

1 回答 1

1

它给出了错误,因为JposException类存在于两个或更多。在您的 Gradle 文件中,将您的jpos.JposException类从模块级 gradle 文件中的实现中排除,如下所示:

implementation (files('libs/jpos117-controls.jar')){
    exclude group: 'jpos.JposException'
 }

我希望它对你有用

于 2018-04-26T07:51:06.780 回答