【问题标题】:Getting error while running the ionic cross platform project on xcode在 xcode 上运行 ionic 跨平台项目时出错
【发布时间】:2016-12-08 05:45:25
【问题描述】:

我是 ionic 跨平台新手,在运行 ionic 跨平台应用程序以生成构建时遇到以下错误。

DiskCookieStorage 将策略从 2 更改为 0,cookie 文件: file:///private/var/mobile/Containers/Data/Application/C234C014-5541-45C9-96A9-4D7B3E0AA4FA/Library/Cookies/Cookies.binarycookies 2016-10-15 14:55:26.568 HelloWorld[363:42830] 不平衡调用 的开始/结束外观转换。 2016-10-15 14:55:26.591 HelloWorld[363:42906] [致命] [WL_INIT] -[WLImpl initWL] in WLImpl.m:174 :: Init failure: Can't read checksum.js, The file name is invalid., (null).重新安装 申请并重试。

我使用了 MFP SDK(插件)

所以请各位大佬给点建议

它只是一个带有 MPF SDK 的 helloworld 程序。

下载了由 ionic here 生成的示例项目,但存在一些错误。错误修复代码here

【问题讨论】:

  • 您尝试过错误提示的内容吗? '重新安装应用程序并重试。'
  • 是的 Aurora000,我卸载并尝试了但没有用
  • 2016-10-15 14:55:26.432 HelloWorld[363:42830] DiskCookieStorage 将策略从 2 更改为 0,cookie 文件:file:///private/var/mobile/Containers/Data/ Application/C234C014-5541-45C9-96A9-4D7B3E0AA4FA/Library/Cookies/Cookies.binarycookies 2016-10-15 14:55:26.568 HelloWorld[363:42830] 对 的开始/结束外观转换的不平衡调用。 2016-10-15 14:55:26.591 HelloWorld[363:42906] [FATAL] [WL_INIT] -[WLImpl initWL] in WLImpl.m:174 :: Init failure: Can't read checksum.js, 文件名是无效。,(空)。重新安装应用程序并重试。
  • 使用 MFP SDK(插件)
  • 您提供的信息没有帮助。您需要提供应用程序的完整实现,以便可以对其进行调试,以及您遵循的步骤。提及您正在使用的 ionic 版本...再次提及实际项目,以便对其进行调试。

标签: ios ionic-framework ibm-mobilefirst cross-platform xcode8


【解决方案1】:

由于您提供的链接没有用(链接没有下载权限.....),我建议您关注这些博文:

  1. Integrating MobileFirst Foundation 8.0 in Ionic-based apps
  2. Best Practices for building AngularJS apps with MobileFirst Foundation 8.0

这是基本前提:

  1. 安装以下 CLI

    npm install -g mfpdev-cli npm install -g 科尔多瓦离子 npm install -g 科尔多瓦

  2. 创建一个新的离子项目

    离子启动 myApp 空白

    Ionic 自动添加 Cordova iOS v3.8 插件,但 MobileFirst Foundation v8.0 支持 Cordova iOS v4.0 及更高版本。要克服这个问题,请删除 iOS 平台并重新添加它。将目录更改为您的 Ionic 项目并运行:

    离子平台移除 ios 离子平台添加ios@latest

    如果要添加android平台,可以添加:

    离子平台添加android@latest

  3. 添加 MobileFirst Cordova SDK

    cordova 插件添加 cordova-plugin-mfp

    输入ionic plugin list可以确认安装的插件

  4. 更新离子代码

    打开 js/app.js 文件。

    模块名为starter

    angular.module('starter', ['ionic'])

    index.html 文件中的 ng-app 指令告诉 Angular 在页面上运行哪些代码。

    要将应用的视图和模型链接在一起,请在 app.js 文件中创建一个控制器

    .controller("mainCtrl", function($scope){ })

    $scope 服务允许您将变量和函数从控制器共享到视图。

    返回 index.html

    ng-controller 添加到 body 标记并包含 mainCtrl 名称。这允许您在 body 标记内的任何位置使用控制器。

    ng-controller="mainCtrl"

  5. 在 MobileFirst Server 上注册应用程序

    要启用 MobileFirst 功能,例如使用 Mobile Browser Simulator 预览应用程序,我们需要添加一些 JavaScript 代码以连接到 MobileFirst Server。

    打开app.js并在底部输入以下内容:

     function wlCommonInit() {
    console.log(">> wlCommonInit() ..." );  
    var serverUrl = WL.App.getServerUrl(function(success){
        console.log(success);
    }, function(fail){
        console.log(fail);
    });
    WLAuthorizationManager.obtainAccessToken().then(
        function (accessToken) {
          console.log(">> Success - Connected to MobileFirst Server");          
        },
        function (error) {
          console.log(">> Failed to connect to MobileFirst Server");  
          console.log(error);        
        }
    );
    

    };

  6. 向您的 MobileFirst Server 注册您的应用程序。

    mfpdev 应用注册

【讨论】:

  • Idan Adar 抱歉耽搁了,共享链接现在可以访问了,你现在可以试试,同时我会检查上面的链接。
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-03-20
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多