Leanplum/Leanplum-Android-SDK

Leanplum fails to compile with targetSdkVersion 28

LithiumSheep opened this issue · 9 comments

Expected Behavior

Project compiles without issues

Actual Behavior

Project gradle sync fails with an error

Steps to Reproduce the Problem

  1. Update targetSdkVersion to 28
  2. Update support library versions to 28.0.0
  3. Use google-services plugin 4.2.0
  4. Add Leanplum-fcm dependency
  5. Sync gradle

Gradle outputs a build error:

registerResGeneratingTask is deprecated, use registerGeneratedResFolders(FileCollection)

CONFIGURE SUCCESSFUL in 0s
Dependency resolved to an incompatible version: Dependency(fromArtifactVersion=ArtifactVersion(groupId=com.leanplum, artifactId=leanplum-core, version=4.2.1), toArtifact=Artifact(groupId=com.android.support, artifactId=support-v4), toArtifactVersionString=[22.0.0,27.0.2])
In project 'app' a resolved Google Play services library dependency depends on another at an exact version (e.g. "[22.0.
0,27.0.2]", but isn't being resolved to that version. Behavior exhibited by the library will be unknown.

Dependency failing: com.leanplum:leanplum-core:4.2.1 -> com.android.support:supportv4@[22.0.0,27.0.2], but support-v4 version was 27.0.2.

The following dependencies are project dependencies that are direct or have transitive dependencies that lead to the artifact with the issue.
-- Project 'app' depends onto com.leanplum:leanplum-fcm@4.2.1

For extended debugging info execute Gradle from the command line with ./gradlew --info
:app:assembleDebug to see the dependency paths to the artifact. This error message came from the google-services Gradle plugin, report issues at https://github.com/google/play-services-plugins and disable by adding "googleServices { disableVersionCheck = false }" to your build.gradle file.

I've included a sample project that you should be able to just clone and try to sync, and the build should fail with the same output. https://github.com/lolsheeplol/LeanplumPie

Specifications

  • Version: 4.2.1
  • Platform: Android

On second inspection, it looks like it's actually the google-services:4.2.0 plugin that is causing the build failure. The build succeeds on plugin version 4.1.0.

However, it seems the strict version matcher is still problematic for us as we run ./gradlew lintDevDebug on our CircleCi configuration, and that step now fails due to the major version of the support libraries changing.

hitting same issue...our app targets SDK 28. Why in the world does leanplum have that range? And why doesn't it work w/ SDK28? that's been out for a while :-P

and we use the com.google.android.gms:strict-version-matcher-plugin so we can't downgrade to the google-services plugin because we don't use it :-P

FYI, we figured out how to exclude the libraries Leanplum depends on:

configurations.all {
resolutionStrategy {
...
force "com.android.support:support-v4:${supportLibVersion}"
force "com.android.support:appcompat-v7:${supportLibVersion}"
}
}

then make sure you add transitive=false to your leanplum implementation line

Still...Leanplum should target SDK28 but I'm sure they know that by now :-)

e7mac commented

Hey all,

Following the guide on https://developer.android.com/jetpack/androidx/migrate, add the following lines to the gradle.properties file

android.enableJetifier=true 
android.useAndroidX=true

And the compilation works. As for the migration to sdk version 28 - it should be out soon

Sorry...that's not really a solution...our app is not on AndroidX yet :-P
Please migrate your SDK to API28...

@e7mac do you have a rough estimate for when that will be released?