Some time ago, I needed Android sdk and ndk for my work with Qt. For some reasons, Android development tools are still 32 bits, which is not compatible with pure 64 bits setups, like KaOS. So, after some playing around, I have successfully been able to run everything on my KaOS (at least for my usage, which is build and deploy applications from QtCreator to Android device or emulator). Here is what I have done in case you have similar situation:

1- I installed Android SDK from http://developer.android.com/sdk/index.html

(I prefer the sdk tools only instead of the full Android Studio)

2- I installed Android NDK from http://developer.android.com/tools/sdk/ndk/index.html since my work involves C++ coding for Android.

3- I installed the "android-tools" package from KaOS repository. This will provide "adb" and "fastboot" in 64 bits. However, this was not enough. More build tools were needed.

To solve this, I have searched for the tools/utils source and found a snapshot.

4- I have downloaded a source snapshot from here: https://code.google.com/p/android-sdk/

5 - I got the latest version, currently 4.4 (https://ios-toolchain-based-on-clang-for-linux.googlecode.com/files/android-utils-4.4-r1.tar.gz)

- After build (following the instructions on the url in step 4 above), I got 64 bits version of "adb/aapt/acp/aidl/zipalign"

- I have renamed the original "aapt, aidl, zipalign" under my "android-sdk-linux/build-tools/21.1.2" folder to 32.aapt, 32.aidl, and 32.zipalign and copied the 64 bits ones I built from my "android-utils-4.4-r1" respective subfolders.

Still, this was not enough to run the emulator as I needed to make an emulation for an SD card and the provided "mksdcard" tool under your "android-sdk-linux/tools" is 32 bits.

6- I searched for the source and it was a single file (mksdcard.c) that I have downloaded and built from: https://github.com/miracle2k/android-platform_sdk/blob/master/emulator/mksdcard/mksdcard.c and have copied the resultant binary "mksdcard" to "android-sdk-linux/tools" after renaming the existing 32 bits original one.

7- Finally, to run the emulator, I have removed the "android-sdk-linux/tools/emulator" executable (as it is 32 bits) and made a soft link of "emulator" to the provided "emulator64-arm" in the same folder. (My primary testing device and emulator are arm based, if you want x86 or mips, make sure to select the appropriate one in your soft link)

This way, I was able to run everything from QtCreator starting from writing the code until deployment and testing on both the emulator and the actual device.

I hope that Google someday provides a ready made 64 bits version of the development tools. It will be much easier :)

Thanks,

--Mohamed

Ah fine, Genymotion is also in the Repos, if that helps ?

a year later

Hello i try to use Android-Studio

I recompile mksdcard but its not work.

I have always error

Unable to run mksdcard SDK tool.

Sorry now Android-studio work here.

Big thanks

2 months later

i got this error when 'make'

any suggestion ? thanks

Images.cpp:21:39: error: invalid use of incomplete type ‘png_struct {aka struct png_struct_def}’

status_t err = ((AaptFile*)png_ptr->io_ptr)->writeData(data, length);

^

In file included from Images.cpp:14:0:

/usr/include/png.h:459:16: error: forward declaration of ‘png_struct {aka struct png_struct_def}’

typedef struct png_struct_def png_struct;

^

Images.cpp: In function ‘void read_png(const char*, png_structp, png_infop, image_info*)’:

Images.cpp:93:41: error: ‘png_set_gray_1_2_4_to_8’ was not declared in this scope

png_set_gray_1_2_4_to_8(read_ptr);

^

Images.cpp:112:52: error: expected primary-expression before ‘)’ token

outImageInfo->height * png_sizeof(png_bytep));

^

Images.cpp:112:52: error: ‘png_sizeof’ was not declared in this scope

Images.cpp: In function ‘android::status_t do_9patch(const char*, image_info*)’:

Images.cpp:576:66: error: expected primary-expression before ‘)’ token

image->rows = (png_bytepp)malloc((H-2) * png_sizeof(png_bytep));

^

Images.cpp:576:66: error: ‘png_sizeof’ was not declared in this scope

Images.cpp: In function ‘void write_png(const char*, png_structp, png_infop, image_info&, int)’:

Images.cpp:987:91: error: expected primary-expression before ‘)’ token

png_bytepp outRows = (png_bytepp) malloc((int) imageInfo.height * png_sizeof(png_bytep));

^

Images.cpp:987:91: error: ‘png_sizeof’ was not declared in this scope

Images.cpp:1000:42: error: ‘Z_BEST_COMPRESSION’ was not declared in this scope

png_set_compression_level(write_ptr, Z_BEST_COMPRESSION);

^

Makefile:584: recipe for target 'aapt-Images.o' failed

make[1]: *** [aapt-Images.o] Error 1

make[1]: Leaving directory '/home/zhainhart/Downloads/Android64bit/android-utils-4.4-r1/aapt'

Makefile:387: recipe for target 'all-recursive' failed

make: *** [all-recursive] Error 1

6 months later

I had similar issues. aapt just wouldn't make because it had an issue with images.cpp like yours. In my case, I had to find pngstruct.h, it was missing from the source I downloaded. Looking at all the issues related to pngstruct above, getting a good pngstuct.h might help fix the make issue.

I found it here.
https://github.com/LuaDist/libpng/blob/master/pngstruct.h

Also, thanks mohamed, it everything has been going through so far.