Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Webview Crash With Android 8.1.0 / Chromium 67.0.3396.68 #1075

Closed
sud80 opened this issue Jun 4, 2018 · 51 comments
Closed

Webview Crash With Android 8.1.0 / Chromium 67.0.3396.68 #1075

sud80 opened this issue Jun 4, 2018 · 51 comments

Comments

@sud80
Copy link

sud80 commented Jun 4, 2018

Did you verify this is a real problem by searching the NativeScript Forum
https://discourse.nativescript.org/t/webview-causes-app-crash-on-android-with-chrome-67-release/6202

Tell us about the problem
With the latest chrome (67.0.3396.68) update on Android 8.1.0 webview is crashing.

Please provide the following version numbers that your issue occurs with:

  • CLI: 3.4.2
  • tns-android: 3.4.2
  • Android: 8.1.0
  • Chromium: 67.0.3396.68

After further debugging,
Invoking of onReceivedError on webviewclient is causing the null pointer exception in Runtime.java (https://github.com/NativeScript/android-runtime/blob/v3.4.2/test-app/runtime/src/main/java/com/tns/Runtime.java), Line number 682: (String pname = p.getName();)

After the chrome update on the device, the 2nd(android.webkit.WebResourceRequest) and 3rd (android.webkit.WebResourceError) parameters of function onReceivedError of WebViewClient received object whose class is having empty package. This causes line 679 of https://github.com/NativeScript/android-runtime/blob/v3.4.2/test-app/runtime/src/main/java/com/tns/Runtime.java [clazz.getPackage();] to return null. And subsequently this causes null pointer exception on line 682 of same file [ String pname = p.getName(); ] .

Printing the class names inside the function getTypeMetadata, with latest chrome as webview, gives class vS, class vR.

But in the device if I select to use android webview instead of chrome webview, it gives class as com.android.webview.chromium.xz, com.android.webview.chromium.WL.

So essentially the function getTypeMetadata is not handling classes with empty packages.
So instaed of:

Package p = (mostOuterClass != null)
                    ? mostOuterClass.getPackage()
                    : clazz.getPackage();
int packageCount = 1;
String pname = p.getName();

changing to:

Package p = (mostOuterClass != null)
                    ? mostOuterClass.getPackage()
                    : clazz.getPackage();
int packageCount = p != null ? 1 : 0;
String pname = p != null ? p.getName() : "";

This seems to be fixing the issue.

@erjdriver
Copy link

erjdriver commented Jun 4, 2018

I'm running into a similar crash if the url one is visiting is redirected.

The problem seems to do with the latest Chrome update and happens on Android 7.0 also.

If I go with an older version of Chrome - works fine.

This is with tns android 4.1.1

Is there a file I can modify to get this fixed?

`An uncaught Exception occurred on "main" thread.
com.tns.NativeScriptException: Java Error!
at com.tns.Runtime.callJSMethodNative(Native Method)
at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1100)
at com.tns.Runtime.callJSMethodImpl(Runtime.java:982)
at com.tns.Runtime.callJSMethod(Runtime.java:969)
at com.tns.Runtime.callJSMethod(Runtime.java:953)
at com.tns.Runtime.callJSMethod(Runtime.java:945)
at com.tns.gen.android.webkit.WebViewClient_view_15_32_WebViewClientImpl.shouldOverrideUrlLoading(WebViewClient_view_15_32_WebViewClientImpl.java:25)
at yk.b(PG:89)
at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:172)
at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
at org.chromium.base.SystemMessageHandler.handleMessage(PG:9)
at android.os.Handler.dispatchMessage(Handler.java:102)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6692)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1468)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1358)
Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Package.getName()' on a null object reference
at com.tns.Runtime.getTypeMetadata(Runtime.java:694)
at com.tns.Runtime.getTypeMetadata(Runtime.java:672)
... 17 more

`

@sud80
Copy link
Author

sud80 commented Jun 4, 2018

@erjdriver the fix I have said in the first post should take care of this as well. For us also it was happening on shouldOverrideUrlLoading as well but on android 8.1.
I am surprised it is happening in Android 4.1.1 as well. What is the webview and chrome version?

If you want to try the fix locally:
You can clone the project, make the above said change, build the project locally (https://github.com/NativeScript/android-runtime/#how-to-build), install the newly built directory as your android platform (tns platform add android --framework-path )

@erjdriver
Copy link

erjdriver commented Jun 4, 2018

Thanks for the quick response.

Chrome 67.0.3396.68

Not sure about webview - my understanding is Chrome disables the installed webview.

I don't have the setup to do a local build - I hope these guys fix it asap.

Is there a change I can make in javascript from within Code editor - that'll fix this . I don't have the Android Studio etc installed.

Thanks for reporting.

@sud80
Copy link
Author

sud80 commented Jun 4, 2018

@erjdriver are you sure the android version is 4.1.1? The chrome 67.0.3396.68 was not available when I checked below android 8.1.

As far as I understand, I don't think you can fix this from javascript side as the issue happens during a javascript call from native side.

@erjdriver
Copy link

I'm using tns android platform version 4.1.1

The Android version on my device is 7.0

My Chrome version is the same that's on the title of this thread.

@mspusta78
Copy link

I am having same issue. I tested Android 7.0 and 8.1.0 and the issues occurs when Chrome 67 is installed.
What can we do with productions apps that are crashing?
Is there a fix for this?

@erjdriver
Copy link

I believe the solution is provided by @sud80 above - requires you cloning and building the android module on your pc.

Other is to wait for it to be fixed by NS.

@mspusta78
Copy link

mspusta78 commented Jun 4, 2018 via email

@Guatom
Copy link

Guatom commented Jun 4, 2018

@mspusta78, only unsafe methods as far as I know, you have to get the old APK and manually install it.

@surdu
Copy link

surdu commented Jun 4, 2018

You can "uninstall" Chrome to fix the issue. It will downgrade Chrome to the factory version, but it fixes the problem until we have the NS fix.

@mspusta78
Copy link

mspusta78 commented Jun 5, 2018

@erjdriver I was able to clone the android module app but I am having hard time building it and I am not sure how to use it in my project. @sud80 sud80 Any insight or steps on how to do it?

@sud80
Copy link
Author

sud80 commented Jun 5, 2018

@mspusta78

  1. Clone the project
  2. make the above said change
  3. build the project locally (https://github.com/NativeScript/android-runtime/#how-to-build). Follow the instructions in the link. Make sure you have android sdk's and tool's installed. (I have android studio from which I manage the sdks installed). You need to specifically have the NDK from the tools also installed. This will create the build in the dist directory.
  4. install the newly built runtime as your android platform
    command: tns platform add android --framework-path path_to_dist_directory
  5. build your app as usual. At this step it might be possible that your build is failing due to NDK tool installed.
    A problem occurred starting process 'command '/mypath/android-sdk/ndk-bundle/toolchains/mips64el-linux-android-4.9/prebuilt/darwin-x86_64/bin/mips64el-linux-android-strip''
    In such case, as temporary measure, just remove the tool directory either by unclicking in the android studio or by just moving the directory (/mypath/android-sdk/ndk-bundle/) out. You can again move back or install the ndk back when you need to build the android runtime.

Hope this helps.

@vtrifonov
Copy link
Contributor

Thanks for reporting and looking into this @sud80. I've applied the proposed changes and it's now on PR. We'll create a patch for this as long as it's ready.

Meanwhile here's how you can easily debug the android runtime in your own project.

@mspusta78
Copy link

@vtrifonov Will you apply the fix to NS 3.4.2 as well? How can we get this fix and apply this patch?
We have several thousand users unable to use our apps due to this issue.

If {N} wants to be used for enterprise level applications issues like these need to be prevented in the future. When issues like these arise it makes me reconsider the choice of {N} vs. pure native development.

I enjoy working with {N} so I hope that {N} team will learn from this and prevent issues like these in the future from occurring.

@vtrifonov
Copy link
Contributor

vtrifonov commented Jun 5, 2018

@mspusta78 We will create 3.4.3 patch as well so that you could easily fix your applications.
I encourage you to upgrade to the latest version as there are a lot of improvements especially in the android runtime.
About the issue - it was caused by a change in the Chrome behaviour which we didn't expect. We are doing our best to work with android betas in order to make sure that there are no issues before the version gets official.
However we try to test the WebView with Chrome Beta so that we could catch such issues earlier.

In the meantime @sud80 you can check if android@rc works. We will release official package once we're ready.

@mspusta78
Copy link

@vtrifonov Thank you for your detailed feedback. I believe that testing with Chrome Beta will prevent these issues in the future. I have updated to the latest version of {N}.

Do you have ETA on the official package release to address this issue? ... or should we do

tns update next

@vtrifonov
Copy link
Contributor

I guess the official 4.1.2 package will be ready tomorrow. Until then please use android@rc but not @next as this is what will be released in 4.1.2.
Does it mean that you don’t need a fix for the 3.4.2 version?

@mspusta78
Copy link

@vtrifonov correct. I'll be upgrading all my projects to 4.1 today

@mspusta78
Copy link

@vtrifonov I did as you suggested: tns update @rc

which installed
nativescript@4.1.1-2018-06-05-11757

but I still keep getting

System.err: com.tns.NativeScriptException: Java Error!
System.err: at com.tns.Runtime.callJSMethodNative(Native Method)
System.err: at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1100)
System.err: at com.tns.Runtime.callJSMethodImpl(Runtime.java:982)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:969)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:953)
System.err: at com.tns.Runtime.callJSMethod(Runtime.java:945)
System.err: at com.tns.gen.android.webkit.WebViewClient_view_15_32_WebViewClientImpl.shouldOverrideUrlLoading(WebViewClient_view_15_32_WebViewClientImpl.java:25)
System.err: at yk.b(PG:89)
System.err: at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:172)
System.err: at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native Method)
System.err: at org.chromium.base.SystemMessageHandler.handleMessage(PG:9)
System.err: at android.os.Handler.dispatchMessage(Handler.java:106)
System.err: at android.os.Looper.loop(Looper.java:164)
System.err: at android.app.ActivityThread.main(ActivityThread.java:6494)
System.err: at java.lang.reflect.Method.invoke(Native Method)
System.err: at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:438)
System.err: at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:807)
System.err: Caused by: java.lang.NullPointerException: Attempt to invoke virtual method 'java.lang.String java.lang.Package.getName()' on a null object reference
System.err: at com.tns.Runtime.getTypeMetadata(Runtime.java:694)
System.err: at com.tns.Runtime.getTypeMetadata(Runtime.java:672)

@vtrifonov
Copy link
Contributor

vtrifonov commented Jun 5, 2018

@mspusta78 can you try with tns platform add android@rc?

@mspusta78
Copy link

mspusta78 commented Jun 5, 2018 via email

@mspusta78
Copy link

mspusta78 commented Jun 6, 2018 via email

@vtrifonov
Copy link
Contributor

@mspusta78 Did you runtns update rc or tns update @rc. The second one should have thrown an error and no changes will be made in you project.
If you want to update just the android runtime to its latest version you need to run either tns platform add android@rc or tns platform update android@rc. It was my mistake that at first I wrote you the wrong command tns add android@rc, but I've updated it to the right command 2 minutes after that so maybe you were looking at my original post.
However we are going to release official version in a while and you will be able to update to the latest official 4.1.2 version.

@radeva
Copy link

radeva commented Jun 6, 2018

Hi mspusta78,

Thanks for reporting the issue and being active on this thread.
NativeScript is an open-source technology which allows everyone using it to apply an immediate patch in case of urgency. It's visible from the conversation above that the team is doing its best to do the fix and provide options for it to be applied before the official patch is out. So, as a conclusion, I could say that the issue is considered priority 1.

On a separate note, I can assure you and all the community that the team will review how to improve its internal procedures for situations like this one.

Best regards,
Veselina

@mspusta78
Copy link

@vtrifonov Trust me I have tried all of the above
tns platform update android@rc
tns platform add android@rc
tns update rc

and all was failing. I just tried running
tns update rc

and it succeed.

Gradle build...
Platform android successfully removed.
Successfully removed plugin tns-core-modules
Successfully removed plugin tns-core-modules-widgets
Copying template files...

  • Installing tns-android
  • tns-android@4.1.2-rc-2018-06-05-02

Thank you for fixing RC release so we can build it.

@mspusta78
Copy link

@radeva I appreciate your feedback and your point of view on this matter, but I will politely disagree with your analysis and conclusion.

All of our production environments have been down since May 31st. It is now June 6th! Excuse my frustration, but being down for 7 days is unacceptable and hardly considered as speedy solution. (considering that the solution was provided on day 2)

Keep in mind that it will take us another day to wrap up this patch and get it implemented so our users will not get this release for another day.

Someone dropped a ball here and it was definitely not us. I am sharing this feedback so you may use it in your discussion when reviewing your internal process because if you consider the delivery and time frame of this patch as acceptable I will have to consider switching our platform.

Being down for 7 days is not an option in this day and age.

Sincerely,

Martin

@vhristov5555 vhristov5555 added this to the 4.1.2 milestone Jun 6, 2018
@vhristov5555
Copy link

The issue is fixed and released in tns-android@4.1.2 version.

@sud80
Copy link
Author

sud80 commented Jun 6, 2018

@vtrifonov @vhristov5555 It will be helpful if you can create a patch release for 3.4.2 as well.

@jeffswitzer
Copy link

Can confirm tns platform update android@rc fixed the issue here. Thanks all!

@erjdriver
Copy link

Thanks NS!

Also big thanks to @sud80 for reporting the problem and finding the solution.

@mspusta78
Copy link

mspusta78 commented Jun 6, 2018 via email

@drice
Copy link

drice commented Jun 6, 2018

@vtrifonov Is there an ETA for a 3.4.3 patch?

@dtopuzov
Copy link
Contributor

dtopuzov commented Jun 6, 2018

@tbsf We are working on it, I hope it will be very soon.

@dtopuzov
Copy link
Contributor

dtopuzov commented Jun 6, 2018

@tbsf @erjdriver @mspusta78 @jeffswitzer @sud80
tns-android@3.4.3 is available in npm.

Release notes:
https://github.com/NativeScript/android-runtime/releases/tag/v3.4.3

@murphyben
Copy link

Also would like to thank @sud80 for migrating our forum concern into a github issue with much more detail. We're new to this platform and appreciate the support.

@spmamidi
Copy link

+1

@TheOnlyMatt
Copy link

TheOnlyMatt commented Jun 19, 2018

I updated to android 3.4.3 but still got the crash
Is there something that I might have missed ?

Here are my components version :

│ Component │ Current version │ Latest version │ Information │
│ nativescript │ 3.4.0 │ 4.1.1 │ Update available │
│ tns-core-modules │ 3.4.0 │ 4.1.0 │ Update available │
│ tns-android │ 3.4.3 │ 4.1.3 │ Update available │
│ tns-ios │ 3.4.1 │ 4.1.1 │ Update available │

I don't want to update right now {N}4 because I don't have time to check up again the whole app, nor to make some code changes. That's why I'd like to stay on the 3rd version for the moment, but I really need to get this bug fixed.

EDIT :
I finally updated my whole projet to {N} 4.1.1 and tns-android 4.1.3 but stil got the same callJSMethod error about shouldOverrideUrl blablabla ...

@vhristov5555
Copy link

Hi,
We have tested it on Nexus 5x with latest version of Chrome and it works on our side with tns-android 3.4.3 and 4.1.3.
Could you please give us some more information:

  • What kind of device are you testing on?
  • Could please send us the package.json of your app?

@TheOnlyMatt
Copy link

This issue is happening on a Samsung Galaxy S7, running with Android 8.0.0.
Chrome is in V67.0.3396.87.

Here is my package.json

{
  "description": "NativeScript Application",
  "license": "SEE LICENSE IN <your-license-filename>",
  "readme": "NativeScript Application",
  "repository": "<fill-your-repository-here>",
  "nativescript": {
    "id": "com.xxx.xxx",
    "tns-android": {
      "version": "4.1.1"
    }
  },
  "android": {
    "v8Flags": "--expose_gc"
  },
  "dependencies": {
    "@angular/animations": "~5.1.0",
    "@angular/common": "~5.1.0",
    "@angular/compiler": "~5.1.0",
    "@angular/core": "~5.1.0",
    "@angular/forms": "~5.1.0",
    "@angular/http": "~5.1.0",
    "@angular/platform-browser": "~5.1.0",
    "@angular/platform-browser-dynamic": "~5.1.0",
    "@angular/router": "~5.1.0",
    "html-entities": "^1.2.1",
    "nativescript": "^4.1.1",
    "nativescript-accordion": "^5.0.3",
    "nativescript-angular": "~5.3.0",
    "nativescript-calendar": "^1.3.0",
    "nativescript-carousel": "^3.1.1",
    "nativescript-directions": "^1.1.0",
    "nativescript-drop-down": "^3.2.0",
    "nativescript-effects": "^1.0.0",
    "nativescript-email": "^1.5.1",
    "nativescript-floatingactionbutton": "^4.1.3",
    "nativescript-geolocation": "^4.2.0",
    "nativescript-google-maps-sdk": "^2.6.0",
    "nativescript-iqkeyboardmanager": "^1.1.0",
    "nativescript-loading-indicator": "^2.4.0",
    "nativescript-phone": "^1.3.1",
    "nativescript-plugin-firebase": "^6.2.0",
    "nativescript-pro-ui": "~3.3.0",
    "nativescript-pulltorefresh": "^2.0.2",
    "nativescript-ripple": "^2.0.0",
    "nativescript-theme-core": "~1.0.4",
    "nativescript-toast": "^1.4.6",
    "reflect-metadata": "~0.1.10",
    "rxjs": "~5.5.5",
    "tns-core-modules": "^4.0.0",
    "zone.js": "~0.8.18"
  },
  "devDependencies": {
    "@angular/compiler-cli": "~6.0.5",
    "@ngtools/webpack": "~1.9.1",
    "babel-traverse": "6.26.0",
    "babel-types": "6.26.0",
    "babylon": "6.18.0",
    "codelyzer": "~4.0.2",
    "copy-webpack-plugin": "~4.3.0",
    "css-loader": "~0.28.7",
    "extract-text-webpack-plugin": "~3.0.2",
    "lazy": "1.0.11",
    "nativescript-css-loader": "~0.26.0",
    "nativescript-dev-sass": "~1.3.5",
    "nativescript-dev-typescript": "^0.7.1",
    "nativescript-dev-webpack": "~0.9.1",
    "nativescript-worker-loader": "~0.8.1",
    "node-sass": "4.5.3",
    "raw-loader": "~0.5.1",
    "resolve-url-loader": "~2.2.1",
    "sass-loader": "~6.0.6",
    "tns-platform-declarations": "^3.3.0",
    "tslint": "~5.8.0",
    "typescript": "~2.7.2",
    "uglifyjs-webpack-plugin": "~1.1.6",
    "webpack": "~3.10.0",
    "webpack-bundle-analyzer": "^2.9.1",
    "webpack-sources": "~1.1.0"
  }
}

@vhristov5555
Copy link

Sorry for the inconvenience caused.

From your package.json I could see that you are using:

"tns-android": {
      "version": "4.1.1"
    }

The fix of the problem is introduced in tns-android 4.1.2 and above.
Could you please execute the following commands and check if the problem is resolved:

tns platform remove android
tns platform add android@4.1.3

@TheOnlyMatt
Copy link

Yes I saw that (I dowgraded since yesterday because I had an other issue to solve) so I just updated.
I ran tns platform update android@4.1.3. I don't know if it's enough or if I need to rm then add as you said but the version is now well set to 4.1.3 in my package.json.
But the app still crash on link opening

@vhristov5555
Copy link

Could please try this project from The Playground(https://play.nativescript.org/?template=play-ng&id=dDxibY) on your device?
You should install the Playground app and Preview app from the Play Store and scan the QR code.
Could please click on any link in the web view and check if the problem is still reproducible?

@TheOnlyMatt
Copy link

Everything is working fine with your project.
I just investigated some points of my app and here what I state :

  • The link were opening on a Wiko with an older android version. After have updated the whole project to {N}4 the link are no more opening on a S7 with Android 8 neither on the Wiko.

  • When clicking on a link with the shouldOverrideUrlLoading function app crash on both devices

  • When clicking on a link with the shouldOverrideUrlLoading function commented nothing happens (links don't even open)

  • This was working on the Wiko with the previous {N} version, and on the S7 with previous {N} version with Android 7

Here is the code involved :

webviewLoaded(args){
        let self = this
        let webView : WebView = args.object

        if (webView.android) {
            //Disable webview zoom buttons
            webView.android.getSettings().setBuiltInZoomControls(true)
            webView.android.getSettings().setDisplayZoomControls(false)

            try {
                //intercept url loading
                var WebViewClientClass = android.webkit.WebViewClient;
                var MyWebViewClient = WebViewClientClass.extend({
                    shouldOverrideUrlLoading: function(_webView,interceptedUrl){
                        let url = interceptedUrl

                        console.dir(url)

                        if (typeof interceptedUrl === 'string')
                            url = ""+interceptedUrl
                        else if(typeof interceptedUrl.getUrl() === 'function')
                            url = ""+interceptedUrl.getUrl()
                        else if(typeof interceptedUrl.getUrl() === 'object')
                            url = ""+interceptedUrl.getUrl()

                        if(url != "" && typeof url === 'string'){
                            if (WebViewHelper.isMailAddress(url)) {
                                self.sendMail({to: url})
                                return true
                            }
                            else if (WebViewHelper.isWebUrl(url)) {
                                self.openWebViewLink(_webView, url)
                                return true
                            }
                        }
                        else
                            return false
                    }
                });
                webView.android.setWebViewClient(new MyWebViewClient());
            } catch(e) {
                console.log(e.message);
            }
        }
    }

@vtrifonov
Copy link
Contributor

Can you please add the code of your openWebViewLink to this playground session https://play.nativescript.org/?template=play-tsc&id=69PonZ&v=2 as we couldn't reproduce the issue. Can you as well post the exact error you get?

@TheOnlyMatt
Copy link

Ok I just posted the method's code.

I absolutely don't know why (didn't change any code), but the link opening is now working back on the Wiko, but is still broken on GS7.

Here is the exact error I get :

06-20 11:48:39.328 24493 24493 F zygote  : java_vm_ext.cc:504]     from java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[])
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at com.tns.Runtime.callJSMethodNative(Native method)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at com.tns.Runtime.callJSMethodImpl(Runtime.java:983)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at com.tns.Runtime.callJSMethod(Runtime.java:970)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at com.tns.Runtime.callJSMethod(Runtime.java:954)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at com.tns.Runtime.callJSMethod(Runtime.java:946)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:172)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native method)
06-20 11:48:39.329 24493 24493 F zygote  : java_vm_ext.cc:504]   at org.chromium.base.SystemMessageHandler.handleMessage(PG:9)
06-20 11:48:39.329 24493 24493 F zygote  : runtime.cc:516]     from java.lang.Object com.tns.Runtime.callJSMethodNative(int, int, java.lang.String, int, boolean, java.lang.Object[])
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at com.tns.Runtime.callJSMethodNative(Native method)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at com.tns.Runtime.dispatchCallJSMethodNative(Runtime.java:1101)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at com.tns.Runtime.callJSMethodImpl(Runtime.java:983)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at com.tns.Runtime.callJSMethod(Runtime.java:970)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at com.tns.Runtime.callJSMethod(Runtime.java:954)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at com.tns.Runtime.callJSMethod(Runtime.java:946)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at org.chromium.android_webview.AwContentsClientBridge.shouldOverrideUrlLoading(PG:172)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at org.chromium.base.SystemMessageHandler.nativeDoRunLoopOnce(Native method)
06-20 11:48:39.330 24493 24493 F zygote  : runtime.cc:516]   at org.chromium.base.SystemMessageHandler.handleMessage(PG:9)
06-20 11:48:39.470 24665 24493 F google-breakpad: M DE588000 00000000 00003000 D163ABBC2C813D808B87710B7FDB5B7A0 libwebviewchromium_loader.so
06-20 11:48:39.471 24665 24493 F google-breakpad: M E81AA000 00000000 00004000 4351725643D0F3E81C52C60CE9B8AFF40 libwebviewchromium_plat_support.so
ActivityManager: Process com.my.app (pid 24493) has died: fore TOP (224,903)
ActivityManager: Force removing ActivityRecord{d7f84e u0 com.my.app/com.tns.NativeScriptActivity t8897}: app died, no saved state
06-20 11:48:39.692  5090  6170 D ActivityManagerPerformance: AMP_acquire() HOME
ActivityManager: Killing 24612:com.android.chrome:sandboxed_process0/u0a277i207 (adj 0): isolated not needed
ActivityManager: setHasOverlayUi called on unknown pid: 24493
ActivityManager: post active user change for 0 fullscreen true isHomeActivity() true

@vtrifonov
Copy link
Contributor

Can you try to add all your functionality regarding the WebView in the playground session and reproduce it there, or give us a repo to reproduce it as otherwise it's hard for us to find what's causing this error. In the openWebViewLink method you've added there's a call to self.dispatcher which is null in our case.

@TheOnlyMatt
Copy link

TheOnlyMatt commented Jun 20, 2018

Sorry my bad I didn't pay attention to this !
I just want to point out that in my case the app is supposed to show a log (console.dir(url)), when passing through the override, but this log is not event fired before the app crashes. So I guess the problem is inside the extend method.

Do you see the changes I have made in the code ? Not sure it is correctly saved in your project

@vtrifonov
Copy link
Contributor

There seems to be an issue with the console.dir(url) function. I'm using the following project https://play.nativescript.org/?template=play-tsc&id=69PonZ&v=6 and it crashes on a Nexus 5X with Chrome Beta when using console.dir, but if I comment it or change it to console.log(url) it works. I guess you're having the same problem. So for now do not use console.dir there, we will investigate further what's causing the crash.

@TheOnlyMatt
Copy link

Looks like it's the point, sorry to see that the cause was so dumb ...
Thank you very much for your help and your reactivity !

@lsowmya
Copy link

lsowmya commented Jul 20, 2018

Am facing the same issue.
On disabling chrome browser in phone, my application works fine.
Find my versions below:-
screen shot 2018-07-18 at 2 40 42 pm

Can i have a work around to fix my problem.

@vtrifonov
Copy link
Contributor

@lsowmya you need to upgrade either to tns-android 3.4.3 or tns-android 4.1.3 or later where the issue is fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests