[英]Why do my code changes not compile or show up when I run my MonkeyC program from Eclipse?
I am using Eclipse, the ConnectIQ add-on, and MonkeyC to write an app for a Garmin watch.我正在使用 Eclipse、ConnectIQ 附加组件和 MonkeyC 为 Garmin 手表编写应用程序。 I can run several sample apps on the simulator, but most of the time my edits don't deploy when I hit "Run".
我可以在模拟器上运行多个示例应用程序,但大多数情况下,当我点击“运行”时,我的编辑不会部署。
IDE info: Eclipse IDE for Java Developers Version: 2018-12 (4.10.0) Build id: 20181214-0600 IDE 信息:面向 Java 开发人员的 Eclipse IDE 版本:2018-12 (4.10.0) 构建 ID:20181214-0600
In the Garmin SDK's ActivityTrackerApp, the default UI is laid out in the file ActivityTrackerApp.mc.在 Garmin SDK 的 ActivityTrackerApp 中,默认 UI 布局在文件 ActivityTrackerApp.mc 中。 The lines I'm editing are:
我正在编辑的行是:
var stepsPercent = info.steps.toFloat() / info.stepGoal; var stepsPercent = info.steps.toFloat() / info.stepGoal; drawBar(dc, "Steps", dc.getHeight() / 4, stepsPercent, Graphics.COLOR_GREEN);
drawBar(dc, "Steps", dc.getHeight() / 4, stepsPercent, Graphics.COLOR_GREEN);
I'm editing the string "Steps" from these two lines and then I hit "Run".我正在编辑这两行中的字符串“Steps”,然后点击“Run”。
I would expect to see the label "Steps" in the simulator changed to whatever new string I input, but the label appears unchanged.我希望看到模拟器中的标签“Steps”更改为我输入的任何新字符串,但标签看起来没有变化。 I tried restarting the simulator as well as killing the app within the simulator.
我尝试重新启动模拟器以及杀死模拟器中的应用程序。 I also tried cleaning and rebuilding the project several times with no change.
我还多次尝试清理和重建项目,没有任何变化。 I don't see any compiler errors, nor do I expect any.
我没有看到任何编译器错误,也不希望有任何错误。 What does it take to get valid code changes to compile and deploy?
获得有效的代码更改以编译和部署需要什么?
I found that I simply needed to save my changed files for the changes to be compiled.我发现我只需要保存更改的文件即可编译更改。 My confusion was based on Visual Studio in which this is done automatically.
我的困惑是基于 Visual Studio,它是自动完成的。 Not so in Eclipse, at least by default.
在 Eclipse 中并非如此,至少在默认情况下是这样。 Note that there is a setting to save automatically before build, though even after checking that setting I still have to manually hit save.
请注意,有一个设置可以在构建之前自动保存,但即使在检查该设置之后我仍然必须手动点击保存。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.