{"action":"created","issue":{"url":"https://api.github.com/repos/NativeScript/android-runtime/issues/1075","repository_url":"https://api.github.com/repos/NativeScript/android-runtime","labels_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/1075/labels{/name}","comments_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/1075/comments","events_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/1075/events","html_url":"https://github.com/NativeScript/android-runtime/issues/1075","id":328937434,"node_id":"MDU6SXNzdWUzMjg5Mzc0MzQ=","number":1075,"title":"Webview Crash With Android 8.1.0 / Chromium 67.0.3396.68","user":{"login":"sud80","id":2232113,"node_id":"MDQ6VXNlcjIyMzIxMTM=","avatar_url":"https://avatars2.githubusercontent.com/u/2232113?v=4","gravatar_id":"","url":"https://api.github.com/users/sud80","html_url":"https://github.com/sud80","followers_url":"https://api.github.com/users/sud80/followers","following_url":"https://api.github.com/users/sud80/following{/other_user}","gists_url":"https://api.github.com/users/sud80/gists{/gist_id}","starred_url":"https://api.github.com/users/sud80/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/sud80/subscriptions","organizations_url":"https://api.github.com/users/sud80/orgs","repos_url":"https://api.github.com/users/sud80/repos","events_url":"https://api.github.com/users/sud80/events{/privacy}","received_events_url":"https://api.github.com/users/sud80/received_events","type":"User","site_admin":false},"labels":[{"id":213418810,"node_id":"MDU6TGFiZWwyMTM0MTg4MTA=","url":"https://api.github.com/repos/NativeScript/android-runtime/labels/bug","name":"bug","color":"ee0701","default":true},{"id":213418503,"node_id":"MDU6TGFiZWwyMTM0MTg1MDM=","url":"https://api.github.com/repos/NativeScript/android-runtime/labels/severity:%20high","name":"severity: high","color":"ee0701","default":false}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":{"url":"https://api.github.com/repos/NativeScript/android-runtime/milestones/32","html_url":"https://github.com/NativeScript/android-runtime/milestone/32","labels_url":"https://api.github.com/repos/NativeScript/android-runtime/milestones/32/labels","id":3404354,"node_id":"MDk6TWlsZXN0b25lMzQwNDM1NA==","number":32,"title":"4.1.2","description":"","creator":{"login":"vhristov5555","id":7846198,"node_id":"MDQ6VXNlcjc4NDYxOTg=","avatar_url":"https://avatars2.githubusercontent.com/u/7846198?v=4","gravatar_id":"","url":"https://api.github.com/users/vhristov5555","html_url":"https://github.com/vhristov5555","followers_url":"https://api.github.com/users/vhristov5555/followers","following_url":"https://api.github.com/users/vhristov5555/following{/other_user}","gists_url":"https://api.github.com/users/vhristov5555/gists{/gist_id}","starred_url":"https://api.github.com/users/vhristov5555/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vhristov5555/subscriptions","organizations_url":"https://api.github.com/users/vhristov5555/orgs","repos_url":"https://api.github.com/users/vhristov5555/repos","events_url":"https://api.github.com/users/vhristov5555/events{/privacy}","received_events_url":"https://api.github.com/users/vhristov5555/received_events","type":"User","site_admin":false},"open_issues":0,"closed_issues":1,"state":"closed","created_at":"2018-06-06T08:06:51Z","updated_at":"2018-06-06T08:08:37Z","due_on":"2018-06-06T07:00:00Z","closed_at":"2018-06-06T08:08:37Z"},"comments":49,"created_at":"2018-06-04T07:25:54Z","updated_at":"2018-07-20T17:30:46Z","closed_at":"2018-06-06T08:08:14Z","author_association":"NONE","body":"Did you verify this is a real problem by searching the NativeScript Forum\r\nhttps://discourse.nativescript.org/t/webview-causes-app-crash-on-android-with-chrome-67-release/6202\r\n\r\nTell us about the problem\r\nWith the latest chrome (67.0.3396.68) update on Android 8.1.0 webview is crashing. \r\n\r\nPlease provide the following version numbers that your issue occurs with:\r\n- CLI: 3.4.2\r\n- tns-android: 3.4.2\r\n- Android: 8.1.0\r\n- Chromium: 67.0.3396.68\r\n\r\nAfter further debugging, \r\nInvoking 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();) \r\n\r\nAfter 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(); ] . \r\n\r\nPrinting the class names inside the function getTypeMetadata, with latest chrome as webview,  gives class vS, class vR. \r\n\r\nBut 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. \r\n\r\nSo essentially the function getTypeMetadata is not handling classes with empty packages. \r\nSo instaed of:\r\n```\r\nPackage p = (mostOuterClass != null)\r\n                    ? mostOuterClass.getPackage()\r\n                    : clazz.getPackage();\r\nint packageCount = 1;\r\nString pname = p.getName();\r\n```\r\nchanging to:\r\n```\r\nPackage p = (mostOuterClass != null)\r\n                    ? mostOuterClass.getPackage()\r\n                    : clazz.getPackage();\r\nint packageCount = p != null ? 1 : 0;\r\nString pname = p != null ? p.getName() : \"\";\r\n```\r\nThis seems to be fixing the issue."},"comment":{"url":"https://api.github.com/repos/NativeScript/android-runtime/issues/comments/406671367","html_url":"https://github.com/NativeScript/android-runtime/issues/1075#issuecomment-406671367","issue_url":"https://api.github.com/repos/NativeScript/android-runtime/issues/1075","id":406671367,"node_id":"MDEyOklzc3VlQ29tbWVudDQwNjY3MTM2Nw==","user":{"login":"lsowmya","id":29586321,"node_id":"MDQ6VXNlcjI5NTg2MzIx","avatar_url":"https://avatars3.githubusercontent.com/u/29586321?v=4","gravatar_id":"","url":"https://api.github.com/users/lsowmya","html_url":"https://github.com/lsowmya","followers_url":"https://api.github.com/users/lsowmya/followers","following_url":"https://api.github.com/users/lsowmya/following{/other_user}","gists_url":"https://api.github.com/users/lsowmya/gists{/gist_id}","starred_url":"https://api.github.com/users/lsowmya/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lsowmya/subscriptions","organizations_url":"https://api.github.com/users/lsowmya/orgs","repos_url":"https://api.github.com/users/lsowmya/repos","events_url":"https://api.github.com/users/lsowmya/events{/privacy}","received_events_url":"https://api.github.com/users/lsowmya/received_events","type":"User","site_admin":false},"created_at":"2018-07-20T17:30:46Z","updated_at":"2018-07-20T17:30:46Z","author_association":"NONE","body":"\r\nAm facing the same issue.\r\nOn disabling chrome browser in phone, my application works fine.\r\nFind my versions below:-\r\n<img width=\"542\" alt=\"screen shot 2018-07-18 at 2 40 42 pm\" src=\"https://user-images.githubusercontent.com/29586321/43016034-4fa942fc-8c06-11e8-9278-b0fc7f172114.png\">\r\n\r\nCan i have a work around to fix my problem.\r\n"}}
{"actor":{"display_login":"lsowmya"}}