Ant Build Failed.Pls help

Pls help.Logs below:

BUILD FAILED
D:\appinventor\appinventor-sources\appinventor\build.xml:16: The following error occurred while executing this line:
D:\appinventor\appinventor-sources\appinventor\build-common.xml:299: The following error occurred while executing this line:
D:\appinventor\appinventor-sources\appinventor\blocklyeditor\build.xml:95: org.json.JSONException: Expected a ',' or '}' at 3422 [character 113 line 74]
at org.json.JSONTokener.syntaxError(JSONTokener.java:433)
at org.json.JSONObject.(JSONObject.java:229)
at org.json.JSONObject.(JSONObject.java:321)
at msg.BlocklyTranslationGenerator.main(BlocklyTranslationGenerator.java:74)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.taskdefs.ExecuteJava.run(ExecuteJava.java:218)
at org.apache.tools.ant.taskdefs.ExecuteJava.execute(ExecuteJava.java:155)
at org.apache.tools.ant.taskdefs.Java.run(Java.java:891)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:231)
at org.apache.tools.ant.taskdefs.Java.executeJava(Java.java:135)
at org.apache.tools.ant.taskdefs.Java.execute(Java.java:108)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
at sun.reflect.GeneratedMethodAccessor4.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
at org.apache.tools.ant.helper.SingleCheckExecutor.executeTargets(SingleCheckExecutor.java:36)
at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
at org.apache.tools.ant.taskdefs.Ant.execute(Ant.java:437)
at org.apache.tools.ant.UnknownElement.execute(UnknownElement.java:299)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:498)
at org.apache.tools.ant.dispatch.DispatchUtils.execute(DispatchUtils.java:99)
at org.apache.tools.ant.Task.perform(Task.java:350)
at org.apache.tools.ant.Target.execute(Target.java:449)
at org.apache.tools.ant.Target.performTasks(Target.java:470)
at org.apache.tools.ant.Project.executeSortedTargets(Project.java:1401)
at org.apache.tools.ant.Project.executeTarget(Project.java:1374)
at org.apache.tools.ant.helper.DefaultExecutor.executeTargets(DefaultExecutor.java:41)
at org.apache.tools.ant.Project.executeTargets(Project.java:1264)
at org.apache.tools.ant.Main.runBuild(Main.java:818)
at org.apache.tools.ant.Main.startAnt(Main.java:223)
at org.apache.tools.ant.launch.Launcher.run(Launcher.java:284)
at org.apache.tools.ant.launch.Launcher.main(Launcher.java:101)

Total time: 20 seconds



buildtools doctor all passed.

1 Like

Based on this message, it seems like either an argument is missing or there's a misplaced closing bracket ("}").

1 Like


Add utf-8 here can work.
Build success.

3 Likes

Hi @Yukai_Xu
is this build.xml file?
And I cannot find the line you coded in build.xml file
Your reply would be very helpful
Thank You
Srikar

@SRIKAR_B.S.S before spamming multiple posts read the topic first. You'll find your answer

1 Like

is this the directory?

Is this the solution?
And

What about this?

Why not try it yourself?

4 Likes

That is what I mentioned in this post. :point_up_2:

What about this?

1 Like

I even tried there I cannot find it in all the three
I was using Visual Studio Code and search for JSON which @Yukai_Xu mentioned here :point_down:

I just stated the problem, not the solution; the latter is indeed the solution. Basically, the Ant build is encoded using the UTF-8 charset, instead of OP's system default charset. A charset is basically a set of characters. Think of the differences between charsets as the different syntaxes between different programming languages.

1 Like

Thanks for the explanation @NishyanthKumar

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.