AI can't build project without a reason

383 views
Skip to first unread message
Assigned to ewpa...@gmail.com by chrisw...@gmail.com

volk_alex

unread,
Aug 18, 2018, 2:58:12 PM8/18/18
to mitappinv...@googlegroups.com
When i'm try to buil my app AI start building, but in one moment stopped and shown me this message:

App Inventor is unable to compile this project. 
The compiler error output was 
________Preparing application icon
________Creating animation xml
________Creating style xml
________Creating provider_path xml
________Generating manifest file
________Attaching native libraries
________Attaching Android Archive (AAR) libraries
________Attaching component assets
________Invoking AAPT
AAPT time: 0.273 seconds
________Compiling source files
.

I know that the AI usualy show error reason after "________Compiling source files", but he's don't

P/S A'm so sorry for my english. I'm from Russia

Chris Ward

unread,
Aug 18, 2018, 3:25:40 PM8/18/18
to MIT App Inventor Forum
Hi volk

We can see that it has crashed when trying to compile source files (your actual Project code). So, potentially there is an issue, most likely in your Blocks.

Check inside (every screen) for:

  • Warnings/errors 
NoWarnings.png




  • Empty jigsaw pieces
  • Procedures that do not have a Unique Name (name cannot be "procedure")
  • Duplicate Blocks
  • Code that opens a Screen that does not exist (or does exist but Name has changed). 
  • Remember, case sensitivity everywhere.

volk_alex

unread,
Aug 19, 2018, 4:07:36 AM8/19/18
to MIT App Inventor Forum
I  delete all bloks in my program and this error repeat again. But now i discern this string in top of web-page:

"Build failed! Error: Your build failed due to an error in the Attach AAR libraries stage, not because of an error in your program."

What's happend? What i can to do?

If this can help, i clip proj aia
new (1).aia

Chris Ward

unread,
Aug 19, 2018, 6:41:23 AM8/19/18
to MIT App Inventor Forum
Hi volk

Looking into your issue now. Currently I get:

App Inventor is unable to compile this project.
The compiler error output was
________Preparing application icon
________Creating animation xml
________Creating style xml
________Generating manifest file
________Attaching native libraries
________Attaching Android Archive (AAR) libraries
________Attaching component assets
________Invoking AAPT
AAPT time: 0.491 seconds
________Compiling source files


...... when Building a legacy (non API 26) APK, or rejected even faster for Google Play API 26, similar fault.

Chris Ward

unread,
Aug 19, 2018, 7:27:44 AM8/19/18
to MIT App Inventor Forum
Hi again

So, can't find anything obviously wrong in the underlying files, no corruption apparent. The Project isn't using any media files or extensions, so it's vanilla App Inventor. When the Project is loaded into App Inventor, there are no warnings or other messages of any kind.

The app runs in the Emulator. I can't read Russian but I can follow the process of the app and everything seems logical - Screen1 has an empty puzzle piece, Флажок1.Changed, but fixing that (must be fixed) did not help the build issue. There are no warnings of any kind when the app is running.

Screen2, "Statistics" has a hard-coded path to a text file to read that has previously been created by Screen1 - not sure if it wouldn't be better to use TinyDB but it works and should not cause a build issue. 

Side note: Where TinyDB is used to store and retrieve numbers, it would probably be better if the "valueIfTagNotThere" where a number rather than an empty string.

I'm going to ask MIT to look into this volk.

Assigned to Evan.



volk_alex

unread,
Aug 19, 2018, 3:48:37 PM8/19/18
to MIT App Inventor Forum
Thanks for your help. I hope this problem resolve soon

Evan Patton

unread,
Aug 20, 2018, 3:33:45 PM8/20/18
to MIT App Inventor Forum
Given that the filename is "new (1).aia", my guess is that the original project name in App Inventor is "new". I expect this is causing a world of problems given that new is a reserved keyword in Java. Try saving your project with a different project name, even new2 should suffice, and let us know if you continue to experience compilation errors.

Regards,
Evan

SteveJG

unread,
Aug 20, 2018, 3:44:37 PM8/20/18
to MIT App Inventor Forum
This may help other developers... Java 'reserved' words... avoid using these in renaming controls, procedures etc.

abstractcontinuefornewswitch
assertdefaultgotopackagesynchronized
booleandoifprivatethis
breakdoubleimplementsprotectedthrow
byteelseimportpublicthrows
caseenuminstanceofreturntransient
catchextendsintshorttry
charfinalinterfacestaticvoid
classfinallylongstrictfpvolatile
constfloatnativesuperwhile



volk_alex

unread,
Aug 20, 2018, 4:19:55 PM8/20/18
to MIT App Inventor Forum
Big thanks. I forget about this feature in java. Trouble was shutting

Chris Ward

unread,
Aug 20, 2018, 5:35:54 PM8/20/18
to MIT App Inventor Forum
aaaah - I should have remembered that, sorry guys.

Perhaps the table of keywords to avoid should be in the help?

Abraham Getzler

unread,
Aug 20, 2018, 6:31:09 PM8/20/18
to MIT App Inventor Forum

Evan Patton

unread,
Aug 20, 2018, 11:42:15 PM8/20/18
to MIT App Inventor Forum
I have an issue tracking this, so eventually it will be caught as part of the new project / import project flow. In the meantime it's a useful thing to have in the FAQ.

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