Error building app inventor offline

Sir i m building app inventor offline but getting this error after enter ant
CheckBlocklyCompile:

BlocklyCompile:
[java] Exception in thread “main” java.lang.IllegalArgumentException: File not found at: C:\appinventor-sources\appinventor\blocklyeditor…\lib\closure-library\closure\goog
[java] at com.google.common.base.Preconditions.checkArgument(Preconditions.java:88)
[java] at org.plovr.Manifest.getInputs(Manifest.java:393)
[java] at org.plovr.Manifest.getFiles(Manifest.java:369)
[java] at org.plovr.Manifest.getFiles(Manifest.java:363)
[java] at org.plovr.Manifest.getAllDependencies(Manifest.java:324)
[java] at org.plovr.Manifest.getInputsInCompilationOrder(Manifest.java:193)
[java] at org.plovr.Manifest.getCompilerArguments(Manifest.java:177)
[java] at org.plovr.CompileRequestHandler.compile(CompileRequestHandler.java:94)
[java] at org.plovr.cli.BuildCommand.runCommandWithOptions(BuildCommand.java:58)
[java] at org.plovr.cli.BuildCommand.runCommandWithOptions(BuildCommand.java:31)
[java] at org.plovr.cli.AbstractCommandRunner.runCommand(AbstractCommandRunner.java:41)
[java] at org.plovr.cli.Command.execute(Command.java:47)
[java] at org.plovr.cli.Main.mainWithExitCode(Main.java:56)
[java] at org.plovr.cli.Main.main(Main.java:30)
[java] Picked up _JAVA_OPTIONS: -Xmx1024M

BUILD FAILED
C:\appinventor-sources\appinventor\build.xml:16: The following error occurred while executing this line:
C:\appinventor-sources\appinventor\build-common.xml:292: The following error occurred while executing this line:
C:\appinventor-sources\appinventor\blocklyeditor\build.xml:63: Java returned: 1

Total time: 25 seconds
Picked up _JAVA_OPTIONS: -Xmx1024M

Follow this link this might help you
http://josmas.github.io/contributingToAppInventor2

Probably the step you are missing is

git submodule update --init

We should include a post-checkout git hook to update the submodules automatically. What do you say, @ewpatton ?

Post-checkout won’t work because you really only need to do this if freshly cloning. Client-side hooks aren’t kept in the repo (see note under Client Side Hooks), so there’s no way to enforce that people create the post-checkout hook just as there isn’t really a way to force them to read the README with the instructions about the command to run.

What we could do is have an ant target that gets called at the beginning of a build that checks if the submodules are present and, if not, prints an error message informing them that they need to run the git submodule update --init command, which is more informative than the stack trace. I’d prefer not to run the command automatically because if someone is doing work on a submodule there’s the possibility the work might be overridden.

1 Like

thanks ant build succesfully
But sdk folder showing empty error after ant build succesfully

Pls help
$ your-google-cloud-SDK-folder/bin/java_dev_appserver.sh
–port=8888 --address=0.0.0.0 appengine/build/war/
Make sure you change your-google-cloud-SDK-folder to wherever in your hard drive you have placed the Google Cloud SDK.

How to change this ?

Other wise everythink is working fine
Ant build successfully
MakeAuthkey successfully
Localbuild server runing

Hello… Download Appengine java sdk from this link : https://www.npackd.org/p/com.google.AppEngineJavaSDK/1.9.76, unzip and copy in c drive as appengine-java-sdk-1.9.76 .
Now Run this command :
c:/appengine-java-sdk-1.9.76/bin/dev_appserver.cmd --port=8888 --address=0.0.0.0 appengine/build/war/

after some time you will get a message like SERVER RUNNING…
Open browser and type http://localhost:8888

Did you solved all error

Yes i have done

Hello, myself Abhishek Singh. I am an electronics engineer. I am working as a scientist in INDIA. i am also facing the same error, while building. When i type “ant” command it gives the same error as yours. I followed the replies in this post, but it didn’t worked out. My Java env variable settings are all ok. Also when i type “ant buildserver” after going to buildserver folder in appinventor, the buildserver starts running after a lot of commands. please tell anybody what is wrong while using “ant” command.

Scientist,
Abhishek
INDIA

Please see @Souvik_Bera’s answer earlier in this thread to solve the problem. Otherwise, please include more details about the exact error message you’re encountering.

My issue has been solved. Actually, i was trying to run ‘ant’ command from “appinventor” folder, so it was showing error. But when I issued ‘ant’ command from “appinventor\buildserver” folder, it build successfully.
The screen shots of cmd prompt are attached for the reference. Thanks for the reply.


build success

I followed Souvik_Bera link. I have another issue while trying to run the main server in google cloud sdk folder using the command:

“google-cloud-SDK-folder”/bin/java_dev_appserver.cmd --port=8888 --address=0.0.0.0 appengine/build/war/

I followed the link https://docs.google.com/document/d/1Xc9yt02x3BRoq5m1PJHBr81OOv69rEBy8LVG_84j9jc/pub, on how to build main server.

   So, I connected to appinventor folder using cmd prompt, and while running the above command, i made some changes, since my google-cloud-SDK-folder is " C:\Program Files\Google\CloudSDK\google-cloud-sdk "
So, i written --  C:\PROGRA~1\Google\CloudSDK\google-cloud-sdk  instead, since it was showing error. Also i changed  the 'java_dev_appserver.cmd' to 'dev_appserver.cmd' in the above command, since my google cloud bin folder does not have it, as shown in attached image below.

the two images of cmd prompt and another of my google cloud sdk bin folder are attached.

 Please help me on why my above command is not getting successful ??

Ai2Rundev.bat

@echo off
%1(start /min cmd.exe /c %0 :&exit)
chcp 65001
echo “Starting App Inventor 2 DevAppServer…”
title DevAppServer
cd %~dp0

SET JAVA_HOME=%~dp0OPENJDK
SET PYTHON_HOME=%~dp0Python
SET Cloud_SDK_HOME=%~dp0google-cloud-sdk
SET PATH=%PATH%;%JAVA_HOME%\bin;%PYTHON_HOME%;%Cloud_SDK_HOME%\bin;

SET JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8"

for /f “tokens=1-5” %%i in (‘netstat -ano^|findstr “8888”’) do (
echo kill the process %%m use the port 8888
taskkill /F /T /pid %%m
)
java_dev_appserver.cmd --port=8888 --disable_update_check --address=0.0.0.0 DevServer

======================================================================
Ai2Runbud.bat

=====================================================================
@echo off
%1(start /min cmd.exe /c %0 :&exit)
chcp 65001
echo “Starting App Inventor 2 BuildServer…”
title BuildServer
cd %~dp0

SET JAVA_HOME=%~dp0OPENJDK
SET PYTHON_HOME=%~dp0Python
SET BUILD_HOME=%~dp0BuildServer
SET Cloud_SDK_HOME=%~dp0google-cloud-sdk
SET dexcache=%~dp0dexcache
SET PATH=%PATH%;%JAVA_HOME%\bin;%PYTHON_HOME%;%Cloud_SDK_HOME%\bin;

SET _JAVA_OPTIONS= -Xms64m -Xmx1024m
SET JAVA_TOOL_OPTIONS="-Dfile.encoding=UTF-8"
if exist %dexcache% (
cd %dexcache%
del /q “*.jar”
cd …
)
for /f “tokens=1-5” %%i in (‘netstat -ano^|findstr “:9990”’) do (
echo kill the process %%m use the port 9990
taskkill /F /T /pid %%m
)

cd “%BUILD_HOME%”

java -cp “*” com.google.appinventor.buildserver.BuildServer --dexCacheDir %dexcache%

=========================20200401015714 ============================================

Below are the initial steps for building main server from appinventor sources:

  1. I have downloaded the sources using git clone.
  2. I created a txt file named ‘.gitignore’, and pasted the contents of ‘sample-.gitignore’ file from the repository into ‘.gitignore’ txt file.
  3. Then by using git console i connected in ‘appinventor’ folder and ran ‘ant clean’, followed by ‘ant MakeAuthKey’, and then ‘ant’ command.
    Also, I installed all the exes as told in the section 5.1 of link below, except android SDK and jekyll software. I also installed adb tool, and is working in cmd prompt.
    https://docs.google.com/document/d/1Xc9yt02x3BRoq5m1PJHBr81OOv69rEBy8LVG_84j9jc/pub#h.5p32kqx16c2d

After the above commands, I executed the command for main server as shown in image below:

I could not get what is the error, it is unable to open java_dev_appserver.py file ??

"E:\appengine-java-sdk-1.9.75\bin\dev_appserver.cmd" --port=8888 --address=0.0.0.0 "E:\appinventor-sources\appinventor\appengine\build\war"

Just replace according to your path and and run. It should work.

Note: Make sure build is successful

I have followed the link http://josmas.github.io/contributingToAppInventor2/#/, as told by Souvik_Bera. I didn’t ran the cmd $ git submodule update --init. Now the server is running. Thanks to all for the support.
Also, if want to shutdown the server, i tried CRTL+C, but it is not working. what is the cmd to quit server ?

Abhishek Singh

1 Like