nekocode / JarFilterPlugin

Help exclude classes before building the JAR into Android DEX archives.
Apache License 2.0
222 stars 23 forks source link

release编译不了 #6

Open JakeWoki opened 3 years ago

JakeWoki commented 3 years ago
jarFilters {
    "com.squareup.okhttp3:okhttp:(.*)" {
        excludes = [
                'okhttp3/internal/ws/RealWebSocket.class',
                'okhttp3/internal/ws/RealWebSocket\\$(.*).class'
        ]
    }
}

debug编译是可以的

minifyEnabled true
shrinkResources true
zipAlignEnabled true
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'

一开始以为是压缩混淆影响,去掉后还是编译不了

Type okhttp3.internal.ws.RealWebSocket$Close is defined multiple times:  
\app\build\intermediates\project_dex_archive\release\out\okhttp3\internal\ws\RealWebSocket$Close.dex, 
\app\build\intermediates\external_libs_dex\release\mergeExtDexRelease\classes2.dex

错误提示

yangjieK commented 2 years ago

你解决了嘛, 我遇到跟你一样的情况

JakeWoki commented 2 years ago

没有,作者也没回复

Xiue233 commented 2 years ago

我也遇到相同的情况了