升级到 iOS 9 和 MobileFirst 7.1 后无法登录设备或模拟器上的应用程序
Posted
技术标签:
【中文标题】升级到 iOS 9 和 MobileFirst 7.1 后无法登录设备或模拟器上的应用程序【英文标题】:Unable to login to app on device or simulator after upgrade to iOS 9 and MobileFirst 7.1 【发布时间】:2015-10-20 13:16:46 【问题描述】:当通过 XCode 构建并部署到设备或通过 ios 模拟器时,我使用 Ionic 和 IBM MobileFirst 构建的混合应用程序在升级到 iOS 9 和 MF 7.1 后无法登录。
我在 Eclipse 内的本地 WebSphere Liberty 服务器上运行此程序,因此不涉及 SSH,因此已按照以下链接中的说明禁用位码和 ATS,但没有任何效果。
https://developer.ibm.com/mobilefirstplatform/2015/09/09/ats-and-bitcode-in-ios9/
但是应用程序是能够使用 MF 移动浏览器模拟器登录,它只会在尝试登录设备或 iOS 模拟器时失败,所以我确定这是要做的事情构建过程而不是应用程序错误。
这是我得到的日志跟踪,似乎没有找到服务器 IP(我已经掩盖了),但这是我本地 Liberty 服务器的正确 IP
其他人有类似的问题吗?任何帮助将不胜感激!
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] [DEBUG] [WL_AUTH] -[WLAuthorizationManager invokeInstanceRegistrationRequestWithCompletionHandler:] in WLAuthorizationManager.m:548 :: Call instance registration endpoint
2015-10-20 14:01:07.812 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager generateKeyPair:withPublicKeyLabel:withKeySize:] in WLCertManager.m:225 :: generateKeyPair generating keypair --> Success
2015-10-20 14:01:07.818 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.819 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.820 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.821 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.822 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.822 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.823 WorkManagement[26452:2390658] THREAD WARNING: ['WLAuthorizationManagerPlugin'] took '47.751953' ms. Plugin should use a background thread.
2015-10-20 14:01:07.829 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:352 :: Request Failed
2015-10-20 14:01:07.830 WorkManagement[26452:2390658] [DEBUG] [WL_AFHTTPRequestOperationManagerWrapper_PACKAGE] -[WLAFHTTPRequestOperationManagerWrapper requestFailed:error:] in WLAFHTTPRequestOperationManagerWrapper.m:353 :: Response Status Code : 0
2015-10-20 14:01:07.831 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.832 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.833 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.834 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.834 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.859 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.864 WorkManagement[26452:2390658] [DEBUG] [CERTIFICATE_MANAGER] +[WLCertManager removeKey:] in WLCertManager.m:262 :: Key was successfully removed.
2015-10-20 14:01:07.872 WorkManagement[26452:2390658] [DEBUG] [WORKLIGHT] +[WLClient sharedInstance] in WLClient.m:165 :: IBMMobilieFirstFoundation.framework version = 7.1-2015/10/12 16:16:07
【问题讨论】:
好吧,如果你将worklight.plist中的主机值改为IP地址而不是主机名,它会起作用吗? 【参考方案1】:使用 MBS 时,您基本上是由服务器直接提供服务的。 MBS在服务器里面,你打开服务器IP或者localhost。
使用物理设备或 iOS 模拟器时,您连接到“远程”主机名。可能是提到的值没有被 DNS 正确翻译。
您可以尝试两件事,通过编辑 Xcode 项目中的 worklight.plist 文件:
-
清空
host
属性;这通常允许它自己选择一个值,并且在 iOS 中似乎可以工作
将现有的host
值替换为IP 地址 而不是主机名
【讨论】:
感谢您提供的信息,您说得对,这是一个 DNS 问题,并且由于我们使用 *** 而进一步复杂化...在 MF 服务器设置中将主机名从 localhost 更改为我的实际 IP在已修复它的 Eclipse 中以上是关于升级到 iOS 9 和 MobileFirst 7.1 后无法登录设备或模拟器上的应用程序的主要内容,如果未能解决你的问题,请参考以下文章
将 MobileFirst JavaScript 适配器从 7.1 升级到 8.0 时替换轮询事件源
使用 IBM MobileFirst Platform v7.1(包括 Dojo Toolkit SDK 1.10.3)开发的混合移动应用程序在升级到 iOS 10.3 后崩溃