0

这是我使用 nextbus api 编写的第一个 pebble 应用程序,用于为 pebble 创建一个公交车时间应用程序。当我点击编译时,我收到一条错误消息“menuIcon 资源 'IMAGE_MENU_ICON' 超出了 (25, 25) 的最大允许尺寸”。我正在使用 CloudPebble 并且正在使用 Pebble.js。

这是我的代码。

var UI = require('ui');
var Vector2 = require('vector2');
var apiRequest = new XMLHttpRequest();

var rutgersBusList = 
"http://webservices.nextbus.com/service/publicXMLFeed?
a=rutgers&command=routeConfig";
var XML_List = apiRequest.open('GET', rutgersBusList, true);

var arr_busList = [];

for(var i = 0; i < XML_List.length; i++) {
  arr_busList.push(XML_List.body[i]);
}

var printBuses = function() {
  for(var i = 0; i < arr_busList.length; i++) {
    console.log(arr_busList[i]);
  }
};

var chooseBus = function() {
  var bus = "";
  return bus;
};

var getBusTimes = function(route) {
  var rutgersBusTimes = "http://runextbus.herokuapp.com/route/" + route;
  var JSON_Times = apiRequest.open('GET', rutgersBusTimes, true);
  var arr_busTimes = [];

  for(var i = 0; i < JSON_Times.length; i++) {
    var timesArr = JSON_Times.body[i];
    for(var j = 0; j < timesArr.predictions.length; j++) {
      arr_busTimes.push(timesArr.predictions[i]);
    }
  }

  return arr_busTimes;
 };

apiRequest.onLoad = function() {
  console.log("API Call was successful");
};

for(var i = 0; i < arr_busList.length; i++) {
    console.log(arr_busList[i].title);
}

这是我的构建日志。

Setting top to                           : /tmp/tmpMgxOI3 
Setting out to                           : /tmp/tmpMgxOI3/build 
Checking for program webpack             : 
/app/node_modules/.bin/webpack 
WARNING: enableMultiJS is not enabled for this project. 
message_keys.json will not be included in your project unless you add it 
to your pebble-js-app.js file. 
Found Pebble SDK for emery in:           : /app/sdk3/pebble/emery 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
Found Pebble SDK for diorite in:         : /app/sdk3/pebble/diorite 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
Found Pebble SDK for chalk in:           : /app/sdk3/pebble/chalk 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
Found Pebble SDK for basalt in:          : /app/sdk3/pebble/basalt 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
Found Pebble SDK for aplite in:          : /app/sdk3/pebble/aplite 
Checking for program gcc,cc              : arm-none-eabi-gcc 
Checking for program ar                  : arm-none-eabi-ar 
'configure' finished successfully (0.248s)
Waf: Entering directory `/tmp/tmpMgxOI3/build'
menuIcon resource 'IMAGE_MENU_ICON' exceeds the maximum allowed 
dimensions of (25, 25)
4

1 回答 1

0

在 CloudPebble 中,转到您的项目设置,找到菜单图标的条目,确保指定的图像是 25x25 的图像。

于 2017-11-23T03:22:54.343 回答