在初始化之前,IBM Worklight Hybrid Application似乎卡住了



我在使用Worklight 6.2.0.1时遇到了一个奇怪的问题。它只出现在iOS上。

有时当我启动应用程序时,它似乎卡住了,所以我必须最小化并重新打开它以继续初始化流程。

Xcode日志:

2015-07-29 16:33:02.693 SocialClosing[695:127943] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:124 :: At first launch
2015-07-29 16:33:02.705 SocialClosing[695:127943] [DEBUG] [WL_INIT] -[WLImpl initWL] in WLImpl.m:150 :: Web resources should not be extracted.
2015-07-29 16:33:02.866 SocialClosing[695:127878] Multi-tasking -> Device: YES, App: YES
2015-07-29 16:33:02.875 SocialClosing[695:127878] Unlimited access to network resources
2015-07-29 16:33:02.884 SocialClosing[695:127878] [CDVTimer][wlapp] 0.239968ms
2015-07-29 16:33:02.884 SocialClosing[695:127878] [CDVTimer][push] 0.120997ms
2015-07-29 16:33:02.884 SocialClosing[695:127878] [CDVTimer][TotalPluginStartup] 0.899971ms
2015-07-29 16:33:02.896 SocialClosing[695:127878] Unbalanced calls to begin/end appearance transitions for <Compatibility50ViewController: 0x15e81e60>.
2015-07-29 16:33:02.900 SocialClosing[695:127878] Resetting plugins due to page load.
2015-07-29 16:33:05.231 SocialClosing[695:127878] Finished load of: file:///private/var/mobile/Containers/Bundle/Application/E4ED8DED-718D-44BA-9B45-A1195F6F7AE4/SocialClosing.app/www/default/index.html
2015-07-29 16:33:06.887 SocialClosing[695:127903] [DEBUG] [NONE] ondeviceready event dispatched
2015-07-29 16:33:06.904 SocialClosing[695:127878] THREAD WARNING: ['WLApp'] took '17.299072' ms. Plugin should use a background thread.
2015-07-29 16:33:06.930 SocialClosing[695:127903] [WARN] [NONE] Initialization options 'enableLogger' and 'logger' are deprecated. Use WL.Logger.config to set logger behavior.
2015-07-29 16:33:06.934 SocialClosing[695:127878] log1
2015-07-29 16:33:06.935 SocialClosing[695:127906] [DEBUG] [NONE] wlclient init started
2015-07-29 16:33:06.940 SocialClosing[695:127904] [DEBUG] [NONE] CookieMgr read cookies: {}
2015-07-29 16:33:06.944 SocialClosing[695:127948] [DEBUG] [NONE] Read cookies: null
2015-07-29 16:33:06.963 SocialClosing[695:127878] THREAD WARNING: ['DeviceAuth'] took '17.553711' ms. Plugin should use a background thread.
2015-07-29 16:33:06.973 SocialClosing[695:127903] [DEBUG] [NONE] before: initOptions.onSuccess
2015-07-29 16:33:06.978 SocialClosing[695:127948] [DEBUG] [NONE] after: initOptions.onSuccess
2015-07-29 16:33:06.984 SocialClosing[695:127905] [DEBUG] [NONE] added onPause event handler 
2015-07-29 16:33:06.991 SocialClosing[695:127906] [DEBUG] [NONE] wlclient init success

在我最小化并重新打开应用程序(通过iOS设备上的Home键)后,它继续运行我的javascript代码,如下所示:

{2015-07-29 16:35:28.632 SocialClosing[695:127878] Login Initialized
2015-07-29 16:35:28.652 SocialClosing[695:127878] THREAD WARNING: ['NotificationEx'] took '18.151123' ms. Plugin should use a background thread.
2015-07-29 16:35:28.653 SocialClosing[695:127878] UserDAO initialize begin.
2015-07-29 16:35:28.654 SocialClosing[695:127878] BaseDAO initialize begin.
2015-07-29 16:35:28.654 SocialClosing[695:127878] BaseDAO _initializeJSONStoreCollection begin.
2015-07-29 16:35:41.795 SocialClosing[695:127878] JSONStore collection UserCollection opened successfully.
2015-07-29 16:35:42.695 SocialClosing[695:127878] UserPersistenceDAO initialize begin.
2015-07-29 16:35:42.696 SocialClosing[695:127878] BaseDAO initialize begin.
2015-07-29 16:35:42.696 SocialClosing[695:127878] BaseDAO _initializeJSONStoreCollection begin.
2015-07-29 16:35:44.281 SocialClosing[695:127878] JSONStore collection UserPersistenceCollection opened successfully.
2015-07-29 16:35:44.281 SocialClosing[695:127878] UserPersistenceDAO getUser begin.
2015-07-29 16:35:44.281 SocialClosing[695:127878] BaseDAO _getAllRegistries begin.
2015-07-29 16:35:45.931 SocialClosing[695:127878] Find All registries successfully executed on UserPersistenceCollection JSONStore.}

我已经尝试解决这个问题一个多星期没有成功。

下面是一些注意事项:

  • 这个问题不是每次都发生;
  • 我正在真正的设备上调试应用程序(iPad Air和iPhone 5c);
  • 我已经在Safari上调试了它,它似乎在打电话给我之前卡住了pageview(我使用backbone)初始化方法;

请随时向我询问更多的信息。

提前感谢!

我正在为我的问题写一个答案,但它不是完整的解决方案。

当我使用Require JS来管理依赖关系时,我让它来处理以下Worklight文件:

  • initOptions.js
  • main.js
  • messages.js

现在JsonStore初始化正确,但有时我得到这个:

2015-08-18 11:12:39.373 SocialClosing[2387:711665] [DEBUG] [NONE] establishSSLClientAuth
2015-08-18 11:12:39.379 SocialClosing[2387:711640] [WARN] [USER_CERT_AUTH] +[WLUserAuthManager getCertificateIdentifier] in WLUserAuthManager.m:68 :: Certificate Identifier Key: com.worklight.userenrollment.certificate:com.ibm.cio.be.SocialClosing
2015-08-18 11:12:39.387 SocialClosing[2387:711640] THREAD WARNING: ['UserAuth'] took '11.081055' ms. Plugin should use a background thread.
2015-08-18 11:12:39.388 SocialClosing[2387:711640] Error in error callback: UserAuth318076151 = TypeError: null is not a valid argument for 'in' (evaluating 'field in profile')

在这种情况下,闪屏不会消失。

遗憾的是,直到现在我还不知道如何解决这个问题

最新更新