0
サードパーティライブラリのjarファイルにあるクラスを除外する必要があります。私は、グループを除外する正確な構文形式を知らない。私は、ライブラリ "javax.xml.stream.jar"内のXMLConstants.classという名前のクラスを除外するために次の構文を試しました。build.gradle(モジュールアプリ)でモジュールを除外する方法は?
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
compile 'com.android.support:appcompat-v7:23.4.0'
compile 'com.google.android.gms:play-services-appindexing:8.1.0'
compile 'com.android.support:support-v4:23.4.0'
compile 'com.android.support:multidex:1.0.1'
compile files('libs/xsdlib-1.5.jar')
compile files('libs/relaxngDatatype-2.2.jar')
compile files('libs/javax.xml.stream.jar'){
exclude module: 'javax-xml-stream'
}
compile files('libs/pull-parser-2.jar')
compile files('libs/javax.xml.bind.jar')
compile files('libs/java-rt-jar-stubs-1.5.0.jar')
compile files('libs/jaxen-core.jar')
compile files('libs/jaxen-dom4j.jar')
compile files('libs/jaxen-1.1-beta-2.jar')
}
この構文を使用すると、次のエラーが表示されます。
Error:(52, 0) Could not find method exclude() for arguments [{module=javax-
xml-stream-XMLConstants}]
私はアンドロイドには新しいので、サードパーティのライブラリのjarファイルで特定のクラスを除外する構文を書く方法を知る必要があります。これを行う他の方法がある場合は、お勧めします。前もって感謝します。
私は両方のリンクをチェックするが、私の場合は、外部のjarライブラリ内に存在する「xxyyzz.class」を、除外する必要があります。私はこの sourceSets { アプリ{ のlibs { が除外のJava/XML /ストリーム/ XMLConstants/** ' }} }まだ取得エラーのようなものを試してみました。 –
動作していますか? –
@Somnath Palさん、ありがとう、私はまだ重複するクラスのエラーを取得しています。これは私のライブラリパスC:\ Users \ Xyz \ abc \ WORK SPACE \ MyApplication \ app \ libsであり、除外するクラスは "XMLConstants.class"です –