sublime-ti-build icon indicating copy to clipboard operation
sublime-ti-build copied to clipboard

Build fails with "ValueError: No JSON object could be decoded"

Open REBELinBLUE opened this issue 11 years ago • 19 comments

If I try to run the build on iOS simulator I get this in the console.

Specifically

Traceback (most recent call last): File "./json/scanner.py", line 30, in _scan_once IndexError: string index out of range

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./json/decoder.py", line 368, in raw_decode File "./json/scanner.py", line 32, in _scan_once StopIteration

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "/Users/stephen/Library/Application Support/Sublime Text 3/Packages/Titanium Build/Titanium.py", line 196, in select_ios_target self.load_ios_sdk_info() File "/Users/stephen/Library/Application Support/Sublime Text 3/Packages/Titanium Build/Titanium.py", line 344, in load_ios_sdk_info info = json.loads(result.decode('utf-8')) File "./json/init.py", line 319, in loads File "./json/decoder.py", line 352, in decode File "./json/decoder.py", line 370, in raw_decode ValueError: No JSON object could be decoded

If I run the command it appears to be running, titanium info --types ios --output json I get back a valid json structure

REBELinBLUE avatar Sep 24 '14 10:09 REBELinBLUE

getting same error as @REBELinBLUE on mac osx 10.8.5 st3

asartz avatar Sep 26 '14 15:09 asartz

Titanium Build hasn't been updated for 3.4.0 yet, I'm assuming this is the issue, I will be looking at it and hopefully fixing it later today, I will post back with my results this evening.

thisishuey avatar Sep 26 '14 16:09 thisishuey

It could also be an issue with Xcode 6, either way I will check it out for both situations.

thisishuey avatar Sep 26 '14 16:09 thisishuey

Well I don't have Xcode 6 installed. Latest 5 series here.

asartz avatar Sep 26 '14 16:09 asartz

Which versions of Titanium CLI and SDK are you using?

thisishuey avatar Sep 26 '14 17:09 thisishuey

Not in front of the machine right now. But I believe I got the latest version of sdk before 3.4.0 I read about 3.4.0 this morning and I didn't update. As for the cli everything was uptodate to the state before 3.4.0 sdk release. Not sure. Could give more details tomorrow morning.

asartz avatar Sep 26 '14 17:09 asartz

Hmmm, so it was working for both of you and then all the sudden stopped? Or it has never worked?

On my local machine I'm running:

Sublime Text 3, Build 3065 Xcode 5.1.1 (build 5B1008) with iOS SDK 7.1 Titanium Studio, build: 3.3.0.201407100905 Titanium CLI: 3.3.0 Titanium SDK: 3.3.0.GA Alloy: 1.4.1 Node: v0.10.30

My plan for this weekend was to update Titanium Build to work with 3.4.0 and Xcode 6 to get it working with the new software, but it sounds like you guys are having trouble with the regular configuration?

thisishuey avatar Sep 26 '14 21:09 thisishuey

It has never worked. Been checking it out for the first time after tasting the ide horror. well the configuration is identical. i had an oldest node version (0.10.13) but i upgraded to 0.10.32 (latest stable). Error still persists. i can choose ios simulator but then the error appears. only change i did in sublime user config for package was to set dir for cli at /usr/local/bin instead of proposed /usr/bin pls notice that the project runs fine from commandline using the cli

asartz avatar Sep 27 '14 08:09 asartz

Exactly the same, I only installed it a few days ago after getting fed up with the IDE. I don't know the exact versions off hand bit will confirm on monday when I am at my computer

REBELinBLUE avatar Sep 27 '14 18:09 REBELinBLUE

Sublime Text 3, Build 3065 Xcode 6.0.1 (build 6A317) Titanium CLI: 3.4.0-rc4 Titanium SDK: 3.4.0.v20140918202513 Alloy: 1.5.0-rc2 Node: v0.10.21

REBELinBLUE avatar Sep 29 '14 09:09 REBELinBLUE

@asartz so I'm not quite sure why your's isn't working at the moment, I thought it was related to 3.4.0 cli update but that doesn't appear to be the issue in your case.

@REBELinBLUE your's is exactly what I was expecting to be the problem, I still need to update the code to handle 3.4.0. I held off on the update this weekend to see if we could get more info on your systems. So a fix is coming for your situation but unfortunately I will be out of town this week and unable to work on it. Luckily this script is just a convenience script for the actual Titanium CLI, so hopefully that can tide you over for now.

thisishuey avatar Oct 01 '14 13:10 thisishuey

Thanks, that is exactly what I have been doing

REBELinBLUE avatar Oct 01 '14 19:10 REBELinBLUE

So I updated to Xcode 6 but kept Xcode 5.1.1 around to use with older SDK builds.

I am unable to recreate this bug with any of my builds. I can build my 3.1.3.GA projects with Xcode 5 using the usual interface and my 3.4.0.GA projects using the same interface. Everything appears to be working as expected. I've tried uninstalling and reinstalling the package, no difference, so it appears that I have something setup that you guys don't and I'm not sure what it is at the moment.

Is there any more information you guys can give me on your setups?

thisishuey avatar Oct 09 '14 05:10 thisishuey

It seems the error occurs when node can't be found. Titanium.py at line 343:

result, error = process.communicate()

Communicate() only returns an error env: node: No such file or directory while leaving result empty which causes the ValueError: No JSON object could be decoded exception when it's decoded as JSON.

My node install is located at /usr/local/bin/node. Everything runs just fine after I created a node symlink at /usr/bin/node.

sudo ln -s /usr/local/bin/node /usr/bin/node

arrmnd avatar Dec 05 '14 09:12 arrmnd

That did indeed work for me

REBELinBLUE avatar Dec 05 '14 09:12 REBELinBLUE

I've exactly the same bug "ValueError: No JSON object could be decoded"

Any solution ? :/

rkueny avatar Jan 21 '15 20:01 rkueny

The symlink worked for me

REBELinBLUE avatar Jan 21 '15 20:01 REBELinBLUE

As much for me, the symlink worked for me too :+1:

rkueny avatar Jan 22 '15 10:01 rkueny

I confirm, the symlink does the trick. Not sure exactly why tho...

clemblanco avatar Mar 30 '15 08:03 clemblanco