2016년 11월 16일 수요일

Yail compiler error - DX execution failed... Help Please!


I posted this issue in the development section but maybe this place would have been more appropriate. Also, I thought I could reach more people here and since I need solution or work-around really urgently as I have to hand it out as my final thesis at my university in a few days, I decided to post my issue here again (really sorry for any possible inconviniences about this duplicated post).

I finished developping my app, on which I worked for the past 3 months, but now I cannot compile it. This is the error I get:

App Inventor is unable to compile this project. 
The compiler error output was 
________Preparing application icon
________Creating animation xml
________Determining BR names and actions
________Generating manifest file
________Attaching native libraries
________Attaching component assets
________Compiling source files
(compiling appinventor/ai_armai123mai/Test1_copy_4_copy/Screen1.yail to appinventor.ai_armai123mai.Test1_copy_4_copy.Screen1)
(compiling /tmp/runtime1791431272433290597.scm to com.google.youngandroid.runtime)
Kawa compile time: 2.197 seconds
________Invoking DX
YAIL compiler - DX execution failed.

Unfortunately, I have no clue how to deal with these error outputs. I never set up an application icon etc.

This .aia file is just a bit larger than 1 MB.
I have no warnings or errors shown in the blocks editor.
and I only use 1 screen.

The app works perfectly on my phone using the companion, so I acutally think the issue might not be as big as it seems maybe.

Is anybody capable to read the DX compiling error log behind this?

Taifun already told me that he succeeded in compiling without my extensions.

Unfortunately, those are absolutely essential to me and I doubt that I will have enough time to do extensive researches.

Does anybody have an idea on how I could achieve a faster solution? Maybe some work-arounds to get the app installed on some phones anyhow?

I am very grateful for any help.

Thank you a lot...


--

I have no clue how to solve your compile error, but a way to show your app on somebody's phone is to install the AI companion on their phone and run the app that way. They need to load that via their PC, if they have a google-id you just give them an .aia.
When the app is loaded, I think it will keep working for a while, even with the PC not near, but I do not know how long.

--
concerning DX execution failed generally there is SteveJG's monster list  https://groups.google.com/d/msg/mitappinventortest/fLiMEfPh09Q/1Ia0AaQEXogJ
and in your case see this recommendation from Evan
Looking at the contents of your AIX files, it appears you are placing all of your extensions in the same package, which makes the ant extensions script include all of them in any AIX you build. The current best practice is to have a package per extension that contains all classes required for the extension so you may want to split up your classes accordingly. You could also strip out the unneeded classes in files/AndroidRuntime.jar on a per-extension basis to ensure backwards compatibility by not changing the package name. However, it's probably best to perform the refactoring now to save future headaches.
alternatively build each extension separately

-- 
+1 to Taifun's response as this is the most likely culprit.

Arne,

If you have all of the sources checked out to build your extensions, you can also run a local copy of App Inventor (with the Google App Engine developer server) and a local copy of the build server. Then, when you build your app you will see the full stack trace in your console to assist in debugging your extension.

-- 
Big thanks to all of you guys for the fast responses and nice advices.

Taifun, you wrote that you succeeded in compiling after removing the extensions, so I guess we can assume for sure that the cause is related to those and only 25) of Steve's monster list would apply, which is, the same as what Evan is suspecting.

Yes, two of the three extensions use the same package (com.mr.ito) while only the tcp socket one is using com.mr.ito2. Actually, I was encountered strange "could not invoke method..." errors during runtime when certain methods of this one where called which made me think that splitting in different packages was not a good idea maybe, but okay, I can split them up and test that. I could also make a more simple appand try out one extension by another. If that doesn't help, I will try to get the AI2 running locally, so I can get a more detailed error output as Evan suggested.

It's very nice to have several options to go for now. Thank you a lot for this.

By the way, does anyone of you have AI2 locally installed? If so, may I ask you to try to compile the .aia and paste the error log here, maybe? Basically, it should just be about loading the .aia and tell it to compile, no? If not, I will do that in a few days, after I finished writing the thesis and keep you in touch.

-- 
instead of writing this, in the same time you could have fixed your extensions (just build them separately) and build your app again...

 If not, I will do that in a few days, after I finished writing the thesis and keep you in touch.

but as you said, it seems to be not so urgent anymore...

-- 
Well afaik I would have to make screenshots of all blocks and detach all the blocks which are connected to the extension blocks as they would get deleted too (thats how it was when I did that in the past) when I remove the old extensions. Then I would reassemble all the blocks with the new extensions. I think that could take some time and as I would like to hand out the script by tomorrow, I think I should do that first. Yes the .apk file is not that urgent anymore as I think my prof can use the companion also, but it would be nice if I could compile it during this week. So I will do that and keep you informed.

Btw I don't think I can simply upload the new .aix files and get the extensions updated without having to reassemble the blocks. When I did that in the past, I got that duplicate error because of the same extension name but different package name.

-- 
What about using the backpack to salvage your blocks, and what about renaming the extensions, so that you do not have the naming problem?

--
Well afaik I would have to make screenshots of all blocks and detach all the blocks which are connected to the extension blocks as they would get deleted too

no
just import the new version of an extension (without deleting the old version) and the new version will replace the old version magically

--
What about using the backpack to salvage your blocks, and what about renaming the extensions, so that you do not have the naming problem?



This sounds good. I didn't pay attention to that backpack function yet, but I think the time has come!

Well afaik I would have to make screenshots of all blocks and detach all the blocks which are connected to the extension blocks as they would get deleted too
no
just import the new version of an extension (without deleting the old version) and the new version will replace the old version magically

As I wrote, this didn't work for me in the past. Usually it does update the extension and I get that nice "Extension updated" notification without the need of changing anything, but therefore the extension name AND package name had to be the same. Otherwise I got that "duplicate name" error notification.
Anyways, I will try that again. Maybe my memories are wrong.

You guys will hear from me

-- 
 but therefore the extension name AND package name had to be the same

yes exactly
usually there is no need to change the package name
and if you change the package name, then the extension is considered a totally different extension

build the extensions separately (without changing the package name) upload them into your project (without deleting the old versions) and the new versions will replace the old versions
then build your project 

-- 
Yes but... I thought I have to change the package name in order to get rid of the DX compile error, wasn't that the point?

-- 
 You do not necessarily need to change the package name, but you do need to make sure that you will only have one copy of each class file across all of your extensions. This is not a requirement of App Inventorbut of the Android SDK (specifically the DX tool, which is why you get this error). Unfortunately, with the current iteration of the extensions code this requires some moving of class files around because it attempts to package every class file it finds into the built extension, even if you only intend to use one of the classes. One thing you could try (if you're not on Windows), is having a different extensions directory for each extension (e.g., extension_a, extension_b, extension_c) and then use symbolic links to have an "extension" link pointing to a particular extension to build. Taifun has supplied a lot of extensions and may be able to give better guidance on how to manage packaging multiple extensions for App Inventor.

-- 
a little time has passed, so I would like to post a update here.

Here come the good news:

1. I handed out the thesis in time (yay) and my prof told me it would be fine if I deliver the compiled .apk file until my presentation.

2. I checked everything out and got my app working (yaaay)!! This is what I did:

I made completely new and different directories for 2 of the extensions and assigned those new package names according to the directory paths. I also changed the components for those and adjusted the source codes.

3. I imported those and replaced all the blocks from the old extension files 1 by 1. Then, i deleted the old extensions from the project.

I kept everything from the first extension (TCPSocket).

Tadaa, compiling now went fine!

Thank you all so much for the great support. I'm really glad I didnt have to redesign all the extensions and the app I wrote!

Now I'm spending some time in fixing some little bugs and I'm right about to post a new issue. You guys will see my new post regarding this.

-- 


댓글 없음:

댓글 쓰기