AppAuth-Android: CustomTabs not working with AndroidX

After migrating project to AndroidX AppAuth-Android stop showing custom tabs and always open auth forms in standalone browser.

After quick research I found that issue with “jetifier” which process libraries and replace references from old support libraries to new androidx.

This constant https://github.com/openid/AppAuth-Android/blob/master/library/java/net/openid/appauth/browser/BrowserSelector.java#L54 changed to androidx.browser.customtabs.action.CustomTabsService which leads to break hasWarmupService

Yes it looks more like a jetifier bug. But knowing google I don’t think they will fix it.

Is it planned to migrate the library to androidx?

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 2
  • Comments: 30 (4 by maintainers)

Commits related to this issue

Most upvoted comments

Is there a date when these changes are scheduled to be released yet?

This worked for me:

  1. Gradle version must be 5.1.1+ - Modify Gradle version in your gradlewrapper.properties as below.

distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip

  1. Jetifier version must be 1.0.0-beta04+ - Add below line in your project level build.gradle dependencies section.

dependencies { //… classpath “com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04” }

It does. I wrote a sample app that uses the most recent version of jetifier and the build tools plugin.

This worked for me:

  1. Gradle version must be 5.1.1+ - Modify Gradle version in your gradlewrapper.properties as below.

distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip

  1. Jetifier version must be 1.0.0-beta04+ - Add below line in your project level build.gradle dependencies section.

dependencies { //… classpath “com.android.tools.build.jetifier:jetifier-processor:1.0.0-beta04” }

Works like a charm. THX @deepakmn86

Updating to Android Gradle Plugin v3.4.0 + Gradle 5.1.1 solves the issue

After upgrading to 7.0.1 also I am facing the same issue. When I checked the code in the library, it is still the same. @VisibleForTesting static final String ACTION_CUSTOM_TABS_CONNECTION = “android.support.customtabs.action.CustomTabsService”; I think the issue still exists, but in the git master code base i can see the changes.

It was suggested to me to maintain an AndroidX branch of AppAuth, so that clients can choose which variant they want based on their own migration. Jetifier / DeJetifier apparently still have some bugs, so I want to give those tools some time to mature before I fully commit to the transition.