How to host appinventor on a 32bit system?

Hi all,
I was able to successfully host appinventor on my raspberry pi running Raspbian OS 32bit arch. And visit it from out of my network with IPv6 address etc.
Anyway, It was all working all fine but when I try to compile the apps using it, on the logs it shows error at AAPT Stage. I tried running the things with Github actions, it worked all fine and I tried even with latest ai2 sources but still the same result. I first thought that it may be because of the 64 bit arch, but then I found that my pi is itself running 32 bit. But I am not able to find any other problem in the system causing this error, please check it and help :slight_smile:

System info:
Java Info:
image
Ant Info:
image
Buildserver Info:
image
Raspberry Pi Info:

Error Log of buildserver:
[java] INFO: START NEW BUILD 1
[java] Feb 09, 2021 6:33:28 PM com.google.appinventor.buildserver.BuildServer checkMemory
[java] INFO: Build 1 current used memory: 9371488 bytes
[java] Feb 09, 2021 6:33:28 PM com.google.appinventor.buildserver.ProjectBuilder build
[java] INFO: temporary project root: /tmp/1612875808882_0.11586012556473935-0
[java] Feb 09, 2021 6:33:28 PM com.google.appinventor.buildserver.ProjectBuilder extractProjectFiles
[java] INFO: extracting /tmp/1612875808882_0.11586012556473935-0/src/appinventor/ai_test/test/Screen1.bky from input zip
[java] Feb 09, 2021 6:33:28 PM com.google.appinventor.buildserver.ProjectBuilder extractProjectFiles
[java] INFO: extracting /tmp/1612875808882_0.11586012556473935-0/src/appinventor/ai_test/test/Screen1.scm from input zip
[java] Feb 09, 2021 6:33:28 PM com.google.appinventor.buildserver.ProjectBuilder extractProjectFiles
[java] INFO: extracting /tmp/1612875808882_0.11586012556473935-0/src/appinventor/ai_test/test/Screen1.yail from input zip
[java] Feb 09, 2021 6:33:28 PM com.google.appinventor.buildserver.ProjectBuilder extractProjectFiles
[java] INFO: extracting /tmp/1612875808882_0.11586012556473935-0/youngandroidproject/project.properties from input zip
[java] Feb 09, 2021 6:33:28 PM com.google.appinventor.buildserver.Execution execute
[java] INFO: ____Executing /usr/lib/jvm/java-8-openjdk-armhf/jre/bin/keytool -genkey -keystore /tmp/1612875808882_0.11586012556473935-0/android.keystore -alias AndroidKey -keyalg RSA -dname CN="test@example.com", O=AppInventor for Android, C=US -validity 10000 -storepass android -keypass android
[java]
[java] Warning:
[java] The JKS keystore uses a proprietary format. It is recommended to migrate to PKCS12 which is an industry standard format using "keytool -importkeystore -srckeystore /tmp/1612875808882_0.11586012556473935-0/android.keystore -destkeystore /tmp/1612875808882_0.11586012556473935-0/android.keystore -deststoretype pkcs12".
[java] Feb 09, 2021 6:33:33 PM com.google.appinventor.buildserver.BuildServer$ProgressReporter report
[java] SEVERE: IOException during progress report!
[java] Component assets needed, n = 0
[java] Component activities needed, n = 0
[java] Component metadata needed, n = 0
[java] Component metadata needed, n = 0
[java] Libraries needed, n = 0
[java] Native Libraries needed, n = 0
[java] Permissions needed, n = 3
[java] Feb 09, 2021 6:33:33 PM com.google.appinventor.buildserver.Compiler generatePermissions
[java] INFO: usesLocation = False
[java] Feb 09, 2021 6:33:38 PM com.google.appinventor.buildserver.BuildServer$ProgressReporter report
[java] SEVERE: IOException during progress report!
[java] Feb 09, 2021 6:33:38 PM com.google.appinventor.buildserver.Compiler writeAndroidManifest
[java] INFO: VCode: 1
[java] Feb 09, 2021 6:33:38 PM com.google.appinventor.buildserver.Compiler writeAndroidManifest
[java] INFO: VName: 1.0
[java] Feb 09, 2021 6:33:38 PM com.google.appinventor.buildserver.BuildServer$ProgressReporter report
[java] SEVERE: IOException during progress report!
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.Execution execute
[java] INFO: ___Executing /tmp/aapt949721099071397903 package -v -f -M /tmp/1612875808882_0.11586012556473935-0/youngandroidproject/../build/AndroidManifest.xml -S /tmp/1612875808882_0.11586012556473935-0/youngandroidproject/../build/intermediates/res/merged -A /tmp/1612875808882_0.11586012556473935-0/youngandroidproject/../build/assets -I /tmp/android3262320902528778152.jar -F /tmp/1612875808882_0.11586012556473935-0/youngandroidproject/../build/deploy/test.ap -m -J /tmp/1612875808882_0.11586012556473935-0/youngandroidproject/../build/generated/src --custom-package appinventor.ai_test.test --output-text-symbols /tmp/1612875808882_0.11586012556473935-0/youngandroidproject/../build/generated/symbols --no-version-vectors
[java] /tmp/aapt949721099071397903: 1: /tmp/aapt949721099071397903: ELF: not found
[java] /tmp/aapt949721099071397903: 2: /tmp/aapt949721099071397903: Syntax error: "(" unexpected
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.Compiler runAaptPackage
[java] WARNING: YAIL compiler - AAPT execution failed.
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.BuildServer build
[java] INFO: Build output: ________Preparing application icon
________Creating animation xml
________Creating style xml
________Creating provider_path xml
________Creating network_security_config xml
________Generating adaptive icon file
________Generating round adaptive icon file
________Generating adaptive icon background file
________Generating manifest file
________Attaching native libraries
________Attaching Android Archive (AAR) libraries
________Attaching component assets
________Invoking AAPT
YAIL compiler - AAPT execution failed.

[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.BuildServer build
[java] INFO: Build error output: Error: Your build failed due to an error in the AAPT stage, not because of an error in your program.
[java]
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.BuildServer checkMemory
[java] INFO: Build 1 current used memory: 9304000 bytes
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.BuildServer buildAndCreateZip
[java] SEVERE: Build 1 Failed: 1 Error: Your build failed due to an error in the AAPT stage, not because of an error in your program.
[java]
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.BuildServer$1 run
[java] INFO: CallbackURL: http://localhost:8888/ode2/receivebuild/d7kp3ar18vgo7saed55yxrzz9bgbla16qatxudmn9v0b2bv8ku9ilz08g0cjl8u16uibzo02xhii98wp4kvaxusk1ksjpy668qykaf2j74wh6yzectwxezh77sa6z9f5rzolqr727c/build/Android
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.BuildServer checkMemory
[java] INFO: Build 1 current used memory: 9342768 bytes
[java] Feb 09, 2021 6:33:40 PM com.google.appinventor.buildserver.BuildServer$1 run
[java] SEVERE: Exception: Connection reset and the length is of inputZip is 1291
[java] Feb 09, 2021 6:33:45 PM com.google.appinventor.buildserver.BuildServer checkMemory
[java] INFO: Build 1 current used memory: 9317728 bytes
[java] Feb 09, 2021 6:33:45 PM com.google.appinventor.buildserver.BuildServer$1 run
[java] INFO: BUILD 1 FINISHED

If any more info is needed please just reply :slight_smile:

I also tried to install AAPT via command-line and restarting the build server but no change but still no change :frowning_face:

image

You'll need to replace the various executables in the lib/android/tools/linux directory with their arm counterparts. The versions we include in our source tree target the x86_64 architecture. Once you're replaced the binaries you can rebuild the build server.

3 Likes

Thanks for the help, can you please also tell me where would I get those counterparts?

You should install Android Studio and get them from the build-tools folder. You might also be able to install platform specific version via apt.

2 Likes

Will the things present in Android Studio's build-tools folder be 32bit compatible?

Thanks to the moving parts of appinventor, we can host the buildserver anywhere, just config that on appengine-web.xml, and done its working. But I need to host it on raspberry pi as its more convenient to host everything there.

But still for some unknown reason the build is still not appearing on the UI


Logs:

I am running the same app inventor fork latest from github but get this error :frowning:

Why my appinventor instance hosted on Pi has image suffix?

@ewpatton I tried to host the buildserver on my pc and the build is working too but, for some reason some error is coming, log below

Check the logs on the appengine side. It's rejecting the build result from the buildserver and you should see more information there.

1 Like

Hmm, I will have a look there, however I have updated my Pi 4 to ubuntu server 64bit so I will able to host everything there

@ewpatton This error is coming now, no error message too

Java version

image

@ewpatton I thought it might be because its now 64bit but compiling need 32 bit arch, so I tried to run the command told in repo's read me, but some error came

I feel like you're mixing up too many things in order for me to help you. If you're on a Raspberry Pi still, then those versions of the libraries won't exist because it's not the right architecture. I still recommend that you should just install aapt, etc. from the Android SDK and then replace the copies in our source tree with versions known to work for your platform.

Sorry For That :sweat_smile:
I will clear the mess now,
Machine: Raspberry Pi 4 2GB Ram
Operating System: Ubuntu Server 20.04.2 LTS
Java version: image
Ant Version: image
Some More System Info:
image

Problem:

Suspected Cause: missing 32 bit libs

This step doesn't rely on any native code so 32-bit libraries are not a problem. You're also running on a 64-bit machine so you'd just want to use 64-bit binaries in that scenario. You're likely running into a memory issue given that you've only got 2 GB of RAM. Do you have swap set up for paging purposes? Do you see any OOM errors in /var/log/dmesg? You could try decreasing the max memory requested for the GWT compilation but odds are Java will then exit due to not having enough heap. Consider building YaClientApp on another platform with more RAM.

I am setting that up now

I don't find it, but some errors saying memory full or something like that

How can we do that? Can I build the appinventor on PC and transfer it to pi?

Yes now, swap setup

@ewpatton Is this step required now as when google has replaced the google android SDK for 32bit systems?

No, and it certainly won't work on a Raspberry Pi. Those instructions assume an x86_64 arch as i386 would be the corresponding 32-bit arch.