[Solved]The error code seems to be incorrect

Do you have any issues? Don't hesitate to tell us about it.
User avatar
BetterBear
Inhabitant of a Galaxy Cluster
Posts: 2896
Joined: 18 Apr 2017, 09:03
Location: In a place you don't expect.
Plugins: Showcase Store
Version: Beta

Platform

[Solved]The error code seems to be incorrect

#1

Post by BetterBear »

Ok guys, for my 2nd plug in, It tooked me 9 hours and 15 minutes to code the JSON, still not working. I'm getting really angry now. I tried almost everything and it still won't work. So I think the JSON error message is wrong.

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

Re: The error code seems to be incorrect

#2

Post by Bearbear76 »

BetterBear wrote:Ok guys, for my 2nd plug in, It tooked me 9 hours and 15 minutes to code the JSON, still not working. I'm getting really angry now. I tried almost everything and it still won't work. So I think the JSON error message is wrong.
pm me the json file :wink:

User avatar
CommanderABab
AB
Posts: 11252
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

#3

Post by CommanderABab »

He had extra blanks in some of his tags.

Like

Code: Select all

" type": "commercial"
...

User avatar
Lobby
Developer
Posts: 3719
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

#4

Post by Lobby »

I fear that no one of us has a crystal ball 🔮 so we don't know what you tried to do, what happend instead, and why it happened. What's the error code and why do you think it's wrong?

Please consider to share some answers to this questions with us so we may help you.

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

#5

Post by Bearbear76 »

CommanderABab wrote:He had extra blanks in some of his tags.

Like

Code: Select all

" type": "commercial"
...
oh :lol:

User avatar
BetterBear
Inhabitant of a Galaxy Cluster
Posts: 2896
Joined: 18 Apr 2017, 09:03
Location: In a place you don't expect.
Plugins: Showcase Store
Version: Beta

Platform

#6

Post by BetterBear »

Ehh.... i have one

:lol:

Commander told it. I had too much blanks.

So do i need the json code to be perfectly blankless?
For example, is this right anymore:

Code: Select all

[
     {
"id":"idkwhatisthiscommercial",
"author":"betterbearwholovespizza",
"level": 1,
"width": 1,
"height": 1,
"power": -4,
"water": -2,
"frames":[{"bmp":"betterbearfirstcommercial_bmp.pmg"}],
"workers": 6,
"building time": 15
"type":"commercial"
     }
]

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

#7

Post by Bearbear76 »

BetterBear wrote:

Code: Select all

[
     {
"id":"idkwhatisthiscommercial",
"type":"commercial",
"author":"betterbearwholovespizza",
"level": 1,
"width": 1,
"height": 1,
"power": -4,
"water": -2,
"frames":[{"bmp":"betterbearfirstcommercial_bmp.pmg"}],
"workers":"6",
"building time":"15"
     }
]
maybe this should work?
Last edited by Bearbear76 on 21 Apr 2017, 11:19, edited 1 time in total.

User avatar
BetterBear
Inhabitant of a Galaxy Cluster
Posts: 2896
Joined: 18 Apr 2017, 09:03
Location: In a place you don't expect.
Plugins: Showcase Store
Version: Beta

Platform

#8

Post by BetterBear »

Lobby wrote:I fear that no one of us has a crystal ball 🔮 so we don't know what you tried to do, what happend instead, and why it happened. What's the error code and why do you think it's wrong?

Please consider to share some answers to this questions with us so we may help you.
The error code was for example, "There was an object unterminated (character 139)", then as i delete some of the code the error character just move on, just making all my stuff nonsense.

And i restarted it more that 62 times. Still no success.

User avatar
Lobby
Developer
Posts: 3719
Joined: 26 Oct 2008, 12:34
Plugins: Showcase Store
Version: Beta

Platform

#9

Post by Lobby »

Something like "Hello World" is called a string with content Hello World. Your strings have to match the expectations of the plugin loader. For example
"id " won't work as "id" is expected. Also "iD" won't work as strings are interpreted in a case sensitive way. Spaces outside of strings will be ignored and can therefore be used to improve readability (for human).

Problems like "There was an object unterminated (character 139)" are called syntax errors. They have nothing to do with the data but with the structure of your json file. Such errors can also be detected by this website.

Your latest code seems to have valid syntax, however I suspect that your image has not the file ending .pmg but .png instead.

User avatar
Lookatmemeow
Metropolitan
Posts: 123
Joined: 19 Apr 2017, 23:31
Location: The litterbox
Plugins: Showcase Store

Platform

#10

Post by Lookatmemeow »

Aldo in the code you posted there should be a coma ( , ) behind build time : 15

User avatar
Bearbear76
Former Bearbear65
Posts: 5730
Joined: 10 Feb 2017, 14:53
Location: L2 cache
Plugins: Showcase Store

Plugin Creator

Platform

#11

Post by Bearbear76 »

Lookatmemeow wrote:Aldo in the code you posted there should be a coma ( , ) behind build time : 15
really I never putted a , on the last line of code
And it worked fine :shock:

User avatar
Lookatmemeow
Metropolitan
Posts: 123
Joined: 19 Apr 2017, 23:31
Location: The litterbox
Plugins: Showcase Store

Platform

#12

Post by Lookatmemeow »

Oh no I was talking about the code where there was

Code: Select all

"build time":15
"type": commercial

User avatar
BetterBear
Inhabitant of a Galaxy Cluster
Posts: 2896
Joined: 18 Apr 2017, 09:03
Location: In a place you don't expect.
Plugins: Showcase Store
Version: Beta

Platform

#13

Post by BetterBear »

Now it said "ErrorIndexOutOfBoundsException" length=0 index=0

User avatar
CommanderABab
AB
Posts: 11252
Joined: 07 Jun 2016, 21:12
Plugins: Showcase Store
Version: Beta

Plugin Creator

Platform

#14

Post by CommanderABab »

That could be from a missing image file. Or an image that does not fit the width and height indicated in the json file.

I got this when it couldn't find the image:

Code: Select all

In /storage/emulated/0/TheoTown/plugins/Extras/avocado.json:

java.lang.ArrayIndexOutOfBoundsException: length=0; index=0

User avatar
BetterBear
Inhabitant of a Galaxy Cluster
Posts: 2896
Joined: 18 Apr 2017, 09:03
Location: In a place you don't expect.
Plugins: Showcase Store
Version: Beta

Platform

#15

Post by BetterBear »

former member wrote:What's the size of your image?
Solved. But maybe im gonna have this issue again when my power plant is finished.

Post Reply Previous topicNext topic

Return to “Problems and Errors (bugs)”