JsonObject error

Monkey Targets Forums/Android/JsonObject error

Alex(Posted 2015) [#1]
Hello everyone!

Have you faced this:
Simple lines work on HTML5 and iOS.
Local itemsList:String = LoadString("perksSwords.json")
Local itemsJSON:JsonObject = New JsonObject(itemsList)


Monkey v. 80c


Android debug gives me this:
E/AndroidRuntime(13364): FATAL EXCEPTION: GLThread 2208
E/AndroidRuntime(13364): com.whitezebra.knight.c_JsonError: Uncaught Monkey Exception
E/AndroidRuntime(13364): at com.whitezebra.knight.bb_json.g_ThrowError(MonkeyGame.java:8349)
E/AndroidRuntime(13364): at com.whitezebra.knight.c_JsonParser.p_Parse(MonkeyGame.java:4518)
E/AndroidRuntime(13364): at com.whitezebra.knight.c_JsonParser.p_ParseObject(MonkeyGame.java:4658)
E/AndroidRuntime(13364): at com.whitezebra.knight.c_JsonObject.m_JsonObject_new3(MonkeyGame.java:4183)
E/AndroidRuntime(13364): at com.whitezebra.knight.bb_KN_w.g_CreatePerks(MonkeyGame.java:10501)



Here's the json file:
{
	"item1":
		{
			"name"			: "Light Sword",
			"cost"			: 10,
			"toTapDmg" 		: 0,
			"toSnowDmg" 		: 0,
			"toFireDmg" 		: 0,
			"toPoisonDmg" 		: 0,
			"toPoisonDrops" 	: 0,
			"toElectricity" 	: 0,
			"toCriticalChance" 	: 0,
			"toCriticalHit" 	: 0,
			"toCannonFreq" 		: 0
		},


	"item2":
		{
			"name"			: "Golden Light Sword",
			"cost"			: 25,
			"toTapDmg" 		: 5,
			"toSnowDmg" 		: 0,
			"toFireDmg" 		: 10,
			"toPoisonDmg" 		: 0,
			"toPoisonDrops" 	: 0,
			"toElectricity" 	: 5,
			"toCriticalChance" 	: 0,
			"toCriticalHit" 	: 0,
			"toCannonFreq" 		: 0
		}
}



Alex(Posted 2015) [#2]
Solved!

Added "*.json" to BINARY_FILES in 'android/CONFIG.MONKEY'. So now I have set JSON in my config two times.
#TEXT_FILES="*.txt|*.xml|*.json"
#IMAGE_FILES="*.png|*.jpg|*.gif|*.bmp"
#SOUND_FILES="*.wav|*.ogg|*.mp3|*.m4a"
#MUSIC_FILES="*.wav|*.ogg|*.mp3|*.m4a"
#BINARY_FILES="*.bin|*.dat|*.json"


What is strange, I knew about this option, I just didn't knew I need to add it to BINARY_FILES. My other project doesn't have *.json set in BINARY_FILES, just the one in TXT_FILES and it works on the same version of android SKD and Monkey-X.