Quantcast
Channel: SCN : All Content - All Communities
Viewing all articles
Browse latest Browse all 3184

Problem with mobile app - variable sap not found

$
0
0

Hi All,

 

I created an app in the web IDE and deployed locally to hybrid toolkit.

After this, I open the app with XCode on MAC OS X.

When I try to run it, I always get the same error :

 

I read the post Kapsel - Can't find variable: sap

It states that code should be in the device:onready event.
However, I am not sure which code to put there.
My index.html, (to which the error refers) looks like :

 

    <script>  function getUrlParameterName(sParam)  {  var sPageURL = window.location.search.substring(1);  var sURLVariables = sPageURL.split('&');  for (var i = 0; i < sURLVariables.length; i++)   {  var sParameterName = sURLVariables[i].split('=');  if (sParameterName[0] === sParam)   {  return true;  }  }  return false;  }                sap.ui.localResources("view");                    var app = new sap.m.App({initialPage:"idmain"});  function startApp(context) {    var page = sap.ui.view({id:"idmain", viewName:"com.test.mobile.view.main", type:sap.ui.core.mvc.ViewType.XML  });  app.addPage(page);  app.placeAt("content");  }  if (window.cordova || getUrlParameterName("companionbuster")) {  jQuery.sap.require("com.test.mobile.devapp");  com.test.mobile.devapp.initialize();  }  else {  startApp();  }  </script>

Can anyone advise ?

 

Thank you


Viewing all articles
Browse latest Browse all 3184

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>