IBM Worklight 6.1 - 如果启用Android屏幕兼容模式,API方法将失败

时间:2014-05-07 04:56:38

标签: android cordova ibm-mobilefirst

通过更改AndroidManifest.xml中的supports-screens标签启用Screen Compatibility Mode后,许多Worklight和Cordova API方法将不再有效。

例如,

  • 直接更新
  • 后按更新按钮后不会发生任何事情
  • navigator.notification.confirm中,回调无效
  • 在navigator.camera.getPicture中
  • ,选择图片后会卡住

如果我禁用屏幕兼容模式,一切正常。

以上只在Worklight 6.1(使用Cordova 3.1)中发生;在Worklight 6.0(使用Cordova 2.6)中,一切正常。

有人有解决方案吗?

更新: 我创建了一个新项目,并尝试在屏幕兼容模式下从Worklight服务器直接更新。 按下更新按钮后,这是logcat的日志。

05-07 02:46:37.670: I/CordovaLog(2172): Changing log level to DEBUG(3)
05-07 02:46:37.670: D/CordovaActivity(2172): CordovaActivity.onCreate()
05-07 02:46:37.790: D/dalvikvm(2172): GC_FOR_ALLOC freed 295K, 17% free 2602K/3128K, paused 12ms, total 14ms
05-07 02:46:37.790: I/dalvikvm-heap(2172): Grow heap (frag case) to 3.020MB for 268012-byte allocation
05-07 02:46:37.810: D/dalvikvm(2172): GC_FOR_ALLOC freed <1K, 16% free 2863K/3392K, paused 15ms, total 16ms
05-07 02:46:38.000: D/dalvikvm(2172): GC_FOR_ALLOC freed 199K, 15% free 2915K/3392K, paused 17ms, total 18ms
05-07 02:46:38.010: I/dalvikvm-heap(2172): Grow heap (frag case) to 3.338MB for 281892-byte allocation
05-07 02:46:38.040: D/dalvikvm(2172): GC_FOR_ALLOC freed <1K, 14% free 3190K/3668K, paused 32ms, total 32ms
05-07 02:46:38.250: D/CordovaWebView(2172): CordovaWebView is running on device made by: unknown
05-07 02:46:38.280: D/JsMessageQueue(2172): Set native->JS mode to 2
05-07 02:46:38.320: D/CordovaActivity(2172): CordovaActivity.init()
05-07 02:46:38.380: W/com.worklight.androidgap.analytics.WLAnalytics(2172): TLF_configurator.enable was called, but the required Tealeaf libraries are not present in the classpath.
05-07 02:46:38.450: D/Whitelist(2172): Unlimited access to network resources
05-07 02:46:38.450: I/CordovaLog(2172): Changing log level to DEBUG(3)
05-07 02:46:38.450: D/CordovaActivity(2172): Resuming the App
05-07 02:46:38.450: D/CordovaActivity(2172): CB-3064: The errorUrl is null
05-07 02:46:38.500: I/Choreographer(2172): Skipped 34 frames!  The application may be doing too much work on its main thread.
05-07 02:46:38.690: D/SoftKeyboardDetect(2172): Ignore this event
05-07 02:46:38.750: D/WLDroidGap(2172): no need to check web resource integrity
05-07 02:46:38.950: D/(2172): HostConnection::get() New Host Connection established 0xb9142ce0, tid 2172
05-07 02:46:39.320: D/CordovaWebView(2172): >>> loadUrl(file:///android_asset/www/default/index.html)
05-07 02:46:39.320: D/PluginManager(2172): init()
05-07 02:46:39.330: D/CordovaWebView(2172): >>> loadUrlNow()
05-07 02:46:39.710: D/CordovaActivity(2172): onMessage(onPageStarted,file:///android_asset/www/default/index.html)
05-07 02:46:39.850: D/dalvikvm(2172): GC_FOR_ALLOC freed 249K, 15% free 3360K/3924K, paused 14ms, total 15ms
05-07 02:46:40.380: D/dalvikvm(2172): GREF has increased to 201
05-07 02:46:40.410: D/dalvikvm(2172): GC_FOR_ALLOC freed 283K, 16% free 3472K/4104K, paused 15ms, total 17ms
05-07 02:46:40.450: D/dalvikvm(2172): GC_FOR_ALLOC freed 9K, 10% free 3815K/4212K, paused 20ms, total 21ms
05-07 02:46:40.550: D/dalvikvm(2172): GC_FOR_ALLOC freed 15K, 9% free 4137K/4536K, paused 31ms, total 33ms
05-07 02:46:40.660: D/dalvikvm(2172): GC_FOR_ALLOC freed 171K, 12% free 4356K/4896K, paused 14ms, total 15ms
05-07 02:46:40.780: D/dalvikvm(2172): GC_FOR_ALLOC freed 388K, 15% free 4449K/5220K, paused 14ms, total 15ms
05-07 02:46:40.990: D/CordovaWebViewClient(2172): onPageFinished(file:///android_asset/www/default/index.html)
05-07 02:46:40.990: D/CordovaActivity(2172): onMessage(onPageFinished,file:///android_asset/www/default/index.html)
05-07 02:46:41.100: D/CordovaActivity(2172): onMessage(spinner,stop)
05-07 02:46:41.240: D/CordovaNetworkManager(2172): Connection Type: 3g
05-07 02:46:41.240: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkStatus.getConnectionInfo blocked the main thread for 23ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.300: D/TilesManager(2172): Starting TG #0, 0xb91c3520
05-07 02:46:41.410: D/CordovaNetworkManager(2172): Connection Type: 3g
05-07 02:46:41.430: D/CordovaActivity(2172): onMessage(networkconnection,3g)
05-07 02:46:41.630: W/PluginManager(2172): THREAD WARNING: exec() call to DeviceAuth.getDeviceUUID blocked the main thread for 51ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.860: I/wl.client(2172): WL.Client.init ENTERING
05-07 02:46:41.860: D/NONE(2172): ondeviceready event dispatched
05-07 02:46:41.880: I/wl.client(2172): WL.Client onEnvInit ENTERING
05-07 02:46:41.900: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.setNativeOptions blocked the main thread for 55ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.910: D/NONE(2172): wlclient init started
05-07 02:46:41.930: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.log blocked the main thread for 21ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:41.950: D/NONE(2172): Read cookies: null
05-07 02:46:41.980: D/NONE(2172): CookieMgr read cookies: {}
05-07 02:46:42.010: W/NONE(2172): Your application is using the WL.OptionsMenu API. Note that, if your application targets Android 3.0 (API level 11) or higher, WL.OptionsMenu might have no effect, depending on the device.
05-07 02:46:42.040: D/NONE(2172): addDeviceIDHeader deviceIDSuccessCallback
05-07 02:46:42.120: D/NONE(2172): connectOnStartup
05-07 02:46:42.140: D/NONE(2172): connectOnStartup isCertificateExists:  false
05-07 02:46:42.140: D/NONE(2172): Request [http://worklightserver:9080/worklight/apps/services/api/resizeTest/android/init]
05-07 02:46:42.500: W/PluginManager(2172): THREAD WARNING: exec() call to Utils.writePref blocked the main thread for 72ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:42.650: D/NONE(2172): Request [http://worklightserver:9080/worklight/apps/services/api/resizeTest/android/init]
05-07 02:46:42.650: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.log blocked the main thread for 38ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:43.300: D/CordovaActivity(2172): onMessage(spinner,stop)
05-07 02:46:43.420: D/dalvikvm(2172): GC_FOR_ALLOC freed 1685K, 36% free 3422K/5340K, paused 27ms, total 38ms
05-07 02:46:43.430: W/PluginManager(2172): THREAD WARNING: exec() call to NetworkDetector.log blocked the main thread for 135ms. Plugin should use CordovaInterface.getThreadPool().
05-07 02:46:43.450: D/NONE(2172): response [http://worklightserver:9080/worklight/apps/services/api/resizeTest/android/init] success: /*-secure-
05-07 02:46:43.450: D/NONE(2172): {"WL-Authentication-Success":{"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"wl_antiXSRFRealm":{"userId":"j9dne6vt6sf2t0bgresgv1bkfo","attributes":{},"isUserAuthenticated":1,"displayName":"j9dne6vt6sf2t0bgresgv1bkfo"},"wl_deviceNoProvisioningRealm":{"userId":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData@685f0a"},"isUserAuthenticated":1,"displayName":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9"},"wl_anonymousUserRealm":{"userId":"2250519e-a491-41fa-91c5-f49a6e3a87d0","attributes":{},"isUserAuthenticated":1,"displayName":"2250519e-a491-41fa-91c5-f49a6e3a87d0"}},"userPrefs":{},"gadgetProps":{"directUpdate":{"updateUnpackedSize":1197037,"availableSkins":["default"],"checksum":1927153879,"updateSize":387359},"ENVIRONMENT":"android"},"userInfo":{"SubscribeServlet":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_authenticityRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"SampleAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_remoteDisableRealm":{"userId":"null","attributes":{},"isUserAuthenticated":1,"displayName":"null"},"PushAppRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_antiXSRFRealm":{"userId":"j9dne6vt6sf2t0bgresgv1bkfo","attributes":{},"isUserAuthenticated":1,"displayName":"j9dne6vt6sf2t0bgresgv1bkfo"},"WorklightConsole":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceAutoProvisioningRealm":{"userId":null,"attributes":{},"isUserAuthenticated":0,"displayName":null},"wl_deviceNoProvisioningRealm":{"userId":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9","attributes":{"mobileClientData":"com.worklight.core.auth.ext.MobileClientData@685f0a"},"isUserAuthenticated":1,"displayName":"1e1d4692-dcdd-32e9-883e-5ddd4a4e6ff9"},"myserver":{"userId":"2250519e-a491-41fa-91c5-f49a6e3a87d0","attributes":{},"isUserAuthenticated":1,"displayName":"2250519e-a491-41fa-91c5-f49a6e3a87d0"},"wl_anonymousUserRealm":{"userId":"2250519e-a491-41fa-91c5-f49a6e3a87d0","attributes":{},"isUserAuthenticated":1,"displayName":"2250519e-a491-41fa-91c5-f49a6e3a87d0"}}}*/
05-07 02:46:43.510: I/wl.client(2172): WL.Client.connect onConnectSuccess ENTERING
05-07 02:46:43.510: D/NONE(2172): wlclient connect success

1 个答案:

答案 0 :(得分:0)

请使用您正在使用的Worklight Studio的确切版本编辑您的问题 你可以通过Eclipse&gt;找到它。帮助&gt;关于&gt;工作灯

您可能希望从Eclipse市场重新下载Developer Edition,或者如果您是IBM客户/业务合作伙伴,请为Worklight 6.1.0.1请求最新的iFix版本。

我之所以这样,是因为以下已解决的APAR:PI13286 CALLBACK FROM CAMERA.GETPICTURE IS NOT CALLED WHEN THE CAMERA DONE BUTTON IS PRESSED

这可能会解决confirmgetPicture问题,也可能是直接更新。这需要更好的复制步骤...

所以我的建议是首先尝试使用Developer Edition进行快速验证,如果需要,请索取iFix。