- MacOS 10.12.2
- Eclipse Neon.2, plug-in 2.2.3
- SDK 2.2.3
Detailed description of the issue:
When using the simulator and trying to call the Communications.makeJsonRequest() method for the Epix device the simulator crashes with a "Symbol Not Found Error" as such:
Symbol Not Found Error
in makeJsonRequest (/private/var/jenkins/workspace/Tech-CIQ-Mac-Rel/mbsimulator/submodules/technology/monkeybrains/virtual-machine/api/Communications.mb:165)
in makeRequest (/Users/douglasr/develop/garmin/watchfaces/CrashTest/source/CrashTestView.mc:44)
in onUpdate (/Users/douglasr/develop/garmin/watchfaces/CrashTest/source/CrashTestView.mc:24)
Failed invoking <symbol>
A call to the Communications.makeImageRequest() works without issue.
Steps to reproduce the issue:
1. Create a new widget project.
2. Use the view code given below.
3. Run the project and the simulator will crash immediately.
Any applicable additional information:
This is was replicated using a new project with only the Epix device (SDK 1.2.x) chosen as supported but was originally encountered on a project supporting multiple devices.
A code sample that can reproduce the issue:
using Toybox.Application as App;
using Toybox.Communications as Comms;
using Toybox.WatchUi as Ui;
class CrashTestView extends Ui.View {
function initialize() {
View.initialize();
}
// Load your resources here
function onLayout(dc) {
setLayout(Rez.Layouts.MainLayout(dc));
}
// Called when this View is brought to the foreground. Restore
// the state of this View and prepare it to be shown. This includes
// loading resources into memory.
function onShow() {
}
// Update the view
function onUpdate(dc) {
makeRequest();
// Call the parent onUpdate function to redraw the layout
View.onUpdate(dc);
}
// Called when this View is removed from the screen. Save the
// state of this View here. This includes freeing resources from
// memory.
function onHide() {
}
function makeRequest() {
var params = {
"test" => "xyz"
};
var options = {
"Content-Type" => Toybox.Communications.REQUEST_CONTENT_TYPE_JSON
};
try {
Comms.makeJsonRequest( "somesite.example.com", params, options, method(:updateData) );
}
catch (ex) {
}
}
function updateData(responseCode, json_data) {
}
}