【问题标题】:IBM MobileFirst 7.1 Server connection fails in Android after migrating from WL6.3从 WL6.3 迁移后,Android 中的 IBM MobileFirst 7.1 服务器连接失败
【发布时间】:2016-05-12 15:10:20
【问题描述】:

我有一个 IBM Worklight 6.3 项目,可以正常运行。我收到了来自 Google 的罚单,告诉我需要更新到最新版本,否则该应用程序将从 PlayStore 中删除。

在没有手动更改任何文件的情况下在 Eclipse 上对 MobileFirst7.1 进行相应更新后,我正尝试在我自己的本地服务器上运行该应用程序。使用所有预览工具甚至使用 XCode iphone 6 模拟器都可以正常工作。但是,当我尝试在真正的 Android 设备上运行该应用程序时,它并没有连接到服务器。

我已经:

  • 将服务器配置从 localhost 更改为我的计算机 IP 地址。
  • 更改了构建设置并将目标部署到我的计算机 IP 地址。
  • 将两台设备连接到同一个无线网络。
  • 安装了所有可用的修订包。
  • 从 android 的设备浏览器正确连接到服务器 URL。

在监控网络时,我还注意到应用程序没有流量。当直接从浏览器连接时,我可以看到正在发送到服务器的包,但是在打开应用程序时没有任何反应。

我已经调试了 WL.Device.Network,一切正常:

{"isNetworkConnected":"true","isAirplaneMode":"false","isRoaming":"false", "networkConnectionType":"WIFI",...}

但是 WL.Client.Connect 正在返回这个:

{"status":-1,"errorCode":null,"errorMsg":null}

我用于本地服务器的端口是默认的 10080。

有人知道发生了什么吗?

编辑:

我正在添加 LogCat 消息(错误和警告):

05-12 10:27:17.279: W/WLClient(23424): WLClient.java:225 中的 WLClient.createInstance :: 您应该传递一个可从 Activity 类分配的上下文。 WLClient 实例可用于启动活动。

05-12 10:27:19.142:W/cr_media(23424):需要蓝牙权限

05-12 10:27:19.567:W/cr_AwContents(23424):onDetachedFromWindow 在已分离时调用。忽略

05-12 10:27:20.136: E/libEGL(23424): validate_display:255 错误 3008 (EGL_BAD_DISPLAY)

05-12 10:27:20.203:W/cr_BindingManager(23424):无法调用 deniedVisibility() - 从未看到 pid:23424 的连接

05-12 10:27:20.255:E/AndroidProtocolHandler(23424):无法打开资产 URL:file:///android_asset/www/default/js/messages.js

05-12 10:27:21.243:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/files

05-12 10:27:21.249:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/cache

05-12 10:27:21.268:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/files

05-12 10:27:21.276:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/files

05-12 10:27:21.282:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/cache

05-12 10:27:21.619:W/cr_BindingManager(23424):无法调用 deniedVisibility() - 从未看到 pid:23424 的连接

05-12 10:27:23.054:E/AndroidProtocolHandler(23424):无法打开资产 URL:file:///android_asset/www/default/worklight/messages/es-CO/messages.json

05-12 10:27:23.186:E/AndroidProtocolHandler(23424):无法打开资产 URL:file:///android_asset/www/default/images/favicon.png

05-12 10:27:23.332:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/files

05-12 10:27:23.348:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/files

05-12 10:27:23.359:W/ContextImpl(23424):无法确保目录:/storage/sdcard1/Android/data/com.myApp/cache

05-12 10:27:23.454:W/PluginManager(23424):线程警告:对 Globalization.getLocaleName 的 exec() 调用阻塞了主线程 28 毫秒。插件应该使用 CordovaInterface.getThreadPool()。

05-12 10:27:23.729:W/PluginManager(23424):线程警告:对 DeviceAuth.getDeviceUUID 的 exec() 调用阻塞了主线程 207 毫秒。插件应该使用 CordovaInterface.getThreadPool()。

05-12 10:27:23.832:W/Settings(23424):设置 plane_mode_on 已从 android.provider.Settings.System 移至 android.provider.Settings.Global,返回只读值。

05-12 10:27:24.260:W/cr_BindingManager(23424):无法调用 deniedVisibility() - 从未看到 pid:23424 的连接

05-12 10:27:24.293:W/cr_BindingManager(23424):无法调用 deniedVisibility() - 从未看到 pid:23424 的连接

05-12 10:27:24.298:W/cr_BindingManager(23424):无法调用 deniedVisibility() - 从未看到 pid:23424 的连接

05-12 10:27:24.306:E/AndroidProtocolHandler(23424):无法打开资产 URL:file:///android_asset/www/default/images/favicon.png

05-12 10:27:24.306:E/AndroidProtocolHandler(23424):无法打开资产 URL:file:///android_asset/www/default/images/favicon.png

05-12 10:27:24.308:E/AndroidProtocolHandler(23424):无法打开资产 URL:file:///android_asset/www/default/images/favicon.png

05-12 10:27:24.446:W/Settings(23424):设置 plane_mode_on 已从 android.provider.Settings.System 移至 android.provider.Settings.Global,返回只读值。

05-12 10:27:24.769:W/PluginManager(23424):线程警告:对 LoggerPlugin.log 的 exec() 调用阻塞了主线程 68 毫秒。插件应该使用 CordovaInterface.getThreadPool()。

05-12 10:27:24.800: W/NONE(23424):请注意,如果您的应用程序面向 Android 3.0(API 级别 11)或更高版本,WL.OptionsMenu 可能无效,具体取决于设备。

05-12 10:27:24.859:W/PluginManager(23424):线程警告:对 LoggerPlugin.log 的 exec() 调用阻塞了主线程 33 毫秒。插件应该使用 CordovaInterface.getThreadPool()。

05-12 10:27:24.890:W/PluginManager(23424):线程警告:对 LoggerPlugin.log 的 exec() 调用阻塞了主线程 19 毫秒。插件应该使用 CordovaInterface.getThreadPool()。

05-12 10:27:25.308:W/PluginManager(23424):线程警告:对 NetworkDetector.getNetworkInfo 的 exec() 调用阻塞了主线程 45 毫秒。插件应该使用 CordovaInterface.getThreadPool()。

05-12 10:27:25.343:W/Settings(23424):设置 plane_mode_on 已从 android.provider.Settings.System 移至 android.provider.Settings.Global,返回只读值。

05-12 10:27:25.894: E/NONE(23424): [/apps/services/api/myApp/android/init] 失败。状态:-1,响应:未定义

05-12 10:27:25.908: E/NONE(23424): [/apps/services/api/myApp/android/query] 失败。状态:-1,响应:未定义

05-12 10:27:25.921: E/NONE(23424): [/apps/services/api/myApp/android/query] 失败。状态:-1,响应:未定义

【问题讨论】:

  • 那么,启动应用程序并让它运行后,您在 LogCat 中看到了什么?提供日志。
  • 感谢您的帮助 Idan,我已编辑问题以添加 LogCat 错误和警告,希望您现在可以更好地了解情况。
  • 您的应用程序出了点问题... 1) 您确定它正确地通过了迁移吗? 2) 它是否适用于仅执行 WL.Client.connect 调用的 new 应用程序?
  • 1)我使用IBM建议的ant任务迁移war文件,然后我在Eclipse中用7.1打开6.3文件,它开始加载,然后消息“项目已成功从x迁移到x”出现在控制台上。我想这是正确的。 2)它工作,我刚刚测试了一个新的空白项目,WL.Client.Connect 正在工作。
  • 如果您在 Studio 中进行测试,为什么要“迁移 war 文件”?这是由 Studio 为您完成的。您也可以尝试删除“本机文件夹”并重建应用程序。另请注意,您没有理由仅仅因为 Google 警告而迁移到 7.1。您只需要安装最新的 6.3 studio...

标签: android ibm-mobilefirst mobilefirst-server


【解决方案1】:

我有一个 IBM Worklight 6.3 项目,它可以正常运行。我收到了来自 Google 的票,告诉我需要更新到最新版本,否则该应用将从 PlayStore 中下架。

您无需升级到 MFP 7.1 即可解决 Google 发送的警告。

如果您还没有准备好从 6.3 到 7.1 进行大规模更改,只需转到 IBM Fix Central 并下载最新的 6.3 iFix,它修复了所有已知和当前的 Google 警告。重新构建您的应用并将其重新发布到 Google App Store。

【讨论】:

    猜你喜欢
    • 2017-02-23
    • 1970-01-01
    • 2018-06-11
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2017-09-10
    相关资源
    最近更新 更多