Setting Up For Android

  • So. I've followed all the steps, I think, to set up for android. I say I think because I've hit an infuriating snag. I've been following this video here:

    Which while I knew was old, figured it'd still be valid in some cases. I manually download everything, without the command line, and hit this error during build:

    'arm-linux-androideabi-g++' is not recognized as an internal or external command,
    operable program or batch file.
    Error: error running arm-linux-androideabi-g++ -Iinclude --sysroot=C:\android-ndk-r12b-windows-x86_64\android-ndk-r12b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/platforms/android-9/arch-arm -IC:\android-ndk-r12b-windows-x86_64\android-ndk-r12b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/sources/cxx-stl/gnu-libstdc++//include -IC:\android-ndk-r12b-windows-x86_64\android-ndk-r12b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64/sources/cxx-stl/gnu-libstdc++//libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=321 -IC:/haxelib/hxcpp/3,3,49/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -DHXCPP_CPP11 -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=9 -Wa,--noexecstack -O2 -DNDEBUG -c -Wno-invalid-offsetof -frtti -std=c++11 -o C:/Users/Robert/Desktop/AndroidTut/export/android/obj/obj/android-v7/__pch/haxe/hxcpp.h.gch C:/haxelib/hxcpp/3,3,49/include/hxcpp.h
    Build halted with errors (haxelib.exe).

    All right, so maybe, I think, I am supposed to use the command line install and let it do whatever. So I do that. And hit the same error. I've looped through this thought process and have googled and switched up an xml file and I'm still getting the same error.

    What does this mean and how do I fix it?

  • @xhunterko

    I struggled with this. I think you need to use an older Android NDK version. You can get them here.

    I'm using r9d, but I think r11 might work, too. I'm pretty sure r12 won't work.

    Extract the NDK and then go to your User folder and edit C:/Users/Robert/.hxcpp_config.xml to change the path to where you extracted the NDK.

    This is what I have. Change it if you put it somewhere else.

    <set name="ANDROID_NDK_ROOT" value="C:\Development\android-ndk-r9d" />

    See if that helps.

    Since you manually installed, check that all paths are set correctly in .hxcpp_config.xml

    The java version is another problem I had. I don't think the newest version of java works either. This is my .hxcpp_config.xml that works for me with jdk1.6.0_45. I think java jdk1.7 works now, too, but haven't tried it since this is working for me. If it ain't broke...

    	<section id="vars">
    		<set name="ANDROID_SETUP" value="true" />
    		<set name="ANDROID_NDK_ROOT" value="C:\Development\android-ndk-r9d" />
    		<set name="ANDROID_SDK" value="C:\Development\Android SDK" />
    		<set name="ANT_HOME" value="C:\Development\Apache Ant" />
    		<set name="JAVA_HOME" value="C:\Program Files (x86)\Java\jdk1.6.0_45" />

  • Thanks for trying to help.

    I am now even more infuriated though. Don't worry, it's not your fault.

    I assumed you meant jdk.6.0_45 instead of jdk1.6.0_45 and the 1 was a typo because I am fairly certain you would be unable to get the early versions. I google jdk1.6.0_45 and go to the first download page that shows up. I click to get the download button and it asks me to sign in. I don't have an account so I go to make one. It asks for personal information. Including a work phone. Which I don't have. Which I assume is a cell phone number. Which I don't have (it is not, but at this point, I don't care).

    I was going to make an account anyway just to prove that it would do me no good to download it because the same thing would probably happen. So I am not going through that trouble.

    I have jdk1.7.0_79. and android-ndk-r9d. Unless I can get that version through the command line, I don't see me getting it.

    Thanks again for trying to help.

    Is there anyone else who has had this issue as well and knows what's going on and would like to help us solve it?

  • Have you installed the required Microsoft Windows SDKs yet? I installed MS Visual Studio 2013 Update 5 which had installed it at Program Files(x86)/Microsoft SDKs (Hxcpp seems to prefer using the VS2012 SDK in my case). This is required for the C++ compiler as an alternative to the MINGW one. I'm pretty sure someone else posted a problem like this here too or somewhere else; will get back to you. And yes, I'm using Java 1.7, Android NDK r12b and the Android SDK from the Android Studio Bundle (2.1.2) and I managed to compile the sample project Flixius for Android successfully, although my initial problem was a missing windows.h file.

  • @xhunterko

    Sorry for your pain. I was there too.

    I think jdk1.7.0_79 will work. Did you set the paths in .hxcpp_config.xml?

  • @rknonchalance Yeah I do.

    @dean This is how I have the thing set currently:

    <!-- This section is parses at the beginning of the build .... -->
    <section id="vars">

    	<set name="ANDROID_SETUP" value="true" />
    	<set name="ANDROID_NDK_ROOT" value="C:\Development\android-ndk-r9d" />
    	<!--set name="ANDROID_NDK_ROOT" value="C:\Development\Android NDK\toolchains\arm-linux-androideabi-4.4.3\prebuilt\windows\bin" /--->
    	<!--set name="ANDROID_NDK_DIR" value="C:\android-ndk-r12b-windows-x86_64\android-ndk-r12b\toolchains\arm-linux-androideabi-4.9\prebuilt\windows-x86_64" /--->
    	<set name="ANDROID_SDK" value="C:\Program Files\Android\Android Studio" />
    	<set name="ANT_HOME" value="C:\Development\Apache Ant\apache-ant-1.9.7-bin\apache-ant-1.9.7" />
    	<set name="SDK_ROOT" value="C:\Program Files\Android\Android Studio" />
    	<set name="JAVA_HOME" value="C:\Program Files\Java\jdk1.7.0_79" />

    I thought perhaps setting the path directly TO the file in question would help, but no luck. Also, at once point, I was led to this article:

    Either you familiar with it?

  • @xhunterko

    I'm not sure. Best to let someone that knows more about this help you. I hope you get it sorted out soon.

    My path to Apache Ant is C:\Development\Apache Ant and it contains the bin subfolder . .hxcpp_config.xml should just point to C:\Development\Apache Antas long as C:\Development\Apache Ant\bin exists.

    I used `lime setup android' from the cmd window to install. Be aware that if you use this method it will install old NDK. It will prompt you to install Android SDK, Android NDK, Apache Ant and Java, but you can skip any or all. If you say yes to Android NDK it will install r8, so I would skip that. You can try just installing Ant and skipping the rest and see if that works.

    You might try the OpenFL forums for help with this.

  • @xhunterko I just finished doing my Android build today if it helps the lines in my .hxcpp_config.xml are below for you.

    <set name="ANDROID_SETUP" value="true" />
    <set name="ANDROID_NDK_ROOT" value="C:\Android\android-ndk-r11c" />
    <set name="ANDROID_NDK_DIR" value="c:\SDKs\" />
    <set name="ANDROID_SDK" value="C:\Android\android-sdk" />
    <set name="ANT_HOME" value="C:\Development\Apache Ant" />
    <set name="SDK_ROOT" value="c:\SDKs\" />
    <set name="JAVA_HOME" value="C:\Program Files\Java\jdk1.8.0_92" />

    Did you remember to actually install the Android SDK through the SDK Manager?

  • Hello all. Thank you for replying. This will require some future research and I'll update you with any progress on a later date.

    Again, thank you all for your time and help. You've been most kind.

Log in to reply

Looks like your connection to HaxeFlixel was lost, please wait while we try to reconnect.