question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

NullPointerException - CustomTabsSession is required for launching a TWA

See original GitHub issue

We 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:closed
  • Created 4 years ago
  • Comments:29 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
andrebancommented, Feb 28, 2020

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?

0reactions
andrebancommented, Jun 2, 2020

This should have been fixed via #92. Please, re-open if using the latest version and still seeing the issue.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found