Game Development Community

How to Compile a Working Android apk

by Chase Webb · in Torque 2D Beginner · 08/11/2014 (11:36 pm) · 2 replies

NOTE: I'm changing the direction of the thread, so jump down to my post later on this page for the answer to my original problem and others.


Hey all. It seems like every time I get the compiler to work and then step away for a month or two, it stops working again. Unfortunately I don't have a transcript of the IRC chat from when I got help compiling last time, so maybe someone can remind me. Whenever I go to compile in Eclipse (which is slow and awkward and if you know a PC alternative I'd love to hear it) it stops on this error:

"make.exe: *** Access is denied."

Any idea how to make access NOT denied so I can try to compile again and test it on my phone? Thanks.

#1
08/12/2014 (12:26 pm)
Could you give us more details? Particularly what operating system are you using, which android SDK and NDK you're using, complete directory paths to those installed SDKs (to check to see if it could be UAC issue related), and which Torque 2D version you're trying to compile.
#2
08/17/2014 (4:50 am)
With the latest update to Eclipse a number of things are different/missing from the Android compilation tutorial, so I thought I would share a few bullet points. Keep in mind I am using Windows 7 Ultimate 64-bit, so your results may vary if your environment is different.

1- Compile for Android 4.2. Anything higher, even with a compatible device, will either fail to install or load.
2- Turn off all your security/anti-virus software, for it will interfere with the build/clean process. That was the source of my original problem in this thread.
3- The latest version of Eclipse does NOT include an NDK plug-in automatically, so you either need to copy it from an old version or find one from a separate location and install it.
4- NDK is not yet supported for Android Studio (as it is still in Beta) so you won't be able to switch over yet.
5- After you have successfully (with only warnings, no errors) cleaned and built the app, go double check by right clicking the project folder in Eclipse, going to Android Tools and attempt to create a signed package. If it says there are no errors, you're good for the next step, which surprisingly is NOT to build the package in this way (any time I try it fails to install or load on my phone). Instead, go attempt to run the build in a virtual android device within Eclipse. Once the virtual android environment has popped up you should be good to go into your Project folder, the /build/ sub folder, and find the new .apk file the Run command generated. Copy that .apk file to your device, install it, and attempt to run it.

Doing all of this, I can get the Sandbox to run, though not my own project as of yet. I have no idea why this is the only way I can get it to work, so if you have any input I'm welcome to it. Hopefully this information will help someone else in their attempts to design an Android app. Boy do I hope the iOS doesn't give me as much trouble in the future.