Trusted Web Activity launch multiple app in svgomg
Reported by
julien.t...@monisnap.com,
Nov 12
|
|||||||
Issue descriptionApplication Version (from "Chrome Settings > About Chrome"): 72 (dev android) Android Build Number (from "Android Settings > About Phone/Tablet"): Android 8.0.0 Device: One plus 3 Steps to reproduce: 1- Launch svgomg (example android app for Trusted web activity) 2- Quit the app (not killed, just in background) 3- Click on the svgomg icon to go back to the app Observed behavior: After clicking on the app icon, a new app is launched beside the old one, as if it was a different app. Expected behavior: After clicking on the icon, the app in background should come back to foreground. Frequency: Always happened <number of times you were able to reproduce> Additional comments:
,
Nov 13
@ julien.tanghe: Could you please provide link to app or attach sample apk to test this issur from our end. If possible please provide screencast along with it, this would help in further triaging of the issue. Thanks!
,
Nov 13
Hello, Please find attached the apk of the app and the screenshot showing the two same app running simultaneously. Thanks in advance for you help !
,
Nov 13
Thank you for providing more feedback. Adding the requester to the cc list. For more details visit https://www.chromium.org/issue-tracking/autotriage - Your friendly Sheriffbot
,
Nov 14
Tested the issue in Android and able to reproduce the issue. Steps Followed: 1. Installed attached apk 2. Opened it, hit home button to quit the app, 3. Again opened app and observed multiple apps in recent tabs Chrome versions tested: 61.0.3162.0 , 72.0.3609.3 [latest canary] , 70.0.3538.80 OS: Android 8.0.0 Android Devices: Nexus 6p Issue is seen from older, hence considering this as Non-Regression and marking as Untriaged for further inputs from dev team. Please navigate to below link for log's -- go/chrome-androidlogs/904409 Thanks!
,
Nov 14
TWA is not WebView, adding the correct components.
,
Nov 15
@ julien.tanghe: Somewhat coincidentally I think I fixed this bug yesterday (so after you'd reported it but before I heard about it)! The fix has landed: https://chromium-review.googlesource.com/c/custom-tabs-client/+/1335796 . How are you building svgomg? If you don't mind messing around with the code locally, you could just copy the code change from LauncherActivity that I linked. Otherwise it may take a bit of time for the fix to make it into the custom-tabs-client github.
,
Nov 15
Hello, It seems to work when i have chrome dev or canary installed so you fixed the problem. However, i there might be a little regression. If i want to open it as a custom tabs (not a Trusted web activity) on devices that have chrome stable the app crash (i just modified the Chrome package from "com.google.android.apps.chrome" to "com.android.chrome" in the LauncherActivity so my chrome could open). I tried to adapt the code by mixing it with the code from TwaSessionHelper (https://github.com/GoogleChrome/custom-tabs-client/blob/master/svgomg/src/main/java/org/chromium/twa/svgomg/TwaSessionHelper.java) but the function "getSession" seems to not returning anything, even in the callback function. Could you tell me if it's a real issue or just my implementation that is bad ? Thanks you very much for the support !
,
Nov 15
This is the error i get : java.lang.NullPointerException: Attempt to invoke virtual method 'boolean android.support.customtabs.CustomTabsSession.validateRelationship(int, android.net.Uri, android.os.Bundle)' on a null object reference at com.monisnap.monisnap.TwaSessionHelper.onServiceConnected(TwaSessionHelper.java:194) at org.chromium.customtabsclient.shared.ServiceConnection.onCustomTabsServiceConnected(ServiceConnection.java:38) at android.support.customtabs.CustomTabsServiceConnection.onServiceConnected(CustomTabsServiceConnection.java:44) at android.app.LoadedApk$ServiceDispatcher.doConnected(LoadedApk.java:1685) at android.app.LoadedApk$ServiceDispatcher$RunConnection.run(LoadedApk.java:1714) at android.os.Handler.handleCallback(Handler.java:789) at android.os.Handler.dispatchMessage(Handler.java:98) at android.os.Looper.loop(Looper.java:164) at android.app.ActivityThread.main(ActivityThread.java:6798) 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:767)
,
Nov 16
As per comment#7 owner is already available, hence changing the status to Assigned. Please feel free to change if this is not the case. Thanks!
,
Nov 21
Hello, The problem is still unresolved. I think there was a regression because when i use the code of the public github, the classic custom tab launch if the user don't have chrome dev/canary installed. Please find attached some additional information : - Change i've made to launch chrome classic custom tab - Error i get Thanks in advance for you help !
,
Nov 21
Hello again, I actually solved my problem using the old CustomTabsClient.java file (found in the custom tabs public repository : https://github.com/GoogleChrome/custom-tabs-client ) and modify it to remove unused/deprecated code and adding null parameter to "return new CustomTabsSession(mService, wrapper, mServiceComponentName, null);" at the end of the file. The modified file is attached to this message. I will do more test to see if everything is ok but so far it seems to work very well. |
|||||||
►
Sign in to add a comment |
|||||||
Comment 1 by chelamcherla@chromium.org
, Nov 13