AWS auth ui sdk需要minSdkVersion 23,为什么?

Tom*_*net 7 android gradle amazon-web-services aws-sdk

我正在使用AWS后端设置我的Android应用程序并且正在编译com.amazonaws:aws-android-sdk-auth-ui:2.6.+@aar库需要minSdkVersion在应用程序级别gradle文件中为23,但是我希望使用19作为minSdkVersion.这是我的gradle文件.

apply plugin: 'com.android.application'

android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "com.jwb.juicewithbenefits"
        minSdkVersion 19
        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'
    implementation 'com.android.support:design:26.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'
    // Mobile Client for initializing the SDK
    compile ('com.amazonaws:aws-android-sdk-mobile-client:2.6.7@aar') { transitive = true; }
    // Cognito UserPools for SignIn
    compile ('com.amazonaws:aws-android-sdk-auth-userpools:2.6.+@aar') { transitive = true; }
    // Sign in UI Library
    compile ('com.amazonaws:aws-android-sdk-auth-ui:2.6.+@aar') { transitive = true; }
}
Run Code Online (Sandbox Code Playgroud)

这是错误.

Error:Execution failed for task ':app:processDebugManifest'.
> Manifest merger failed : uses-sdk:minSdkVersion 19 cannot be smaller than version 23 declared in library [com.amazonaws:aws-android-sdk-auth-ui:2.6.13] /Users/tomfinet/.gradle/caches/transforms-1/files-1.1/aws-android-sdk-auth-ui-2.6.13.aar/7dfb53c482a0be1de8d21de2413312fd/AndroidManifest.xml as the library might be using APIs not available in 19
    Suggestion: use a compatible library with a minSdk of at most 19,
        or increase this project's minSdk version to at least 23,
        or use tools:overrideLibrary="com.amazonaws.mobile.auth.ui" to force usage (may lead to runtime failures)
Run Code Online (Sandbox Code Playgroud)

当我使用23作为minSdkVersiongradle构建成功完成而不是19时.如何minSdkVersion成功使用19并构建gradle?

che*_*rui 2

aws-android-sdk-auth-ui在 v2.6.0 Commit 参考中引入。

在此提交中,引入了 v23 平台依赖项 ( aws-android-sdk-auth-ui/pom.xml ):

<dependency>
  <groupId>com.android.support</groupId>
  <artifactId>support-v4</artifactId>
  <version>23.0.0</version>
  <type>aar</type>
</dependency>
<dependency>
  <groupId>com.android.support</groupId>
  <artifactId>appcompat-v7</artifactId>
  <version>23.0.0</version>
  <type>aar</type>
</dependency>
<dependency>
  <groupId>com.android.support</groupId>
  <artifactId>cardview-v7</artifactId>
  <version>23.0.0</version>
  <type>aar</type>
</dependency>
Run Code Online (Sandbox Code Playgroud)

因此,您需要 v23 Android SDK 才能使用aws-android-sdk-auth.

  • 对于使用低于 API 23 的 amazon cognito 服务还有其他建议吗? (3认同)