Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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?

like image 883
Tom Finet Avatar asked Jan 07 '18 19:01

Tom Finet


Video Answer


1 Answers

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.

like image 54
chenrui Avatar answered Oct 03 '22 10:10

chenrui