3

How do I do this from Eclipse? I can't find any way. I tried creating a build.xml with the following and adding it as the final builder:

<?xml version="1.0" encoding="UTF-8"?>
<project name="MobileRecovery" default="mergelibs">
<loadproperties srcFile="local.properties" />
<property file="ant.properties" />
<loadproperties srcFile="project.properties" />
<fail unless="sdk.dir" message="sdk.dir is missing. Make sure to generate local.properties using 'android update project'" />
<!-- version-tag: custom -->
<import file="${sdk.dir}/tools/ant/build.xml" />
<target name="mergelibs">
    <apkbuilder outfolder="bin" verbose="true" apkfilepath="bin/MobileRecovery.apk">
        <file path="bin/classes.dex" />
        <nativefolder path="libs" />
    </apkbuilder>
</target>
</project>

but all that achieves is the output apkbuilder doesn't support the nested "file" element.

At this point I'm not interested in the whys and hows of what I'm doing wrong, if someone can just give me a solution that WORKS I'll figure out the theory behind it.

Ian Kemp
  • 28,293
  • 19
  • 112
  • 138
  • I have native lib in \libs\armeabi dir on my project and Eclipse places it into APK without efforts from my side. Try to just place your library in such directory. – ggurov Oct 21 '11 at 19:19
  • @ggurov That worked, THANKS! Please answer the question so I can give you some points! – Ian Kemp Oct 24 '11 at 08:51

1 Answers1

6

Place your native library in \libs\armeabi directory of your project folder and Eclipse will put it in the package.

ggurov
  • 1,496
  • 2
  • 15
  • 21