NullPointerException - CustomTabsSession is required for launching a TWA
See original GitHub issueWe recently launched our TWA application and saw a few of these crashes come in. We are using 0.1.0-alpha1. I have not experienced this issue myself so I have no way of reproducing it.
java.lang.NullPointerException: CustomTabsSession is required for launching a TWA
at androidx.browser.trusted.TrustedWebActivityIntentBuilder.build(TrustedWebActivityIntentBuilder.java:15)
at com.google.androidbrowserhelper.trusted.TwaLauncher.launchWhenSplashScreenReady(TwaLauncher.java:2)
at com.google.androidbrowserhelper.trusted.TwaLauncher.lambda$launchWhenSessionEstablished$2(TwaLauncher.java:1)
at com.google.androidbrowserhelper.trusted.-$$Lambda$TwaLauncher$wy2yMaTyWzqDYy88T6GKCwq94sM.run
at com.google.androidbrowserhelper.trusted.splashscreens.PwaWrapperSplashScreenStrategy.onSplashImageTransferred(PwaWrapperSplashScreenStrategy.java:2)
at com.google.androidbrowserhelper.trusted.splashscreens.-$$Lambda$PwaWrapperSplashScreenStrategy$w9o5iqMEy62ZZ2i_sMAmRiQ7IGw.onFinished
at com.google.androidbrowserhelper.trusted.splashscreens.SplashImageTransferTask$1.onPostExecute(SplashImageTransferTask.java:3)
at android.os.AsyncTask.finish(AsyncTask.java:695)
at android.os.AsyncTask.access$600(AsyncTask.java:180)
at android.os.AsyncTask$InternalHandler.handleMessage(AsyncTask.java:712)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:214)
at android.app.ActivityThread.main(ActivityThread.java:7050)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:493)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:965)
Issue Analytics
- State:
- Created 4 years ago
- Comments:29 (12 by maintainers)
Top Results From Across the Web
NullPointerException when using Trusted Web Activities on ...
I believe this is happening on this line where session is null, which is an object of type CustomTabsSession . Here's the source....
Read more >Google Chrome TWA: Android App Startup Crash
NullPointerException : Attempt to invoke virtual method 'boolean android.support.customtabs.CustomTabsSession.validateRelationship(int ...
Read more >Diff - custom-tabs-client - Google Git
... if (session == null) { - throw new NullPointerException("CustomTabsSession is required for launching a TWA"); - } - - CustomTabsIntent.
Read more >android.support.customtabs.CustomTabsSession Java Exaples
public Intent build(CustomTabsSession session) { if (session == null) { throw new NullPointerException("CustomTabsSession is required for launching a TWA"); } ...
Read more >Source Code for TrustedWebActivityIntentBuilder.java
@param uri The web page to launch as Trusted Web Activity. ... null) { throw new NullPointerException("CustomTabsSession is required for launching a TWA");...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
Linking to the issue on bugs.chromium.org: https://bugs.chromium.org/p/chromium/issues/detail?id=1052367
@rockeynebhwani would you have an updated list of devices where the crash is happening?
This should have been fixed via #92. Please, re-open if using the latest version and still seeing the issue.