Topic
  • 7 replies
  • Latest Post - ‏2015-04-15T10:22:07Z by BabuKaliyamoorthy
Dmitry Varavkin
Dmitry Varavkin
7 Posts

Pinned topic Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

‏2014-09-10T11:52:02Z | ecmhv ecmsupport error icn icnmobile ios mila
 
Hi eveyone!
 
Currently I'm trying to run the iOS Navigator Mobile application built from the latest sources from Jazzhub. Followed by step-by-step manual https://www.ibm.com/developerworks/community/forums/html/topic?id=53b423fc-0cdb-4022-bdce-031b6bde9454&ps=25,
I was able to download and add to the app project in Xcode the ecm.js file, which is actually our ICN API, I suppose. As per documentation I also add a statement after the ecm/model/Request.send method. 

After the app run and enter a password (see a screen 1 shot attached below), I get an error: "Either ECM Navigator API or Mila Layer were not loaded properly or not compatible, contact your administrator to configure it or disable auto client update" (see a screen 2 shot attached below). I get the error even my iPad is offline (is in airplane mode), so it looks like the problem is local.

Our version.txt on the server is 
{version: '2.0.2', revision: '20130101'}
 
Does anybody know how to solve the issue, - I will very appreciate for that.

Attachments

  • -Denis
    -Denis
    10 Posts
    ACCEPTED ANSWER

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2014-09-12T06:49:18Z  

    Also I took additional screenshot showing where is actually ecm.js file placed in the Xcode project.

    Hi Dmitry

    There are  a couple of things that might cause such an error.

    1.Make sure that all instruction are done correctly.

    2.Make sure that ecm,js modifications are compilable. (try launch app with ecm.js without any changes and then add them iteratively, pay attention to make ecm.js to take effect requires clean project)

    3.If you plan to work only with iPad there is no need to apply ecm.js modification just download it and  includes as is.

    If non of these points were helpful, please reply to this forum post.

     

  • Dmitry Varavkin
    Dmitry Varavkin
    7 Posts
    ACCEPTED ANSWER

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2014-09-15T14:25:37Z  
    • -Denis
    • ‏2014-09-12T06:49:18Z

    Hi Dmitry

    There are  a couple of things that might cause such an error.

    1.Make sure that all instruction are done correctly.

    2.Make sure that ecm,js modifications are compilable. (try launch app with ecm.js without any changes and then add them iteratively, pay attention to make ecm.js to take effect requires clean project)

    3.If you plan to work only with iPad there is no need to apply ecm.js modification just download it and  includes as is.

    If non of these points were helpful, please reply to this forum post.

     

    A small clarification for whose who faced the same issue and would like to support iPhone device. Please add following instructions into your ecm.js file. As per documentation, - open the ecm.js file with a JavaScript editor. Locate the ecm/model/Request object declaration and add a statement to the ecm/model/Request.send method as shown in bold below:

       

                if (this.requestHeaders && !this.requestHeaders["userid"] && this.requestHeaders["repositoryId"] && ecm.model.desktop) {

                    this.xmlHttpRequest.setRequestHeader("userid", ecm.model.desktop.getRepository(this.properties["repositoryId"]).userId);

                }

            

                // iPhone support

                if (ecm.model.desktop.cookieHeaders!= null && Object.keys(ecm.model.desktop.cookieHeaders).length> 0 ){

                  var cookiesHeaders = ecm.model.desktop.cookieHeaders;

                  var cookieAllValues =  "";

                  var cookieSeperator =  "" ;

                  for  (var  key in  cookiesHeaders) {

                     var cookieValue = cookiesHeaders[key];

                     cookieAllValues = cookieAllValues + cookieSeperator + key+ "=" +cookieValue;

                     cookieSeperator =  ";" ;

                  }  

                  this .xmlHttpRequest.setRequestHeader( 'Cookie' , cookieAllValues); 

                }

  • Dmitry Varavkin
    Dmitry Varavkin
    7 Posts

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2014-09-11T14:06:08Z  

    Also I took additional screenshot showing where is actually ecm.js file placed in the Xcode project.

  • -Denis
    -Denis
    10 Posts

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2014-09-12T06:49:18Z  

    Also I took additional screenshot showing where is actually ecm.js file placed in the Xcode project.

    Hi Dmitry

    There are  a couple of things that might cause such an error.

    1.Make sure that all instruction are done correctly.

    2.Make sure that ecm,js modifications are compilable. (try launch app with ecm.js without any changes and then add them iteratively, pay attention to make ecm.js to take effect requires clean project)

    3.If you plan to work only with iPad there is no need to apply ecm.js modification just download it and  includes as is.

    If non of these points were helpful, please reply to this forum post.

     

  • Dmitry Varavkin
    Dmitry Varavkin
    7 Posts

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2014-09-12T11:50:46Z  
    • -Denis
    • ‏2014-09-12T06:49:18Z

    Hi Dmitry

    There are  a couple of things that might cause such an error.

    1.Make sure that all instruction are done correctly.

    2.Make sure that ecm,js modifications are compilable. (try launch app with ecm.js without any changes and then add them iteratively, pay attention to make ecm.js to take effect requires clean project)

    3.If you plan to work only with iPad there is no need to apply ecm.js modification just download it and  includes as is.

    If non of these points were helpful, please reply to this forum post.

     

    Hi Denis

     

    I have done all steps again in a clean project:

     

    1. Unpack mobileNativeIOS.zip to new directory

    2. Download our ecmml.js.jgz from the server

    3. Rename ecmml.js.jgz to ecmml.js.zip and unpacked it

    4. Rename ecmml.js to ecm.js

    5. Put ecm.js to IBMECM/Resources/Mila/ecm directory in the Xcode project

    6. Do Product - > Clean in Xcode, built and run

     

    I have tried both simulator and iPad device, - no error anymore and content is available.

    Thank you very much!

  • Dmitry Varavkin
    Dmitry Varavkin
    7 Posts

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2014-09-15T14:25:37Z  
    • -Denis
    • ‏2014-09-12T06:49:18Z

    Hi Dmitry

    There are  a couple of things that might cause such an error.

    1.Make sure that all instruction are done correctly.

    2.Make sure that ecm,js modifications are compilable. (try launch app with ecm.js without any changes and then add them iteratively, pay attention to make ecm.js to take effect requires clean project)

    3.If you plan to work only with iPad there is no need to apply ecm.js modification just download it and  includes as is.

    If non of these points were helpful, please reply to this forum post.

     

    A small clarification for whose who faced the same issue and would like to support iPhone device. Please add following instructions into your ecm.js file. As per documentation, - open the ecm.js file with a JavaScript editor. Locate the ecm/model/Request object declaration and add a statement to the ecm/model/Request.send method as shown in bold below:

       

                if (this.requestHeaders && !this.requestHeaders["userid"] && this.requestHeaders["repositoryId"] && ecm.model.desktop) {

                    this.xmlHttpRequest.setRequestHeader("userid", ecm.model.desktop.getRepository(this.properties["repositoryId"]).userId);

                }

            

                // iPhone support

                if (ecm.model.desktop.cookieHeaders!= null && Object.keys(ecm.model.desktop.cookieHeaders).length> 0 ){

                  var cookiesHeaders = ecm.model.desktop.cookieHeaders;

                  var cookieAllValues =  "";

                  var cookieSeperator =  "" ;

                  for  (var  key in  cookiesHeaders) {

                     var cookieValue = cookiesHeaders[key];

                     cookieAllValues = cookieAllValues + cookieSeperator + key+ "=" +cookieValue;

                     cookieSeperator =  ";" ;

                  }  

                  this .xmlHttpRequest.setRequestHeader( 'Cookie' , cookieAllValues); 

                }

  • BabuKaliyamoorthy
    BabuKaliyamoorthy
    6 Posts

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2015-04-09T06:12:02Z  
    • -Denis
    • ‏2014-09-12T06:49:18Z

    Hi Dmitry

    There are  a couple of things that might cause such an error.

    1.Make sure that all instruction are done correctly.

    2.Make sure that ecm,js modifications are compilable. (try launch app with ecm.js without any changes and then add them iteratively, pay attention to make ecm.js to take effect requires clean project)

    3.If you plan to work only with iPad there is no need to apply ecm.js modification just download it and  includes as is.

    If non of these points were helpful, please reply to this forum post.

     

    I am working in an android IBM Content naigator application.I am getting "Unable to open asset URL: file:///android_asset/Mila/ecm/Logger.js" error

    while we entering app password and press continue button.What is the problem with ecm.js file.I included ecm.js file without any

    modification.because I did not find "ecm/model/Request.send" method.

    Should I have to add below code only for IOS or Should have to add in ecm.js for android?

     if (ecm.model.desktop.cookieHeaders!= null && Object.keys(ecm.model.desktop.cookieHeaders).length> 0 ){

                  var cookiesHeaders = ecm.model.desktop.cookieHeaders;

                  var cookieAllValues =  "";

                  var cookieSeperator =  "" ;

                  for  (var  key in  cookiesHeaders) {

                     var cookieValue = cookiesHeaders[key];

                     cookieAllValues = cookieAllValues + cookieSeperator + key+ "=" +cookieValue;

                     cookieSeperator =  ";" ;

                  }  

                  this .xmlHttpRequest.setRequestHeader( 'Cookie' , cookieAllValues); 

                }

    If I want to add to ecm .js file ,Where is "ecm/model/Request.send" method in ecm.js file?(I could not find it).

  • -Denis
    -Denis
    10 Posts

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2015-04-12T11:54:38Z  

    I am working in an android IBM Content naigator application.I am getting "Unable to open asset URL: file:///android_asset/Mila/ecm/Logger.js" error

    while we entering app password and press continue button.What is the problem with ecm.js file.I included ecm.js file without any

    modification.because I did not find "ecm/model/Request.send" method.

    Should I have to add below code only for IOS or Should have to add in ecm.js for android?

     if (ecm.model.desktop.cookieHeaders!= null && Object.keys(ecm.model.desktop.cookieHeaders).length> 0 ){

                  var cookiesHeaders = ecm.model.desktop.cookieHeaders;

                  var cookieAllValues =  "";

                  var cookieSeperator =  "" ;

                  for  (var  key in  cookiesHeaders) {

                     var cookieValue = cookiesHeaders[key];

                     cookieAllValues = cookieAllValues + cookieSeperator + key+ "=" +cookieValue;

                     cookieSeperator =  ";" ;

                  }  

                  this .xmlHttpRequest.setRequestHeader( 'Cookie' , cookieAllValues); 

                }

    If I want to add to ecm .js file ,Where is "ecm/model/Request.send" method in ecm.js file?(I could not find it).

    Could you share with  me the ecm.js file you put into the project

    Thanks

  • BabuKaliyamoorthy
    BabuKaliyamoorthy
    6 Posts

    Re: Error: Either ECM Navigator API or Mila Layer were not loaded properly or not compatible...

    ‏2015-04-15T10:22:07Z  
    • -Denis
    • ‏2015-04-12T11:54:38Z

    Could you share with  me the ecm.js file you put into the project

    Thanks

    Hi Denis,

               Thanks for spending time on my question.Actually the problem was with my ecm.js file.I have missed necessary functions in that file.The error message gone, after I added necessary functions in ecm.js(navigator API) file.

      

    Regards,

    Babu Kaliyamoorthy.