ERROR: Unable to load devices: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive

Hi, I have a weird problem with my Visual Studio enviorment on Windows 11. 

It used to work just fine then all of a sudden i get this error when I try to build any connectIQ project in visual studio:

ERROR: Unable to load devices: Expected a com.google.gson.JsonObject but was com.google.gson.JsonPrimitive

Here is the build syntax: 

Executing task in folder FontTestDF: C:\Program Files (x86)\Common Files\Oracle\Java\javapath\java.exe -Xms1g -Dfile.encoding=UTF-8 -Dapple.awt.UIElement=true -jar c:\Users\fsall\AppData\Roaming\Garmin\ConnectIQ\Sdks\connectiq-sdk-win-6.2.1-2023-06-26-124cb49c5\bin\monkeybrains.jar -o bin\FontTestDF.prg -f c:\Users\fsall\OneDrive\Garmin\Garmin Projects\Temp\FontTestDF\monkey.jungle -y c:\Users\fsall\OneDrive\Garmin\developer_key -d epix2_sim -w -l 0 

It used to work without any problem. I am not sure what I did to break it. I did some fiddling around with my onedrive account settings on my PC before the problem started but I have no idea why that should break anything. 

The SDK manager is installed and working, I can see all devices are downloaded and located here:

C:\Users\fsall\AppData\Roaming\Garmin\ConnectIQ\Devices

The same problem for every connectIQ project I have. I have spent hours trying to get things back to working but without luck. I hate when I mess up things that used to work.  

Thank you in advance 

/Fredrik

  • Update: I went into the Java control panel and noticed it had updated the Java just about when the problems started. could be on to something here....

  • re-installed Java, didn't hep...

  • and my launch.json file looks like this:

    {
        // Use IntelliSense to learn about possible attributes.
        // Hover to view descriptions of existing attributes.
        // For more information, visit: https://go.microsoft.com/fwlink/?linkid=830387
        "version": "0.2.0",
        "configurations": [
            {
                "type": "monkeyc",
                "request": "launch",
                "name": "Run App",
                "stopAtLaunch": false,
                "device": "${command:GetTargetDevice}"
            },
            {
                "type": "monkeyc",
                "request": "launch",
                "name": "Run Tests",
                "runTests": true,
                "device": "${command:GetTargetDevice}"
            },
            {
                "type": "monkeyc",
                "request": "launch",
                "name": "Run Complication Apps",
                "stopAtLaunch": false,
                "complicationSubscriberFolder": "${command:GetComplicationSubscriberFolder}",
                "complicationPublisherFolder": "${command:GetComplicationPublisherFolder}",
                "device": "${command:GetTargetDevice}"
            }
        ]
    }
  • puuh, SOLVED it by removing all devices in the SDK manager and downloaded them again.