Paytabs android集成-程序类型已存在:okhttp3.Authenticator

时间:2018-07-16 07:44:29

标签: android payment-gateway payment

我在我的项目中集成了PayTabs付款方式 它可以在我的调试版本上正确运行

然后从我的项目中生成签名apk时出现此错误

this error appear when generate sign apk

这是我对gradle的依赖

implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:gridlayout-v7:26.1.0'
implementation 'com.android.support:multidex:1.0.1'

implementation 'com.github.siyamed:android-shape-imageview:0.9.+@aar'
implementation 'com.google.code.gson:gson:2.6.1'
implementation 'com.github.fccaikai:AndroidPermissionX:1.0.0'
implementation 'com.googlecode.android-query:android-query:0.25.9'

implementation 'com.wang.avi:library:2.1.3'
implementation 'com.github.rrsystems:utilsplus:1.1.0'
implementation 'com.romandanylyk:pageindicatorview:0.0.7'
implementation 'com.github.ragunathjawahar:android-saripaar:android-saripaar-2.0.3'


implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.squareup.retrofit2:converter-gson:2.3.0'
implementation 'com.github.bumptech.glide:glide:3.7.0'
implementation 'jp.wasabeef:picasso-transformations:2.2.1'
implementation 'com.github.chrisbanes:PhotoView:1.3.1'
implementation 'com.facebook.fresco:fresco:1.8.0'
implementation 'com.github.stfalcon:frescoimageviewer:0.5.0'

implementation 'com.intuit.sdp:sdp-android:1.0.4'
implementation 'com.intuit.ssp:ssp-android:1.0.4'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'io.nlopez.smartlocation:library:3.3.1'

implementation project(':PayTabs_SDK')

2 个答案:

答案 0 :(得分:2)

经过长期研究,我也遇到了同样的问题,幸运的是,我找到了解决办法,这是

configurations {
   all*.exclude group: 'com.squareup.okio'
   all*.exclude group: 'com.squareup.okhttp3'
   all*.exclude group: 'com.android.support', module : 'support-v13'
}

只需将此代码放在应用程序文件夹build.gradle文件中,就像

configurations {
    all*.exclude group: 'com.squareup.okio'
    all*.exclude group: 'com.squareup.okhttp3'
    all*.exclude group: 'com.android.support', module : 'support-v13'
}

dependencies {

    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation 'com.android.support.constraint:constraint-layout:1.1.0'
    testImplementation 'junit:junit:4.12'
    androidTestImplementation 'com.android.support.test:runner:1.0.1'
    androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
    implementation 'com.squareup.retrofit2:retrofit:2.2.0'
    implementation 'com.squareup.retrofit2:converter-gson:2.2.0'
    implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
    implementation project(':paytabs_SDK')
}

答案 1 :(得分:2)

Paytabs SDK使用的是okhttp jar文件,您可以通过配置排除okhttp

android {
   configurations {
        all*.exclude group: 'com.squareup.okhttp3', module: 'okhttp'
    } 
}

https://github.com/JakeWharton/picasso2-okhttp3-downloader/issues/1#issuecomment-413993079