2014년 12월 9일 화요일

Build apk error


Im trying to save my project to my pc as an apk but i keep getting an error. This is what im getting "Saving","Building","Packaging" then "Server error: Could not build target. Please try again later". The app is basic ,just a test with a few images all together below 1mb and 5 screens. I noticed that im unable to view the images in the emulator aswell. I restarted my PC and Browser and switched to firefox aswell but the same error occurs. Any help?

--

Are you having issues with just the one project or all projects?   It is important to know if there are coding issues on this project or something more nefarious with your project.  Do other projects load on your emulator with their images or is this the only project that is failing to compile the apk?

Restarting and switching browsers sometimes clears simple issues and you did the right thing, yours issues are more serious but probably can be overcome

 I understand you have 1mb images and five screens.  Parts of item #2 still might apply to you.  That your images do not display in 
the emulator may tell us something about the problem.  Are these png or jpg images or something different?   AI2 will not display all image formats.  Did you create or can you create an aia file?  How large is that file?   The 5Mb limit is the size of the code blocks plus images plus sound files etc.   If your aia is over 5Mb or very close to 5Mb, your issue is there.

Do you have BlueStacks loaded on your PC?   BlueStacks creates serious issues for running AI2.

One of the following  probably applies to your code (all may not apply to your code):

1)  You have coding errors in your blocks.  In the Blocks editor, look in the lower left for the yellow and red triangle icons.    If the red icon has a value larger than 0, you have a serious coding error.  Find the block in your code that has a red triangle and fix it.   Red triangles always inhibit creating an apk or running a project in the emulator or possibly creating an aia file. Yellow triangles are more forgiving, however, sometimes, these need to be fixed because they trip an internal warning and you do not get a compile, so fix the yellow triangles too.

2) Your source file (the aia file) is larger than the 5Mb limit allowed in AI2 or you put images or other resources in your Media (resources) that you do not use in the app.  All the images and sounds count toward the 5Mb limit.. You can program apps larger than 5Mb in the browser, but they will not compile and might not run in the emulator or the project may not save as an aia. If this is the case you need to reduce the size of your image and/or sound files.   Most image files can be made quite small by resizing them using a photo manipulation program on your PC to less than 50Kb each.

3)  You might have more than 10 Screens in your app.  AI2 becomes unstable when more than ten screens are used.

4) You might have used a too large image as a Screen icon for your project. Use a size of 48x48 px or 96x96px instead.

5) You did not code the entire project using App Inventor 2.   If you used one of the third-party AI2 clones, you might not be able to load a Project into the AI2 compiler.

6) If you incorrectly modified the project's Manifest files, you may have issues.

7)  Sometimes, if you have LOTS of Layouts on a single screen,  the apk might not compile.

--
i only have 1 project at the moment and theres no errors in blocks. The images on my project are .png should i change it to .jpg? im using these images as buttons linking to my other 5 screens. I have Bluestacks installed on my pc but uninstalled it and the problem still persists. I tried getting the apk from a different PC (No bluestacks on it ) as well and still failed. When i try exporting the .aia ,the browser loads and nothing else happens. 4 5 6 and 7 does not apply.

--
OK.  You can not create either an apk or an aia.

You disconnected Bluestacks.  I understand users also have to kill all running Bluestacks processes.   Do you know how to do that with Ctrl+Alt+Delete and using Task Manager?    You need to find all the BlueStacks processes, highlight them one at a time then press the "End Process" button on the lower right of the Task Manager form.   BlueStacks is a nasty program when on an AI2 development PC though I understand it is an interesting program to run Android apps.

You only have the one project, OK.   I suspect an issue with your code on this project (or all the BlueStack processes are not closed) but cannot confirm that without knowing if other projects work.  Could you create a very simple, small project and let me know if it runs please.

Projects > Start new project  and name it AI2Test or something.

now, drag a button on to the designer screen.

Build> App (save apk to my computer) .... allow a minute or so.   Does that build the Ai2Test project?

jpg or png files both should work fine in your Project.

--
I made a test and it build fine so the error should be with my app. I checked the blocks and found no errors (see attached). Could it be an issue with size? im going to start from scratch without images. Could it be an issue with Bluestacks and the blocks at the time? 


--
We are glad you got your app working again.   BlueStacks and App Inventor 2 do not get along .  BlueStacks creates serious issues with AI2 Programming.  It is important for users that do have BlueStacks installed on their computers that BlueStacks be disabled and not running when you program AI2.  This means all the Bluestacks processes also be closed using Task Manager in Windows and doing other things in Mac/Linux.

***  If you program with App Inventor 2, everyone, please avoid BlueStacks. ***

--

댓글 1개:

  1. i am having similar issue but i did on amazon mit app inventor which does not have 5 mb limit nor i have error but still its doesn't work for any apps that i have made and were working perfectly fine in past

    답글삭제