Can’t compile,but the AIstarter is working,the error as the picture,plz

I'm a robot teacher from china,I'm not good at program,but I want my students could study at MIT in the future,thanks for your help. :joy:[图片]

Build 7 Failed: 1 Error: Your build failed due to an error in the AAPT stage, not because of an error in your program.

Welcome Sheldon

The problem is AAPT execution failed. This can happen for many reasons; here are community discussions Search results for 'aapt execution' - MIT App Inventor Community

The problem might be your use of the emulator. Did you try using Companion and a real Android device?

1 Like

thank you for your reply,my phone is SUMSUNG,the companion normal operation.

1 Like

OK. You are using Companion. Read the reason other developers received the AAPT error (if they found a solution) and see if something in their discussion applies to your app.

Otherwise post either an image of your Blocks or the Project aia . To help, someone must be able to see what you coded and what is the causing the issue. They cannot do that with out access to your code.

Has your code ever compiled correctly?

Are you using WxBIt (in China) or the main online App Inventor server.

2 Likes

Considering that you posted a build server log, I would guess that you are running one of the local distributions of AI2?

See FAQ Section: Build Errors
especially the last entry.

2 Likes

Hello Sheldon

There are numerous reasons why you might hit an AAPT (Android Asset Packaging Tool) issue. It's sometimes related to image files that are too large for example. See my check list:

ProfessorCad: Tips & Tricks Cannot Build/Install/Run APK

2 Likes

Online01.aia (1.6 MB)
the code compiled correctly at another computer.

1 Like

yes,but it sitll doesn't work.. :sob:

thanks,but your list can't be open. :sob:

Does this mean you do not receive an AAPT error if you run the code on a different computer? That is great. It is good your Project loads and works when you use a different computer.

However, does the Project also work without issues when using your computer @sheldon0503

1 Like

Just tested the link, working fine here and the site had circa 300 visitors this week.....

yes,I just try use AI_ONLINE,success compile!maybe problem is the localhost…

maybe because china Internet…

Don't think so - I spent a month in China (Nanning, before the Pandemic) and never had an issue viewing my site. I could update no problem too. If there was a problem with china internet, surely you wouldn't be able to access this forum?

Your Project is tiny but some images are too large (KB, not dimensions) when uncompressed and they have to be uncompressed before they are displayed. However, that is probably not the reason for the AAPT error.

The icon for your App should be a square. It's final shape is produced by the device (phone) and it is different from manufacturer/model to manufacturer/model - App developers must not try to change this.

webp.txt (942.3 KB)

Rename the extension of the attached file from .txt to .zip, then unzip. The files are your images, converted to the webp format, super small file sizes.

Edit: We can't use a .webp file for the icon, that has to be .png

I can build, install and run the App without issue (tap the box, it opens and a gun is displayed).

Try this version of your Project. I have changed the images but the main interest is that this one does compile and run.

Online01.aia (995.7 KB)