Titanium JIRA Archive
Titanium SDK/CLI (TIMOB)

[TIMOB-27450] iOS: App Crash when using $.webview.setBasicAuthentication since SDK 8.x

GitHub Issuen/a
TypeBug
PriorityCritical
StatusClosed
ResolutionFixed
Resolution Date2019-11-06T22:19:37.000+0000
Affected Version/sRelease 8.0.0
Fix Version/sRelease 8.3.0
Componentsn/a
Labelsn/a
Reporterdbenhenni
AssigneeJan Vennemann
Created2019-09-05T06:06:18.000+0000
Updated2019-11-06T22:19:37.000+0000

Description

Steps to Reproduce

create Alloy project running a WebView with a $.webview.setBasicAuthentication(param1, param2, param3) in it.

Actual Result

Titanium SDK 7.x and prior: everything's ok Since SDK 8.x: App Crash
[ERROR] :  Script Error {
[ERROR] :      column = 35;
[ERROR] :      line = 88;
[ERROR] :      message = 'invalid method '(null)'';
[ERROR] :      nativeStack = '3   TitaniumKit0x0000000112bd7ec2 __KrollCallAsFunction_block_invoke + 30
4   TitaniumKit0x0000000112bd7cce KrollCallAsFunction + 450
5   JavaScriptCore  0x000000010dd76053 _ZN3JSC16JSCallbackObjectINS_20JSDestructibleObjectEE4callEPNS_9ExecStateE + 531
6   JavaScriptCore  0x000000010e21bb64 _ZN3JSC5LLInt9setUpCallEPNS_9ExecStateENS_22CodeSpecializationKindENS_7JSValueEPNS_17LLIntCallLinkInfoE + 404
7   JavaScriptCore  0x000000010dd41011 llint_entry + 61950
8   JavaScriptCore  0x000000010dd4173b llint_entry + 63784
9   JavaScriptCore  0x000000010dd4101f llint_entry + 61964
10  JavaScriptCore  0x000000010dd31c59 vmEntryToJavaScript + 200
11  JavaScriptCore  0x000000010e117f03 _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 467
12  JavaScriptCore  0x000000010e35ded4 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 196
13  JavaScriptCore  0x000000010dd7d018 JSObjectCallAsFunction + 488
14  TitaniumKit0x0000000112bb4a1e TiBindingEventProcess + 670
15  TitaniumKit0x0000000112bd5f71 -[KrollContext invoke:] + 109
16  TitaniumKit0x0000000112bd5fe4 -[KrollContext enqueue:] + 93
17  TitaniumKit0x0000000112bdda9e TiBindingRunLoopEnqueue + 82
18  TitaniumKit0x0000000112bdc1c4 -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 164
19  TitaniumKit0x0000000112bbcbce -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224
20  TitaniumKit0x0000000112bdbfce -[TiProxy fireEvent:withObject:propagate:] + 76
21  TitaniumKit0x0000000112bad097 -[TiUIView touchesEnded:withEvent:] + 110
22  UIKitCore  0x000000011fcda4e6 -[UIWindow _sendTouchesForEvent:] + 2547';
[ERROR] :      sourceURL = 'file:///Users/dnasiri/Library/Developer/CoreSimulator/Devices/5952FC7C-2DBE-448F-8CCC-335B97F14C61/data/Containers/Bundle/Application/4F5F7478-C89F-407D-AA44-C2D97C81D44C/webviewtest.app/alloy/controllers/myWebview.js';
[ERROR] :      stack = '    at [native code]
    at Controller(/alloy/controllers/myWebview.js:88:35)
    at createController(/alloy.js:428:53)
    at doClick(/alloy/controllers/index.js:54:43)';
[ERROR] :      toJSON = '<KrollCallback: 0x6000004a7c40>';
[ERROR] :  }

Expected Result

no crash

Attachments

FileDateSize
.log2019-09-05T06:06:22.000+00006377072
app.zip2019-09-05T06:06:38.000+00005000274
diagnostic4291898333399001006.log2019-09-05T06:06:34.000+0000301778

Comments

  1. Jebun Naher 2019-09-07

    Hi [~dbenhenni], In which platform do you experience this crash? Android or iOS?
  2. dbenhenni 2019-09-09

    Hi @jnaher, on iOS.
  3. Rakhi Mitro 2019-09-09

    [~dbenhenni], Can you please verify that is the app is crashing on 8.1.1.GA?
  4. dbenhenni 2019-09-09

    The app runs properly with SDK 7.5.1 and prior. From SDK 8.0.0.GA till current Version 8.1.1.GA it crashes
  5. Rakhi Mitro 2019-09-24

    [~dbenhenni], We tested the project attached by you. Clicking on "Hello World", we are getting following error on simulator:
       [ERROR] :  Script Error {
       [ERROR] :      column = 35;
       [ERROR] :      line = 88;
       [ERROR] :      message = "invalid method '(null)'";
       [ERROR] :      nativeStack = "3   TitaniumKit0x000000010688f4f7 __KrollCallAsFunction_block_invoke + 30\n4   TitaniumKit0x000000010688f311 KrollCallAsFunction + 425\n5   JavaScriptCore  0x0000000101b5c053 _ZN3JSC16JSCallbackObjectINS_20JSDestructibleObjectEE4callEPNS_9ExecStateE + 531\n6   JavaScriptCore  0x0000000102001b64 _ZN3JSC5LLInt9setUpCallEPNS_9ExecStateENS_22CodeSpecializationKindENS_7JSValueEPNS_17LLIntCallLinkInfoE + 404\n7   JavaScriptCore  0x0000000101b27011 llint_entry + 61950\n8   JavaScriptCore  0x0000000101b2773b llint_entry + 63784\n9   JavaScriptCore  0x0000000101b2701f llint_entry + 61964\n10  JavaScriptCore  0x0000000101b17c59 vmEntryToJavaScript + 200\n11  JavaScriptCore  0x0000000101efdf03 _ZN3JSC11Interpreter11executeCallEPNS_9ExecStateEPNS_8JSObjectENS_8CallTypeERKNS_8CallDataENS_7JSValueERKNS_7ArgListE + 467\n12  JavaScriptCore  0x0000000102143ed4 _ZN3JSC12profiledCallEPNS_9ExecStateENS_15ProfilingReasonENS_7JSValueENS_8CallTypeERKNS_8CallDataES3_RKNS_7ArgListE + 196\n13  JavaScriptCore  0x0000000101b63018 JSObjectCallAsFunction + 488\n14  TitaniumKit0x000000010686cebb TiBindingEventProcess + 667\n15  TitaniumKit0x000000010688d6d4 -[KrollContext invoke:] + 109\n16  TitaniumKit0x000000010688d747 -[KrollContext enqueue:] + 93\n17  TitaniumKit0x0000000106894c86 TiBindingRunLoopEnqueue + 77\n18  TitaniumKit0x00000001068934dc -[TiProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 164\n19  TitaniumKit0x0000000106874f7c -[TiViewProxy fireEvent:withObject:propagate:reportSuccess:errorCode:message:] + 224\n20  TitaniumKit0x00000001068932e9 -[TiProxy fireEvent:withObject:propagate:] + 76\n21  TitaniumKit0x0000000106865cbf -[TiUIView touchesEnded:withEvent:] + 110\n22  UIKitCore  0x0000000113abf4e6 -[UIWindow _sendTouchesForEvent:] + 2547";
       [ERROR] :      sourceURL = "file:///Users/macbookpro/Library/Developer/CoreSimulator/Devices/74237B75-753C-411F-8B4D-DCD398086D1A/data/Containers/Bundle/Application/B7B3B111-170A-41BC-A18B-21CAD87849BE/alloyTest.app/alloy/controllers/myWebview.js";
       [ERROR] :      stack = "    at [native code]\n    at Controller(/alloy/controllers/myWebview.js:88:35)\n    at createController(/alloy.js:428:53)\n    at doClick(/alloy/controllers/index.js:54:43)";
       [ERROR] :      toJSON = "<KrollCallback: 0x600002681100>";
       [ERROR] :  }
       
       
    Are you experiencing the same?
  6. dbenhenni 2019-09-25

    Yes. I am experiencing the same issue.
  7. dbenhenni 2019-09-27

    A decent solution is required urgently in terms of iOS 13 Update.
  8. dbenhenni 2019-10-08

    The following workaround helped to fix the error: * import module: ti.wkwebview from https://github.com/appcelerator-modules/ti.wkwebview/releases * replace $.webview.setBasicAuthentication(, ) with
       $.webview.basicAuthentication = {
       	username: <username>,
       	password: <userpassword>,
       	persistence: Titanium.UI.iOS.CREDENTIAL_PERSISTENCE_PERMANENT
       };
       
    https://docs.appcelerator.com/platform/latest/#!/guide/Communication_Between_WebViews_and_Titanium-section-29004919_CommunicationBetweenWebViewsandTitanium-Ti.AppEvents
  9. Hans Knöchel 2019-11-03

    This is a huge parity issue regressed in SDK 8.0.0. Summarized: iOS uses an Object-based access and Android expects a method with two parameters. Since the iOS WebView was reworked in SDK 8, it should be fixed on iOS. A fix is coming today.
  10. Hans Knöchel 2019-11-03

    Pull request: https://github.com/appcelerator/titanium_mobile/pull/11311 Test case:
        var win = Ti.UI.createWindow({
            backgroundColor: '#fff'
        });
        
        var webView = Ti.UI.createWebView({
            url: 'https://jigsaw.w3.org/HTTP/Basic/'
        });
        
        // Uncomment to use the old way. It should log a warning
        // webView.basicAuthentication = { username: 'guest', password: 'guest', persistence: Ti.UI.iOS.CREDENTIAL_PERSISTENCE_SYNCHRONIZABLE };
        
        webView.setBasicAuthentication('guest', 'guest', Ti.UI.iOS.CREDENTIAL_PERSISTENCE_SYNCHRONIZABLE);
        
        win.add(webView);
        win.open();
        
    Please escalate and schedule asap.
  11. Satyam Sekhri 2019-11-06

    FR Passed. Waiting on Jenkins build.
  12. Christopher Williams 2019-11-06

    merged to master
  13. Satyam Sekhri 2019-11-06

    Verified on: Mac OS: 10.14.5 SDK: 8.3.0.v20191106125835 Appc CLI: 7.1.1 JDK: 1.8.0_162 Node: 10.5.0 Studio: 5.1.4.201909061933 XCode: 11.1 Device: iPhone X(v13.0), iPhone 7Plus(v12.3.1), iOS simulator 13.1

JSON Source