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)
Links to this issue
Commits related to this issue
- Use CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION in BrowserSelector. * This helps with the jetification. I produced an artifact locally, and wrote a sample app using: ```gradle implementati... — committed to tikurahul/AppAuth-Android by tikurahul 6 years ago
- Use CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION in BrowserSelector. (#411) * This helps with the jetification. I produced an artifact locally, and wrote a sample app using: ```gradle i... — committed to openid/AppAuth-Android by tikurahul 6 years ago
- Sync up AppAuth repository with Skyscanner fork (#3) * Minor README fixes (#351) Thanks to @celphy for spotting these mistakes. * Add WeWork to AUTHORS WeWork, as my employer, is now the cop... — committed to Skyscanner/AppAuth-Android by athilahs 4 years ago
- Use CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION in BrowserSelector. (#411) * This helps with the jetification. I produced an artifact locally, and wrote a sample app using: ```gradle i... — committed to SmartBigGuru/AppAuth-Android by SmartBigGuru 6 years ago
Is there a date when these changes are scheduled to be released yet?
This worked for me:
distributionUrl=https://services.gradle.org/distributions/gradle-5.1.1-all.zip
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.
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.
@tikurahul I retry current master with our code and still have an issue. Like guys here https://github.com/DreaminginCodeZH/CustomTabsHelper/issues/5. They hack with
StringBuilder
works fine. https://github.com/DreaminginCodeZH/CustomTabsHelper/blob/master/library/src/main/java/org/chromium/customtabsclient/CustomTabsHelper.java#L44It 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.