Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.0k views
in Technique[技术] by (71.8m points)

xcode - Unable to login to app on device or simulator after upgrade to iOS 9 and MobileFirst 7.1

My hybrid app built using Ionic and IBM MobileFirst is unable to login after the upgrade to iOS 9 and MF 7.1 when built via XCode and deployed to a device or through iOS simulator.

I am running this on my local WebSphere Liberty server within Eclipse so there is no SSH involved, so have followed instructions to disable bitcode and ATS from the link below with no effect.

https://developer.ibm.com/mobilefirstplatform/2015/09/09/ats-and-bitcode-in-ios9/

However the app is able to be logged in using the MF Mobile Browser Simulator, it only fails when attempting a login on the device or iOS simulator, so I'm sure this is something to do with the build process rather than an app error.

Here's the log trace I get, seems to be not finding the server IP (which I've obscured), but that is the correct IP for my local Liberty Server

Anyone else having a similar issue? Any help would be much appreciated!

2015-10-20 14:01:02.269 WorkManagement[26452:2390658] DiskCookieStorage changing policy from 2 to 0, cookie file: file:///Users/Eugene/Library/Developer/CoreSimulator/Devices/49A9535D-0085-4FD6-A57F-A45D0F7E7819/data/Containers/Data/Application/86E6CEFF-F2E5-4523-9763-A421A1A64659/Library/Cookies/com.WorkManagement.binarycookies
2015-10-20 14:01:02.427 WorkManagement[26452:2390658] [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: Splash screen image is taken from UILaunchImages: Default-667h
2015-10-20 14:01:02.453 WorkManagement[26452:2390658] [DEBUG] [WL_SPLASH] -[WLSplashView updateImage] in WLSplashView.m:189 :: Splash screen image is taken from UILaunchImages: Default-667    h
2015-10-20 14:01:02.455 WorkManagement[26452:2390658] Unbalanced calls to begin/end appearance transitions for <UIViewController: 0x7f91936521e0>.
2015-10-20 14:01:02.494 WorkManagement[26452:2391815] [DEBUG] [WL_CONFIG] -[WLConfig init] in WLConfig.m:71 :: {
    "application id" = WorkManagement;
    "application version" = "1.0";
    authenticitySharedData = "${authenticitySharedData}";
    buildtime = 1445346036;
    environment = iphone;
    host = "ip-XXX-XX-X-XX.eu-west-1.compute.internal";
    ignoredFileExtensions = "";
    platformVersion = "7.1.0.0";
    port = 10080;
    protocol = http;
    testWebResourcesChecksum = false;
    wlAppFamily = "";
    wlMainFile = "index.html";
    wlSecureDirectUpdatePublicKey = "";
    wlServerContext = "/dlr-mxr-mobile-wm/";
    wlShareCookies = "";
    wlShareUserCert = false;
    wlUid = "JIl9TfKyrbvMt7TN91OoYw==";
}
2015-10-20 14:01:02.496 WorkManagement[26452:2391815] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:127 :: At first launch
2015-10-20 14:01:02.501 WorkManagement[26452:2391815] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:153 :: Web resources should not be extracted.
2015-10-20 14:01:03.750 WorkManagement[26452:2390658] Apache Cordova native platform version 3.7.0 is starting.
2015-10-20 14:01:03.750 WorkManagement[26452:2390658] Multi-tasking -> Device: YES, App: YES
2015-10-20 14:01:03.756 WorkManagement[26452:2390658] Unlimited access to network resources
2015-10-20 14:01:03.757 WorkManagement[26452:2390658] 

Started backup to iCloud! Please be careful.
Your application might be rejected by Apple if you store too much data.
For more information please read "iOS Data Storage Guidelines" at:
https://developer.apple.com/icloud/documentation/data-storage/
To disable web storage backup to iCloud, set the BackupWebStorage preference to "local" in the Cordova config.xml file

2015-10-20 14:01:03.762 WorkManagement[26452:2390658] [CDVTimer][wlapp] 1.286030ms
2015-10-20 14:01:03.763 WorkManagement[26452:2390658] [CDVTimer][push] 1.507044ms
2015-10-20 14:01:03.764 WorkManagement[26452:2390658] [CDVTimer][TotalPluginStartup] 3.289998ms
2015-10-20 14:01:03.806 WorkManagement[26452:2390658] Resetting plugins due to page load.
2015-10-20 14:01:04.178 WorkManagement[26452:2390658] Finished load of: file:///Users/Eugene/Library/Developer/CoreSimulator/Devices/49A9535D-0085-4FD6-A57F-A45D0F7E7819/data/Containers/Bundle/Application/B76AFE6B-15B9-4651-9230-30123351DB91/WorkManagement.app/www/default/index.html#/login
2015-10-20 14:01:06.407 WorkManagement[26452:2391782] [DEBUG] [NONE] ondeviceready event dispatched
2015-10-20 14:01:06.411 WorkManagement[26452:2391782] [DEBUG] [NONE] wlclient init started
2015-10-20 14:01:06.412 WorkManagement[26452:2391754] [DEBUG] [NONE] Read cookies: null
2015-10-20 14:01:06.413 WorkManagement[26452:2390658] log1
2015-10-20 14:01:06.413 WorkManagement[26452:2391755] [DEBUG] [NONE] CookieMgr read cookies: {}
2015-10-20 14:01:06.422 WorkManagement[26452:2391755] [DEBUG] [NONE] before: initOptions.onSuccess
2015-10-20 14:01:06.424 WorkManagement[26452:2391755] [DEBUG] [NONE] after: initOptions.onSuccess
2015-10-20 14:01:06.424 WorkManagement[26452:2391782] [DEBUG] [NONE] added onPause and onResume event handlers
2015-10-20 14:01:06.425 WorkManagement[26452:2392040] [DEBUG] [NONE] wlclient init success
2015-10-20 14:01:06.434 WorkManagement[26452:2391754] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.600 WorkManagement[26452:2390658] In $auth factory - authString : QkxMT1lEOm1heGltbw==
2015-10-20 14:01:07.600 WorkManagement[26452:2390658] username : BLLOYD
2015-10-20 14:01:07.601 WorkManagement[26452:2390658] password : maximo
2015-10-20 14:01:07.659 WorkManagement[26452:2392040] [DEBUG] [NONE] establishSSLClientAuth
2015-10-20 14:01:07.662 WorkManagement[26452:2390658] [WARN] [USER_CERT_AUTH] +[WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.WorkManagement
2015-10-20 14:01:07.671 WorkManagement[26452:2390658] THREAD WARNING: ['UserAuth'] took '10.719238' ms. Plugin should use a background thread.
2015-10-20 14:01:07.672 WorkManagement[26452:2392040] [DEBUG] [NONE] establishSSLClientAuth isCertificateExists:  false
2015-10-20 14:01:07.673 WorkManagement[26452:2391782] [DEBUG] [NONE] Request [/apps/services/api/WorkManagement/iphone/query]
2015-10-20 14:01:07.673 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.677 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.678 WorkManagement[26452:2390658] [DEBUG] [WL_AUTH] -[WLAuthorizationManager invokeInstanceRegistrationRequestWithCompletionHandler:] in WLAuthorizationManager.m:548 :: Call instance registration endpoint
2015-10-20 14:01:07.710 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager generateKeyPair:withPublicKeyLabel:withKeySize:] in WLCertManager.m:225 :: generateKeyPair generating keypair --> Success
2015-10-20 14:01:07.719 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.720 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] +[WLAFHTTPRequestOperationManagerWrapper requestWithURL:] in WLAFHTTPRequestOperationManagerWrapper.m:52 :: Request url is http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance
2015-10-20 14:01:07.722 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:142 :: Request timeout is 10.000000
2015-10-20 14:01:07.723 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest sendRequest:path:withOptions:] in WLRequest.m:221 :: Sending request (http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance) with headers: 
{
    "Accept-Language" = "en-US";
    "User-Agent" = "WorkManagement/1.0 (iPhone; iOS 9.0; Scale/2.00)/WLNativeAPI/7.1.0.0";
    "X-Requested-With" = XMLHttpRequest;
    "x-wl-app-version" = "1.0";
    "x-wl-device-id" = "9263C520-E277-4D6B-A076-1D68915D78E3";
    "x-wl-platform-version" = "7.1.0.0";
}
You can see the request body in the Analytics platform logs.
2015-10-20 14:01:07.731 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper start] in WLAFHTTPRequestOperationManagerWrapper.m:320 :: Starting the request with URL http://ip-XXX-XX-X-XX.eu-west-1.compute.internal:10080/dlr-mxr-mobile-wm/authorization/v1/clients/instance
2015-10-20 14:01:07.732 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] __42-[WLRequest sendRequest:path:withOptions:]_block_invoke in WLRequest.m:231 :: waiting for response... (Thread=<NSThread: 0x7f919340bb50>{number = 1, name = main})
2015-10-20 14:01:07.733 WorkManagement[26452:2390658] THREAD WARNING: ['WLAuthorizationManagerPlugin'] took '61.285889' ms. Plugin should use a background thread.
2015-10-20 14:01:07.744 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:352 :: Request Failed
2015-10-20 14:01:07.744 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:353 :: Response Status Code : 0
2015-10-20 14:01:07.746 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:354 :: Response Error : A server with the specified hostname could not be found.
2015-10-20 14:01:07.748 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.748 WorkManagement[26452:2390658] [ERROR] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:486 :: Status code='0' error='A server with the specified hostname could not be found.' response='(null)'
2015-10-20 14:01:07.749 WorkManagement[26452:2390658] [DEBUG] [WL_REQUEST] -[WLRequest requestFailed:error:] in WLRequest.m:489 :: Response Header: (null)
Response Data: (null)
2015-10-20 14:01:07.749 WorkManagement[26452:2390658] [DEBUG] [WL_AUTH] -[WLAuthorizationManager failRegistratioWithResponse:] in WLAuthorizationManager.m:866 :: Response does not contain a valid certificate and client Id. device registration failed
2015-10-20 14:01:07.753 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.759 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.762 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.774 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.781 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
2015-10-20 14:01:07.781 WorkManagement[26452:2390658] 

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

When using the MBS, you are basically being served directly by the server. The MBS is inside the server and you open the server IP or localhost.

When using a physical device or the iOS Simulator you are connecting to a "remote" hostname. It could be that the value mentioned is not being translated correctly by DNS.

You can try two things, by editing the worklight.plist file in your Xcode project:

  1. Empty the host property; this usually then allows it to pick a value on its own and seems to work, in iOS
  2. Replace the existing host value with the IP address instead of a hostname

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...