【问题标题】:IBM Worklight Hybrid Application seems to stuck before initializeIBM Worklight Hybrid Application 在初始化之前似乎卡住了
【发布时间】:2015-09-22 21:20:41
【问题描述】:

我在使用 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 设备上的主页按钮)后,它会继续运行我的 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 上调试过它,它似乎在调用我之前卡住了 浏览量(我正在使用主干)初始化方法;

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

提前致谢!

【问题讨论】:

  • 我猜 JSONStore 初始化只需要时间。在没有初始化 JSONStore 的情况下,你尝试了什么?它更快吗?
  • 我删除了所有 JSONStore 初始化,但它仍然卡住。在日志上查看它获取页面并加载它:加载:file:///private/var/mobile/Containers/Bundle/Application/E4ED8DED-718D-44BA-9B45-A1195F6F7AE4/SocialClosing.app/www/default/索引.html。但它不会触发 javascript 初始化方法。我可以看到 iPad 上显示的登录页面,但是当我尝试与之交互时没有任何反应。因此,当我按下主页按钮并重新打开应用程序时,它工作正常并从 javascript 文件中调用初始化方法。
  • 您需要为您提供 Worklight 项目(从 Eclipse 中导出),以便对其进行调试。
  • 我如何为您提供 Worklight 项目?我不能把它放在这里。我是 IBM 员工,也许我们可以在 ST 上谈谈。

标签: ios backbone.js ibm-mobilefirst


【解决方案1】:

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

当我使用 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')

在这种情况下,启动画面不会消失。

不幸的是,直到现在我都不知道如何解决这个问题。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2019-12-07
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2022-07-22
    • 1970-01-01
    相关资源
    最近更新 更多