AppAuth-Android icon indicating copy to clipboard operation
AppAuth-Android copied to clipboard

CustomTabs not working with AndroidX

Open zayass opened this issue 8 years ago • 30 comments

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?

zayass avatar Aug 08 '18 23:08 zayass

@tikurahul is going to speak to the AndroidX team to see if they can fix this bug. We're interested in migrating to AndroidX, but I don't fully understand the implications of doing that for apps that are not ready to migrate. I'll discuss it further with the Android engineers.

iainmcgin avatar Aug 09 '18 03:08 iainmcgin

Sounds cool, thanks.

zayass avatar Aug 09 '18 13:08 zayass

Hi. Any updates on this? I'm working on a new app for my organization based on Android Jetpack. Cannot get this to work when androidx is enabled...

dbsheta avatar Sep 05 '18 15:09 dbsheta

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.

iainmcgin avatar Sep 05 '18 22:09 iainmcgin

@iainmcgin forgive the interruption if my comment is stupid, but why are you duplicating the value of android.support.customtabs.CustomTabsService.ACTION_CUSTOM_TABS_CONNECTION in your library's source code? Wouldn't simply using that one fix the problem here?

jcayzac avatar Sep 14 '18 00:09 jcayzac

I agree with @jcayzac. As per previous comments this seems to be the only thing to be blocking the migration.

dbsheta avatar Sep 14 '18 04:09 dbsheta

I too agree with @dbsheta and @jcayzac I am also waiting for the fix.

itsvssudheesh avatar Sep 20 '18 00:09 itsvssudheesh

Jetfier is now close to stable. I think Jetifier won't get us all the way, because we have a hardcoded constant which refers to the old package. We need to fix that.

tikurahul avatar Sep 20 '18 01:09 tikurahul

@tikurahul Is it works now? I tried pretty same solution when open this issue and it didn't work.

zayass avatar Sep 20 '18 12:09 zayass

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

tikurahul avatar Sep 20 '18 12:09 tikurahul

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.

itsvssudheesh avatar Sep 23 '18 13:09 itsvssudheesh

It’s probably inlined. See the ident approach by Bloch mentioned at https://www.javaworld.com/community/node/3400

jcayzac avatar Sep 24 '18 03:09 jcayzac

We have not pushed a new release with these changes yet. At least AFAIK.

tikurahul avatar Sep 25 '18 17:09 tikurahul

Any progress on this issue? This is giving us a hard time after migrating to AndroidX...

icedice avatar Oct 12 '18 08:10 icedice

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

tmdues avatar Oct 23 '18 12:10 tmdues

@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#L44

zayass avatar Oct 30 '18 19:10 zayass

We have not pushed a new release with these changes yet. At least AFAIK.

We are waiting for this fix, Any update on new release.

ramkia613 avatar Jan 14 '19 07:01 ramkia613

Any news on this fix?

spardo83 avatar Jan 26 '19 17:01 spardo83

Folks please make sure you are using the latest version of Studio and Jetifier. This fix does work.

tikurahul avatar Jan 27 '19 08:01 tikurahul

When is planned release with this fix?

lietusme avatar Feb 08 '19 10:02 lietusme