Can't target NME to Android

105 views
Skip to first unread message

Daniel Freeman

unread,
May 15, 2013, 4:57:33 AM5/15/13
to haxe...@googlegroups.com
So after the huge effort of getting a development environment working with Haxe NME.  It seems that I've hit a show-stopper problem.  I can export to almost every target I'd like, including Mac, HTML, iOS, .swf - except the one that really matters - Android!

In MonoDevelop, I just get an error that says: can't find '/Users/danielfreeman/Projects/HTestMono/HTestMono/Export/android/bin/bin/Main-debug.apk' to install

If I try and build from the command line, I get:

nme build android
haxelib run hxcpp Build.xml haxe -DAPP_COMPANY -Dactuate -Dandroid -Dcpp -Dhaxe_208 -Dhaxe_209 -Dhaxe_210 -Dmobile -Dnme -Dnme_install_tool -Dsys -Dtrue
Creating obj/android/__pch/haxe/hxcpp.h.gch...
arm-linux-androideabi-g++ -Iinclude --sysroot=/Applications/android-ndk-r6b/platforms/android-5/arch-arm -I/Applications/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/4.4.3/include -I/Applications/android-ndk-r6b/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -Dhaxe_210 -I/usr/lib/haxe/lib/hxcpp/2,10,3//include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -D_LINUX_STDDEF_H  -Wno-psabi -march=armv5te -mtune=xscale -msoft-float -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID -Wa,--noexecstack -O2 -DNDEBUG -c -frtti -o obj/android/__pch/haxe/hxcpp.h.gch /usr/lib/haxe/lib/hxcpp/2,10,3//include/hxcpp.h
/usr/lib/haxe/lib/hxcpp/2,10,3//include/hxcpp.h:13:20: error: typeinfo: No such file or directory
In file included from /usr/lib/haxe/lib/hxcpp/2,10,3//include/hxcpp.h:169:
/usr/lib/haxe/lib/hxcpp/2,10,3//include/Array.h:195:21: error: algorithm: No such file or directory
In file included from /usr/lib/haxe/lib/hxcpp/2,10,3//include/hxcpp.h:161:
/usr/lib/haxe/lib/hxcpp/2,10,3//include/hx/Object.h: In member function 'void hx::ObjectPtr<O>::CastPtr(hx::Object*)':
/usr/lib/haxe/lib/hxcpp/2,10,3//include/hx/Object.h:143: error: must #include <typeinfo> before using typeid
In file included from /usr/lib/haxe/lib/hxcpp/2,10,3//include/hxcpp.h:169:
/usr/lib/haxe/lib/hxcpp/2,10,3//include/Array.h: In member function 'void Array_obj<ELEM_>::sort(Dynamic)':
/usr/lib/haxe/lib/hxcpp/2,10,3//include/Array.h:388: error: 'sort' is not a member of 'std'
In file included from /usr/lib/haxe/lib/hxcpp/2,10,3//include/hxcpp.h:170:
/usr/lib/haxe/lib/hxcpp/2,10,3//include/Class.h: In function 'bool hx::TCanCast(hx::Object*)':
/usr/lib/haxe/lib/hxcpp/2,10,3//include/Class.h:139: error: must #include <typeinfo> before using typeid
Called from ? line 1
Called from BuildTool.hx line 1448
Called from BuildTool.hx line 667
Called from a C function
Called from BuildTool.hx line 702
Called from BuildTool.hx line 836
Called from BuildTool.hx line 870
Called from BuildTool.hx line 191
Uncaught exception - Error creating pch: 256 - build cancelled
Error: Source path "Export/android/obj/libApplicationMain.so" does not exist


I even tried opening the Android project in Eclipse, and tried building it using the Android SDK - LogCat complained about not being able to find ApplicationMain.



Below is some more information that may be pertinent to the issue:-

haxelib list
actuate: [1.52]
hxcpp: [2.10.3]
nme: [3.5.5]
svg: [1.04]
swf: [1.17]


more .hxcpp_config.xml
<!--

  This file will get included twice - once at the beginning - once at the end.

  The first time though, the "vars" section is parsed, and this is where you can
   set variables to control the setup of the standard compilers and install paths etc.

  The second time, the "exes" section is parsed, and you can modify the linkers/compilers
   by adding flags to these executables.
  
-->

<xml>

  <!-- This section is parses at the beginning of the build .... -->
  <section id="vars">
                
                <set name="SDK_ROOT" value="/SDKs/" />
                <set name="ANDROID_SDK" value="/Applications/android-sdk-mac_x86" />
                <set name="ANDROID_SETUP" value="true" />
                <set name="ANDROID_NDK_ROOT" value="/Applications/android-ndk-r6b" />
                
        </section>


  <!-- Use this section to add flags to the compilers and linkers -->
  <section id="exes">

     <!-- Compiling on windows ... -->
     <compiler id="MSVC" if="windows">
        <!-- Example adding a build flag -->
        <!-- <flag value = "-Ie:/VS8//PlatformSDK/Include"/> -->
     </compiler>

     <!-- Linking on windows ... -->
     <linker id="dll" if="windows">
        <!-- Add library paths for windows (DirectX needed for building NME) -->
        <!-- <flag value = "-libpath:e:\VS8\DirectXSDK\Lib\x86"/>
        <flag value = "-libpath:e:/VS8/PlatformSDK/Lib"/> -->
     </linker>

     <!-- And for linking executables -->
     <linker id="exe" if="windows">
        <!-- <flag value = "-libpath:e:/VS8/PlatformSDK/Lib"/> -->
     </linker>

  </section>

</xml>

Daniel Freeman

unread,
May 16, 2013, 10:53:00 PM5/16/13
to haxe...@googlegroups.com
I found a solution.  I reloaded both SDK and NDK using nme setup android.  (Although, the versions I was using previously were up-to-date as far as I know).
Reply all
Reply to author
Forward
0 new messages