ant PlayApp 2.5.1 on win 10 error

31 views
Skip to first unread message

Yong Tang

unread,
Feb 9, 2019, 3:46:15 PM2/9/19
to App Inventor Open Source Development
   

[java] java.lang.IllegalArgumentException: Unable to parse file - cannot locate beginning of $JSON section
[java] at com.google.appinventor.buildserver.FormPropertiesAnalyzer.parseSourceFile(FormPropertiesAnalyzer.java:62)
[java] at com.google.appinventor.buildserver.FormPropertiesAnalyzer.getComponentBlocksFromSchemeFile(FormPropertiesAnalyzer.java:123)
[java] at com.google.appinventor.buildserver.ProjectBuilder.getComponentBlocks(ProjectBuilder.java:279)
[java] at com.google.appinventor.buildserver.ProjectBuilder.build(ProjectBuilder.java:155)
[java] at com.google.appinventor.buildserver.Main.main(Main.java:82)



appinventor\buildserver\src\com\google\appinventor\buildserver\FormPropertiesAnalyzer.java

private static final String FORM_PROPERTIES_PREFIX = "#|\n";
private static final String FORM_PROPERTIES_SUFFIX = "\n|#";

......
String jsonSectionPrefix = FORM_PROPERTIES_PREFIX + "$JSON\n";


change 

private static final String FORM_PROPERTIES_PREFIX = "#|\r\n";
private static final String FORM_PROPERTIES_SUFFIX = "\r\n|#";

......
String jsonSectionPrefix = FORM_PROPERTIES_PREFIX + "$JSON\r\n";



or chage   \appinventor\aiplayapp\src\edu\mit\appinventor\aicompanion3\Screen1.scm  







Evan Patton

unread,
Feb 9, 2019, 4:25:46 PM2/9/19
to App Inventor Open Source Development
The issue here is that when you check out on Windows using Git, it will rewrite all of the line endings from Unix to Windows. This breaks the FormSourceAnalyzer. We need to make it more robust, but the correct thing here isn't to just change the lines from Unix to Windows line endings as that just breaks it for those of us using macOS and Linux. Instead, it should be robust to either line ending.

Regards,
Evan

Yong Tang

unread,
Feb 10, 2019, 5:25:27 AM2/10/19
to App Inventor Open Source Development
  private static final String FORM_PROPERTIES_PREFIX = "#|" + System.getProperty("line.separator");
  private static final String FORM_PROPERTIES_SUFFIX = System.getProperty("line.separator") + "|#";




String jsonSectionPrefix = FORM_PROPERTIES_PREFIX + "$JSON" + System.getProperty("line.separator");

在 2019年2月10日星期日 UTC+8上午4:46:15,Yong Tang写道:

Evan Patton

unread,
Feb 11, 2019, 3:58:55 PM2/11/19
to App Inventor Open Source Development
Please take a look at PR 1556 and let me know if it solves your issue.

Regards,
Evan
Reply all
Reply to author
Forward
0 new messages