Giter VIP home page Giter VIP logo

Comments (17)

lbalmaceda avatar lbalmaceda commented on June 2, 2024 3

@jeffbuswell No, that's not the case since we first get all browser apps and keep only those who respond successfully to the CustomTabs Connection service. Then we choose one from that list, taking the user preference into account first and then falling back to the ones we trust the most. But if no app matches, we default to the one the OS would pick to open a generic ACTION_VIEW url intent. The thing is initially that value is null and only gets set if that ACTION_VIEW intent succeeds. So in the end, if no browser is installed there's nothing this class or even the SDK could do to open a URL (not even talking about using custom tabs anymore, just plain browsing).

The most I can do is capture that and silently log an error, or throw an unchecked exception (but this is already done by the OS). Otherwise this would be a breaking change (requiring devs to try/catch the call) and to be honest all phones should have at least 1 browser app installed.

from auth0.android.

vanshg avatar vanshg commented on June 2, 2024 1

+1, I'm getting this crash as well in crash reports. I can't reproduce personally. Though, I just updated my auth0 version, so it may go away (I was using the version bundled with Lock before)

from auth0.android.

jeffbuswell avatar jeffbuswell commented on June 2, 2024 1

@lbalmaceda Yep, I disabled the browser on an emulator and sure enough, I got the same crash.

from auth0.android.

lbalmaceda avatar lbalmaceda commented on June 2, 2024

Same as the the other issue: Please share steps to reproduce and the context in which this has happened, such as the android version or whether a "Custom Tabs" compatible app was installed in that device at the time this exception was thrown.

from auth0.android.

billgockeler avatar billgockeler commented on June 2, 2024

Sorry, we don't have steps to reproduce, we only see intermittent crashes in our app cause by this. We're not using Custom Tabs at all.

The underlying problem with these two issues seems to be that launchAuthenticationIntent() is getting called when the bundle extras are not available. It looks like that shouldn't be happening with your check of '!intentLaunched' - nevertheless it's happening.

from auth0.android.

lbalmaceda avatar lbalmaceda commented on June 2, 2024

I'm closing this due to missing repro steps. See if the issue continues to happen with the latest patch and re-open it if necessary.

from auth0.android.

tplkn avatar tplkn commented on June 2, 2024

@lbalmaceda
To avoid this compile error, developers can add support library
implementation "com.android.support:customtabs:$supportLibraryVersion"
due to support libraries version conflicts some of them can exclude support libraries from this library.
For example

implementation ('com.auth0.android:auth0:1.12.2') {
    exclude group: 'com.android.support'
}

from auth0.android.

lbalmaceda avatar lbalmaceda commented on June 2, 2024

@tplkn thanks. That's a known solution for conflicting dependency versions, but I don't think the exception in the original post is that case. If the rest can leave some feedback it would be appreciated.

from auth0.android.

billgockeler avatar billgockeler commented on June 2, 2024

@lbalmaceda We've updated to 1.12.1 back in Feb but this crash is still occurring and is the most frequent crash on our app. We still cannot repro the error internally. The stack trace is still the same as above.
The only other information we have is that this occurs only on Android version 5 & 7.

Please re-open this issue. Perhaps some other customers will be able to provide more info.

from auth0.android.

jeffbuswell avatar jeffbuswell commented on June 2, 2024

@lbalmaceda We are also seeing this crash, using auth0 version 1.13.0

Caused by java.lang.IllegalArgumentException: Service Intent must be explicit: Intent { act=android.support.customtabs.action.CustomTabsService }
       at android.app.ContextImpl.validateServiceIntent(ContextImpl.java:1345)
       at android.app.ContextImpl.bindServiceCommon(ContextImpl.java:1454)
       at android.app.ContextImpl.bindService(ContextImpl.java:1422)
       at android.content.ContextWrapper.bindService(ContextWrapper.java:636)
       at android.support.customtabs.CustomTabsClient.bindCustomTabsService(CustomTabsClient.java:71)
       at com.auth0.android.provider.CustomTabsController.bindService(CustomTabsController.java:97)
       at com.auth0.android.provider.AuthenticationActivity.launchAuthenticationIntent(AuthenticationActivity.java:115)
       at com.auth0.android.provider.AuthenticationActivity.onResume(AuthenticationActivity.java:80)
       at android.app.Instrumentation.callActivityOnResume(Instrumentation.java:1291)
       at android.app.Activity.performResume(Activity.java:6802)
       at android.app.ActivityThread.performResumeActivity(ActivityThread.java:3439)
       at android.app.ActivityThread.handleResumeActivity(ActivityThread.java:3502)
       at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2761)
       at android.app.ActivityThread.-wrap12(ActivityThread.java)
       at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1495)
       at android.os.Handler.dispatchMessage(Handler.java:102)
       at android.os.Looper.loop(Looper.java:154)
       at android.app.ActivityThread.main(ActivityThread.java:6196)
       at java.lang.reflect.Method.invoke(Method.java)
       at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:888)
       at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:778)

from auth0.android.

lbalmaceda avatar lbalmaceda commented on June 2, 2024

I think there's a tiny chance that the user doesn't have any browser-like app installed (how do they live?!). I'll try to make a PR to validate this and get a patch release for the next week. Hang on!!

from auth0.android.

jeffbuswell avatar jeffbuswell commented on June 2, 2024

@lbalmaceda It might also be that there is no supported customtabs browser?

from auth0.android.

billgockeler avatar billgockeler commented on June 2, 2024

@jeffbuswell Thanks for contributing with your info that helped @lbalmaceda find the fix. This has been a thorn in our side for some time. Please shoot me a note when the fix is posted. Thanks!

from auth0.android.

billgockeler avatar billgockeler commented on June 2, 2024

@lbalmaceda We're testing this fix. You've successfully handled the case when no browser is installed. Thank you. We also tested the condition where the installed browser doesn't support custom tabs and are getting the following crash while you're unbinding the service. We used Opera and Opera mini for our testing.

`07-19 12:23:09.304 30141-30141/tv.fubo.mobile.debug V/CustomTabsController: Trying to bind the service
Bind request result: false
07-19 12:23:09.305 30141-30312/tv.fubo.mobile.debug D/CustomTabsController: Launching URI. Custom Tabs available: false
07-19 12:23:09.420 30141-30146/tv.fubo.mobile.debug I/zygote: Do full code cache collection, code=252KB, data=216KB
07-19 12:23:09.422 30141-30146/tv.fubo.mobile.debug I/zygote: After code cache collection, code=227KB, data=144KB
07-19 12:23:09.574 30141-30226/tv.fubo.mobile.debug D/OpenGLRenderer: endAllActiveAnimators on 0x89e0c300 (InsetDrawable) with handle 0x9036f1d0
07-19 12:23:09.607 30141-30223/tv.fubo.mobile.debug E/UserPrefs: user not found
07-19 12:23:11.365 30141-30141/tv.fubo.mobile.debug V/CustomTabsController: Trying to unbind the service
07-19 12:23:11.365 30141-30141/tv.fubo.mobile.debug D/AndroidRuntime: Shutting down VM

--------- beginning of crash

07-19 12:23:11.369 30141-30141/tv.fubo.mobile.debug E/AndroidRuntime: FATAL EXCEPTION: main
Process: tv.fubo.mobile.debug, PID: 30141
java.lang.RuntimeException: Unable to destroy activity {tv.fubo.mobile.debug/com.auth0.android.provider.AuthenticationActivity}: java.lang.IllegalArgumentException: Service not registered: com.auth0.android.provider.CustomTabsController@6accc92
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4482)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4500)
at android.app.ActivityThread.-wrap5(Unknown Source:0)
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1667)
at android.os.Handler.dispatchMessage(Handler.java:105)
at android.os.Looper.loop(Looper.java:164)
at android.app.ActivityThread.main(ActivityThread.java:6592)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769)
Caused by: java.lang.IllegalArgumentException: Service not registered: com.auth0.android.provider.CustomTabsController@6accc92
at android.app.LoadedApk.forgetServiceDispatcher(LoadedApk.java:1475)
at android.app.ContextImpl.unbindService(ContextImpl.java:1637)
at android.content.ContextWrapper.unbindService(ContextWrapper.java:697)
at com.auth0.android.provider.CustomTabsController.unbindService(CustomTabsController.java:109)
at com.auth0.android.provider.AuthenticationActivity.onDestroy(AuthenticationActivity.java:95)
at android.app.Activity.performDestroy(Activity.java:7186)
at android.app.Instrumentation.callActivityOnDestroy(Instrumentation.java:1270)
at android.app.ActivityThread.performDestroyActivity(ActivityThread.java:4469)
at android.app.ActivityThread.handleDestroyActivity(ActivityThread.java:4500) 
at android.app.ActivityThread.-wrap5(Unknown Source:0) 
at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1667) 
at android.os.Handler.dispatchMessage(Handler.java:105) 
at android.os.Looper.loop(Looper.java:164) 
at android.app.ActivityThread.main(ActivityThread.java:6592) 
at java.lang.reflect.Method.invoke(Native Method) 
at com.android.internal.os.Zygote$MethodAndArgsCaller.run(Zygote.java:240) 
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:769) 
`

from auth0.android.

lbalmaceda avatar lbalmaceda commented on June 2, 2024

@billgockeler ah this was a silly mistake. I forgot to check the service was bound 🤦‍♂️ Let me create a quick patch.

from auth0.android.

lbalmaceda avatar lbalmaceda commented on June 2, 2024

@billgockeler PR is there but circleci is still having issues. I'll make a patch release as soon as I can. 👍

from auth0.android.

billgockeler avatar billgockeler commented on June 2, 2024

perfect, thanks for the prompt response...yeah, we're currently held up by circleci as well

from auth0.android.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.