apptentive / apptentive-cordova

A plugin for Cordova that lets your app be Apptentive.
https://learn.apptentive.com/knowledge-base/integrating-the-apptentive-cordova-sdk-plugin/
BSD 3-Clause "New" or "Revised" License
3 stars 13 forks source link

Android build failing after updating to 6.0.0 #92

Closed TheLangdaTyagi closed 2 years ago

TheLangdaTyagi commented 2 years ago

Min SDK version mentioned in the docs is 28. Updated apptentive-cordova to 6.0.0, running android build throws the below error which is forcing me to upgrade to min sdk 31.

> Task :app:checkDebugAarMetadata FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:checkDebugAarMetadata'.
> A failure occurred while executing com.android.build.gradle.internal.tasks.CheckAarMetadataWorkAction
   > The minCompileSdk (31) specified in a
     dependency's AAR metadata (META-INF/com/android/build/gradle/aar-metadata.properties)
     is greater than this module's compileSdkVersion (android-30).
     Dependency: androidx.appcompat:appcompat:1.4.0.
     AAR metadata file: /Users/vishweshjoshi/.gradle/caches/transforms-3/fbf0b8ffd7e927f26341f539c06528e2/transformed/appcompat-1.4.0/META-INF/com/android/build/gradle/aar-metadata.properties.

Workspace - Angular - 13 Ionic - 6 cordova - 10.0.0 cordova-android - 10.1.1 Working apptentive-cordova version - 5.7.1

Really need to update to the latest version as it's mandated by app stores. Would love to get any eyes on this if possible, let me know if more info is needed.

Thanks

PoornimaApptentive commented 2 years ago

If you don't want to bump compileSDKVersion to 31, Could you try one of the below strategies mentioned in our learn pages?

Exclude core-ktx & appcompat and add them separately that are compatible with compileSDKVersion < 31

dependencies {
    implementation 'androidx.core:core-ktx:1.6.0'
    implementation 'androidx.appcompat:appcompat:1.3.1'

    implementation ('com.apptentive:apptentive-android:5.8.3') {
        exclude group: 'androidx.core', module: 'core-ktx'
        exclude group: 'androidx.appcompat', module: 'appcompat'
    }
}

or use a force resolution strategy

configurations.all {
    resolutionStrategy {
        force 'androidx.core:core-ktx:1.6.0'
        force  'androidx.appcompat:appcompat:1.3.1'
    }
}
TheLangdaTyagi commented 2 years ago

Ok that works. What was confusing was the Android-P Support section at https://learn.apptentive.com/knowledge-base/integrating-the-apptentive-cordova-sdk-plugin/

If that's not consistent can we update that?

Thanks for the inputs! Appreciate it. This thread can now be closed. (leaving it open just in case the above needs to be updated. if not kindly go ahead and close it.)

PoornimaApptentive commented 2 years ago

Thanks for pointing it out! We have updated that section.