【问题标题】:IBM Worklight - AppCenter app missing Plugin 'com.ibm.mobile.InstallerPlugin'IBM Worklight - AppCenter 应用程序缺少插件“com.ibm.mobile.InstallerPlugin”
【发布时间】:2013-12-17 23:04:54
【问题描述】:

我有same problem as this user。我已经使用 eclipse(AppCenter -> Run As -> Build All Environments)构建了 IBM Worklight AppCenter 客户端应用程序,在 xcode(iphone -> Run As -> Xcode 项目)中打开它,并通过 xcode 在 iphone 模拟器中运行该应用程序。

在应用程序中输入我的 Worklight 服务器凭据(用户名、密码、服务器、端口、上下文)后,会显示“正在加载”消息并且应用程序停止运行。

我已通过应用程序的 javascript 进行调试,并将问题追溯到尝试执行对 Cordova 原生插件的调用的应用程序:

cordova.exec(pSuccessCallback,                      // Success callback from the plugin
                     function(e){     
                        console.log("Error connecting to server [code, msg, status] = " 
                                + e.errorCode + ", "
                                + e.errorMsg + ", "
                                + e.httpCode);

                        pFailureCallback(e);
                     },                              
                     'com.ibm.mobile.InstallerPlugin',      // Tell cordova to run "com.ibm.mobile.InstallerPlugin" Plugin
                     'updateConnection',                    // Tell plugin, which action we want to perform
                     [pUsername, pPassword, pServerURL]);   // Passing list of args to the plugin         

xcode 中显示此错误消息:IBMAppCenter[2315:70b] 错误:方法 'updateConnection:' not defined in Plugin 'com.ibm.mobile.InstallerPlugin'

实现此插件的本机库位于其预期位置,但应用程序似乎看不到 - IBMAppCenter/apps/AppCenter/iphone/native/appCenterLib:

  • 调试-iphoneos/libAppCenterInstallerLib.a
  • 发布-iphoneos/libAppCenterInstallerLib.a
  • Debug-iphonesimulator/libAppCenterInstallerLib.a
  • Release-iphonesimulator/libAppCenterInstallerLib.a

在应用程序中包含本机库是否需要任何其他步骤?

任何帮助将不胜感激。

【问题讨论】:

    标签: ibm-mobilefirst worklight-appcenter


    【解决方案1】:

    方法“updateConnection”在 InstallerPlugin 中定义。我认为这只是 InstallerPlugin 调用的第一个方法,因此问题可能是您不小心删除了安装程序插件。

    目录IBMAppCenter/apps/AppCenter/iphone/native/appCenterLib 必须包含不同版本的libAppCenterInstallerLib.a:

    • 调试-iphoneos/libAppCenterInstallerLib.a
    • 发布-iphoneos/libAppCenterInstallerLib.a
    • Debug-iphonesimulator/libAppCenterInstallerLib.a
    • Release-iphonesimulator/libAppCenterInstallerLib.a

    方法updateConnection包含在libAppCenterInstallerLib.a中。

    如果缺少这些库,您可以从 IBM Worklight 的原始安装目录复制它们。

    在重新生成 iphone 或 Android 环境之前,请不要删除 IBMAppCenter/apps/AppCenter 的本机目录。如果删除本机目录,则会删除那些必需的库,然后 AppCenter 客户端将无法运行。

    【讨论】:

    • libAppCenterInstallerLib.a 文件位于其预期位置。我已更新问题以反映这一点。
    【解决方案2】:

    我通过升级到 Worklight 6.1 设法解决了这个问题。

    在最新版本的 Cordova 中,插件方法签名 has changed.

    通过提取 libAppCenterInstallerlib.a 来验证这一点:

    ar -x libAppCenterInstallerlib.a

    然后运行:

    nm IBMAppCenterPlugin.o

    查找 initInfo 或 updateConnection 方法。如果他们在方法签名中有 :withDict,那么这在最新版本的 Cordova 中已被弃用。

    使用 Worklight 6.1 中的 AppCenter 项目,我不再看到此问题。

    【讨论】:

    • 但是你为什么要写这个作为答案呢?删除它并编辑原始问题,或者如果需要,打开另一个问题
    猜你喜欢
    • 1970-01-01
    • 2013-06-20
    • 1970-01-01
    • 1970-01-01
    • 2014-05-12
    • 1970-01-01
    • 2023-03-14
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多