I am attempting to build the Android port of Hedgewars on Windows, using make/ant on the console. After some trial and error I managed to complete the entire build process, but the built application will not start. logcat reveals the reason to be that the classes from the Android Support library are missing.
However, the library (android-support-v13.jar) is present in the “libs” directory of the android project, and it is clearly used during the build since removing it will cause errors when compiling the java sources. I checked the classes.dex file where the library classes should be added (as far as I understand), and they do not appear to be there.
So, what might be the reason that the support library is not included in the .apk? Other (native) libraries in libs/armeabi are being included. The build is performed using ant, with a build.xml that basically just sets up the variables sdk.dir and target (android-13), then imports ${sdk.dir}/tools/ant/build.xml.
To clarify, I know how to get a working build with eclipse. The question is why the normal ant build fails to add the library, and how that can be fixed.
Here is the build.xml in the project directory (without the comments):
<?xml version="1.0" encoding="UTF-8"?>
<project name="MainActivity" default="help">
<loadproperties srcFile="local.properties" />
<property file="ant.properties" />
<loadproperties srcFile="project.properties" />
<fail
message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'"
unless="sdk.dir"
/>
<import file="${sdk.dir}/tools/ant/build.xml" />
</project>
local.properties defines sdk.dir, project.properties defines target, ant.properties is empty.
Update: Oh of course, I updated everything to the latest versions (ndk8, sdk19), pulled from the Hedgewars repository for good measure, and now it works. No idea what exactly made the difference, unfortunately. I guess that means the best candidate for the bounty is NickT, but he didn’t make it a proper answer. Suggestions in the comments.
It turns out that this was a bug in the Android SDK. The release notes of r18 say:
Since updating from r17 to r19 fixed the problem for me, this was very likely the cause of the problem. Thanks to NickT whose comment pointed me in the right direction, even if it was just a clarification question.