IBM Worklight - 在应用FixPack后,应用程序挂起在启动画面上

时间:2014-05-26 07:34:41

标签: ios cordova ibm-mobilefirst

在设备上应用FixPack 1(适用于Worklight 6.1.01)后,我们注意到iOS中出现了一些意外行为。我们尝试过iOS 6和7.1,它们都表现出相同的行为。

我们已经为部署增加了应用程序的版本号(即从1.2到1.3)。当用户尝试通过AppCenter Mobile Client更新应用程序时,安装后,应用程序将停止在带有IBM徽标的初始屏幕上。只有通过删除/卸载应用程序并重新安装,应用程序才能正常工作。

我们检查控制台登录xcode并获得以下打印输出:

May 26 13:16:42 MY-iPad profiled[713] <Notice>: (Note ) profiled: Service stopping.
May 26 13:16:42 MY-iPad kernel[0] <Debug>: launchd[714] Container: /private/var/mobile/Applications/284CEAF0-8B89-467C-BA55-0F277FFA6521 (sandbox)
May 26 13:16:42 MY-iPad backboardd[28] <Error>: HID: The 'Passive' connection 'MyMobileApp' access to protected services is denied.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [WORKLIGHT] -[WLCordovaAppDelegate handleAppWebResources:] in WLCordovaAppDelegate.m:373 :: NativeInitUntilWebViewLoad : START
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [OCLogger] Max file size exceeded for log messages.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Web resources integrity test is disabled.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Application windows are expected to have a root view controller at the end of application launch
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Multi-tasking -> Device: YES, App: YES
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Unlimited access to network resources
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [CDVTimer][splashscreen] 15.210986ms
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [CDVTimer][TotalPluginStartup] 17.367005ms
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: WARNING: AutoHideSplashScreen key in Cordova.plist is missing or set to NO! SplashScreen will display indefinitley unless you manually hide it. Set value to YES to autohide.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [WORKLIGHT] -[WLCordovaAppDelegate postInitOnMainThread:] in WLCordovaAppDelegate.m:303 :: NativeInitUntilWebViewLoad : END
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: [DEBUG] [OCLogger] Max file size exceeded for log messages.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Resetting plugins due to page load.
May 26 13:16:42 MY-iPad MyMobileApp[714] <Warning>: Failed to load webpage with error: The requested URL was not found on this server.

关于此问题的一些Google搜索会导致Worklight 6.1 "access to protected services is denied" after app is deployed to App Store。这是一个类似的问题,虽然行为不同。

目前我们已经指示用户在升级应用之前清除所有数据,但我们无法继续使用此方法,因为设备中存在我们无法擦除的关键数据只是为了升级应用程序。

对此有任何信息或想法表示赞赏。

更新

我们尝试使用服务器配置工具重新部署应用,但仍然存在同样的问题。我们检查了日志中的Fixpack安装,并且没有报告错误。此外,IBM Installation Manager还显示安装的版本是最新的6.1.01,并且它不允许我更新它,仅修改。

更新2

删除native文件夹并重新部署应用程序(从.wlapp文件到.ipa文件)后,仍会出现同样的问题。然而,观察到一种模式。

如果应用程序正在重建和重新部署,AppCenter的第一次安装将按常规运行,没有任何问题,这意味着数据将被保留并且应用程序正常运行,即使代码和版本没有变化也没有。但是,如果您再次单击install按钮再次安装,则会出现问题。

2 个答案:

答案 0 :(得分:2)

我明白了 - 工作灯(不是cordova)中存在一个错误。

在文件中:

helloHelloIphone / Classes / hello.m,Xcode调试器报告以下自动生成的工作灯代码为&#34; startPage&#34;

加载了错误的值
-(void)wlInitDidCompleteSuccessfully
{
    UIViewController* rootViewController = self.window.rootViewController;

    // Create a Cordova View Controller
    CDVViewController* cordovaViewController = [[CDVViewController alloc] init] ;

    cordovaViewController.startPage = [[WL sharedInstance] mainHtmlFilePath];

因为“startPage”的值原来是:

       @"worklight:///Users/mrhines/Library/Application Support/iPhone Simulator/6.1/Applications/A2E1427C-7DFF-4843-BF3D-0B7E4B470E43/hello.app/www/default/(null)”

这显然是错误的 - 字符串的结尾应该是“index.html”,而不是null。

因此,通过用以下行替换上面的最后一行代码:

       cordovaViewController.startPage = [[[WL sharedInstance] mainHtmlFilePath] stringByReplacingOccurrencesOfString:@"(null)" withString:@"index.html"];

我的应用程序可靠地启动并移动到挂起的启动屏幕,修复了Worklight中的错误。

答案 1 :(得分:0)

IBM已经针对该问题发布了一个快速修复补丁,在安装到开发服务器之后,事情看起来很好。

相关问题