清单合并因多个错误而失败,请参阅日志(PayUMoney 集成)

Manifest merger failed with multiple errors, see logs (PayUMoney integration)

我正在尝试将 PayUMoney 支付网关集成到我的应用程序中。集成文档的第一行说要添加 -

compile 'com.payumoney.sdkui:plug-n-play:1.0.0'

在我的应用级 build.gradle 文件依赖项中。但是一旦我这样做,我就会遇到错误 -

清单合并因多个错误而失败,请参阅日志行 -

实施'com.android.support:appcompat-v7:26.1.0'

显示以下错误-

All com.android.support libraries must use the exact same version specification (mixing versions can lead to runtime crashes). Found versions 26.1.0, 23.2.1. Examples include com.android.support:animated-vector-drawable:26.1.0 and com.android.support:cardview-v7:23.2.1 less... (Ctrl+F1) 
There are some combinations of libraries, or tools and libraries, that are incompatible, or can lead to bugs. One such incompatibility is compiling with a version of the Android support libraries that is not the latest version (or in particular, a version lower than your targetSdkVersion.)

帮我解决这个问题。

下面是我的build.gradle(Module:app)代码 -

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.learnturtle.payucheck"
        minSdkVersion 15
        targetSdkVersion 26
        versionCode 1
        versionName "1.0"
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}



dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support.constraint:constraint-layout:1.0.2'
    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'

    compile 'com.payumoney.sdkui:plug-n-play:1.0.0'
}

在这种情况下检查 gradle 控制台,可能支持库中已经存在明显的问题/值,或者 sdk 版本兼容性问题,您将获得错误的全部细节。

使用最新的依赖项

compile 'com.payumoney.sdkui:plug-n-play:1.5.0'

并更改 minSdkversion

minSdkVersion 20

Compile with following sdk

 implementation 'com.payumoney.sdkui:plug-n-play:1.5.0'

in same app label gradle

 minSdkVersion 20

打开清单并在应用程序标签内进行更改

tools:replace="android:allowBackup"


 <application
    android:allowBackup="true"
    android:icon="@mipmap/ic_launcher"
    android:label="@string/app_name"
    android:roundIcon="@mipmap/ic_launcher_round"
    android:supportsRtl="true"
    android:theme="@style/AppTheme"
    tools:ignore="GoogleAppIndexingWarning"
    tools:replace="android:allowBackup">

it worked for me fine.

使用最新的依赖项

compile 'com.payumoney.sdkui:plug-n-play:1.6.0'

并更改 minSdkversion

minSdkVersion 20

并在清单中添加这个

tools:replace="android:allowBackup,android:usesCleartextTraffic"