Tom Finet
Tom Finet

Reputation: 2136

AWS auth ui sdk requires minSdkVersion 23, why?

I am setting up my android app with AWS backend and am compiling the com.amazonaws:aws-android-sdk-auth-ui:2.6.+@aar library requires minSdkVersion to be 23 in the app level gradle file, however I wish to use 19 as the minSdkVersion. Here is my gradle file.

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; }
}

Here is the error.

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)

When I use 23 as the minSdkVersion the gradle build completes successfully but not with 19. How can I use minSdkVersion 19 and build gradle successfully?

Upvotes: 7

Views: 1164

Answers (2)

chrish
chrish

Reputation: 2432

The documentation for aws-android-sdk-auth-ui states that the library depends on the Android SDK API Level 23 or higher. In another answer here, it is trying to prove this by looking at the com.android.support dependencies. These are version 23.0.0, but they have their own minSdkVersion on the Android SDK (which is a separate matter). The Android Support Libraries didn't require API 14 until v26.0.

Looking at aws-android-sdk-auth-ui/build.gradle, you can se that minSdkVersion is set to 23.

From Getting Started using the SDK on the github repo:

Please note the AWS SDK for Android supports Android API level 10+ and newer libraries may require higher API level 21+ and 23+.

Upvotes: 0

chenrui
chenrui

Reputation: 9866

The aws-android-sdk-auth-ui was introduced in v2.6.0 Commit reference.

In that commit, the v23 platform dependencies got introduced (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>

So you need v23 Android SDK to be able to use aws-android-sdk-auth.

Upvotes: 2

Related Questions