Issue with Eclipse

Former Member
Former Member
I just started having an issue with Eclipse.
I make a change in that code ( add a new Sys.println() debug statement) save the file, and run it and that statement doesn't show up. I usually have to exit out of Eclipse, stop the simulator, restart Eclipse, clean project, and then only sometimes does the change show up. This didn't happen a week ago.

I am using debug statement, cause I don't think the Connect Eclipse plug has debug capabilities

Any ideas what is going on. Is it something I did?
  • This can happen. Often the solution is to exit eclipse and the simulator and then delete the temporary folder (rmdir /s /q %TEMP%\Garmin on windows, or rm -rf $TEMP/Garmin).

    Yes, there is currently no debugger support for ConnectIQ. Often using Sys.println is the best way to see what is going on with your code.

    Travis
  • Former Member
    Former Member over 9 years ago
    thanks

    This can happen. Often the solution is to exit eclipse and the simulator and then delete the temporary folder (rmdir /s /q %TEMP%\Garmin on windows, or rm -rf $TEMP/Garmin).

    Yes, there is currently no debugger support for ConnectIQ. Often using Sys.println is the best way to see what is going on with your code.

    Travis


    Thanks, that seems to work. Is it something *I* am doing that gets it into that state?
  • One thing to make sure of is that you have the latest SDK (1.2.5 just came out) and also the latest plugin for eclipse.

    This was a problem a few versions ago, where there would be a compile error (including in the resources and not just the code), and the last good build was launched following the error.

    You can use the SDK manager in Eclipse (the Connect IQ menu) for the SDK, and for the plugin, go to help>check for updates in Eclipse.
  • One thing to make sure of is that you have the latest SDK (1.2.5 just came out) and also the latest plugin for eclipse.

    I'm using the latest version of the SDK and the Eclipse Plugin, and I saw this problem last night. I double-checked the console and there were no errors or warnings displayed, but I kept getting the old version of my code.

    Thanks, that seems to work. Is it something *I* am doing that gets it into that state?

    One sure-fire way to avoid the problem is to build from the command line. It isn't ideal, but it does work consistently.

    Travis
  • I'm using the latest version of the SDK and the Eclipse Plugin, and I saw this problem last night. I double-checked the console and there were no errors or warnings displayed, but I kept getting the old version of my code.
    Travis


    Could it be a mac vs windows thing? I've not seen it on windows for some time now. I'm also using Eclipse Luna, are you using Eclipse Mars?

    Also, seems to me the plugin was important for this fix. What's the version of the plugin you're using? I'm on 1.2.4 of that. (SDK is 1.2.5)
  • Former Member
    Former Member over 9 years ago
    Could it be a mac vs windows thing? I've not seen it on windows for some time now. I'm also using Eclipse Luna, are you using Eclipse Mars?

    Also, seems to me the plugin was important for this fix. What's the version of the plugin you're using? I'm on 1.2.4 of that. (SDK is 1.2.5)


    I tried to go that route, and recieve the follwoing errors:
    C:\Users\Tim\workspace\SunRiseSet>monkeyc -o bin\SunRiseSet.prg -m manifest.xml C:\Users\Tim\workspace\SunRiseSet\source\SunRiseSet.mc C:\Users\Tim\workspace\SunRiseSet\source\SunRiseSetView.mc
    ERROR:stdin:1619: Unable to resolve app name. Check the manifest file.
    ERROR:stdin:1619: Unable to resolve launcher icon. Check the manifest file.

    I am using the manifest that Eclipse created.
  • You need to specify the resource files on the compile line. The manifest file refers to the app name and launcher icon resources, but if you don't compile them in, it won't be able to find them.

    The following batch file could be modified for your build environment/project and then used to build and run from the command line. I've not tested it thoroughly, but it seems to work.

    @echo off

    setlocal

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: feel free to modify things in this section
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    set SDKROOT=C:\Development\Garmin\connectiq-sdk-win-1.2.5

    ::
    :: tweak these for your project
    ::
    set MANIFEST=manifest.xml

    :: note that the caret (^) is a line contination character

    set RESOURCES=resources\strings.xml^
    resources\bitmaps.xml^
    resources\resources.xml

    set PROGRAM=bin\SunRiseSet.prg

    set SOURCES=source\SunRiseSet.mc^
    source\SunRiseSetView.mc

    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::
    :: you should not need to modify this file below this line
    ::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::::

    :: validate the sdk root specified above
    if not exist %SDKROOT%\bin\devices.xml (
    echo SDKROOT variable is not set correctly. Update %~dpnx0.
    exit /b 1
    )

    :: add the connectiq sdk to the path
    set PATH=%PATH%;%SDKROOT%\bin

    :: switch to the directory that contains this script
    pushd %~dp0

    :: make sure there is at least one command line parameter

    if .%2.==.. (
    echo usage: %~nx0 ^<device^> ^<command-sequence^>
    echo.
    echo ^<device^> The device to build and run with. Valid options are...
    echo.
    for /f "tokens=3 delims== " %%i in ('findstr /c:"<device id=" %SDKROOT%\bin\devices.xml ^| findstr /v "_sim"') do (
    echo %%~i
    )
    echo.
    echo ^<command-sequence^> The list of commands to execute. Valid options are...
    echo.
    echo clean
    echo build
    echo start
    echo run
    echo stop
    echo.
    echo.
    echo The following command line would build for the fenix3, start the
    echo simulator, run the program, and then stop the simulator.
    echo.
    echo %~nx0 fenix3 build start run stop
    echo.
    echo The following command line would just run the program. It is assumed
    echo that the program was built for the same device and that the simulator
    echo is currently running.
    echo.
    echo %~nx0 fenix3 run
    echo.
    exit /b 1
    )

    :: read the required device parameter from the command line
    set DEVICE=%1
    shift

    :: parse the remainder of the command line
    for %%a in (%*) do (
    if .%%a.==.clean. (
    rmdir /s /q %TEMP%\Garmin 2> :nul
    del /s /q %PROGRAM% 2> :nul
    )
    if .%%a.==.build. (
    monkeyc -o %PROGRAM% -m %MANIFEST% -z %RESOURCES: =;% -d %DEVICE% %SOURCES%
    )
    if .%%a.==.start. (
    connectiq
    timeout /nobreak /t 2
    )
    if .%%a.==.run. (
    monkeydo %PROGRAM% %DEVICE%
    )
    if .%%a.==.stop. (
    tskill simulator
    )
    )

    popd

    endlocal


    Travis
  • Eclipse hasb't been working for me for a LOOOOONG time. Always giving me complile erros or such which has been reported many many times before on this forum.
    Command line has been what been working all the while.

    connectiq
    monkeyc -o bin/xxx.prg -m path/to/manfest.xml -z path/to/resources.xml;path/to/properties.xml;path/to/otherXMLfiles.xml source/*.mc
    monkeydo bin/xxx.prg fenix3_sim

    The only thing missing for me when doing this on the mac is the darn editor. I can't locate something similar to notepad++ on windows which is excellent in terms of barckets matching as well as syntax highlighting.

    Been using textwrangler and perhaps I just don't know how to set it up.
  • What version of the Eclipse Plugin were you using? You can click Window > Installation Details to check. As mentioned above, 1.2.4 is supposed to resolve some of these issues. It is much better than the previous version (1.2.1 I think).

    Travis