I still haven't been able to compile an Android (Native) project. Android Studio issues the following error:
C:/Development/Kha/Backends/Kore/khacpp/include\hx/Object.h:223:52: error: no member named 'numeric_limits' in namespace 'std'
Android (Native) No Go
Sorry. I'm running Windows 10, VS Code 1.38.1, Kha downloaded from github yesterday, and gradle 5.4.1. I started a new Kha project and the Main.hx file looks like this:
package;
import kha.Assets;
import kha.System;
class Main
{
public static function main()
{
System.start({title:"TestKha", width:512, height:384}, function(_)
{
Assets.loadBlob("blob_res", function(_)
{
if(Assets.blobs.blob_res != null)
trace("Loaded!");
});
});
}
}
(I've got a 'blob.res' file in the assets folder.) I then did a native Android build and, when building, got the following error (with lots of lines deleted - just skip to the last bit):
Build command failed.
Error while executing process C:\Development\Android\android-sdk\cmake\3.6.4111459\bin\cmake.exe with arguments {--build C:\Users\Rui\Projects\TestKha\build\android-native-build\TestKha\app\.cxx\cmake\debug\armeabi --target kore}
[1/529] Building CXX object CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics2/Graphics1.cpp.o
[2/529] Building CXX object CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics2/truetype/VectorOfIntPointer.cpp.o
[3/529] Building CXX object CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics4/ConstantLocation.cpp.o
[4/529] Building CXX object CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics2/truetype/Stbtt_packedchar.cpp.o
[5/529] Building CXX object CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics2/truetype/Stbtt_temp_font_v_metrics.cpp.o
[6/529] Building CXX object CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics1/Graphics.cpp.o
FAILED: C:\Development\Android\android-ndk-r15b\toolchains\llvm\prebuilt\windows-x86_64\bin\clang++.exe --target=armv5te-none-linux-androideabi --gcc-toolchain=C:/Development/Android/android-ndk-r15b/toolchains/arm-linux-androideabi-4.9/prebuilt/windows-x86_64 --sysroot=C:/Development/Android/android-ndk-r15b/sysroot -Dkore_EXPORTS -IC:/Users/Rui/Projects/TestKha/build/android-native-build/Sources/include -IC:/Development/Kha/Backends/Kore/lib -IC:/Development/Kha/Backends/Kore/khacpp/include -IC:/Development/Kha/Backends/Kore/khacpp/project/thirdparty/pcre-8.42 -IC:/Development/Kha/Backends/Kore/khacpp/project/thirdparty/zlib-1.2.11 -IC:/Development/Kha/Backends/Kore/khacpp/project/libs/nekoapi -IC:/Development/Kha/Backends/Kore/khacpp/project/thirdparty/mbedtls-2.9.0/include -IC:/Development/Kha/Kinc/Sources -IC:/Development/Kha/Kinc/Backends/System/Android/Sources -IC:/Development/Kha/Kinc/Backends/System/POSIX/Sources -IC:/Development/Kha/Kinc/Backends/Graphics4/OpenGL/Sources -IC:/Development/Kha/Kinc/Backends/Graphics5/G5onG4/Sources -IC:/Development/Kha/Kinc/Backends/Audio3/A3onA2/Sources -isystem C:/Development/Android/android-ndk-r15b/sources/cxx-stl/gnu-libstdc++/4.9/include -isystem C:/Development/Android/android-ndk-r15b/sources/cxx-stl/gnu-libstdc++/4.9/libs/armeabi/include -isystem C:/Development/Android/android-ndk-r15b/sources/cxx-stl/gnu-libstdc++/4.9/include/backward -isystem C:/Development/Android/android-ndk-r15b/sysroot/usr/include/arm-linux-androideabi -D__ANDROID_API__=14 -g -DANDROID -ffunction-sections -funwind-tables -fstack-protector-strong -no-canonical-prefixes -march=armv5te -mtune=xscale -msoft-float -fno-integrated-as -marm -Wa,--noexecstack -Wformat -Werror=format-security -frtti -fexceptions -O0 -fno-limit-debug-info -DHXCPP_API_LEVEL=400 -DHXCPP_DEBUG -DHX_SMART_STRINGS -DKORE_MULTITHREADED_AUDIO -DANDROID -D_ANDROID -DHX_ANDROID -DHXCPP_ANDROID_PLATFORM=24 -DSTATIC_LINK -DPCRE_STATIC -DHXCPP_VISIT_ALLOCS -DKHA -DKORE -DROTATE90 -DHAVE_CONFIG_H -DSUPPORT_UTF -DSUPPORT_UCP -DKORE_G1 -DKORE_G2 -DKORE_G3 -DKORE_A1 -DKORE_A2 -DKORE_ANDROID -DKORE_OPENGL -DKORE_OPENGL_ES -DKORE_ANDROID_API=15 -DKORE_POSIX -DKORE_G4 -DKORE_G5 -DKORE_G5ONG4 -DKORE_A3 -fPIC -MD -MT CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics4/ConstantLocation.cpp.o -MF CMakeFiles\kore.dir\C_\Users\Rui\Projects\TestKha\build\android-native-build\Sources\src\kha\graphics4\ConstantLocation.cpp.o.d -o CMakeFiles/kore.dir/C_/Users/Rui/Projects/TestKha/build/android-native-build/Sources/src/kha/graphics4/ConstantLocation.cpp.o -c C:\Users\Rui\Projects\TestKha\build\android-native-build\Sources\src\kha\graphics4\ConstantLocation.cpp
In file included from C:\Users\Rui\Projects\TestKha\build\android-native-build\Sources\src\kha\graphics4\ConstantLocation.cpp:2:
In file included from C:/Development/Kha/Backends/Kore/khacpp/include\hxcpp.h:370:
C:/Development/Kha/Backends/Kore/khacpp/include\hx/Object.h:223:52: error: no member named 'numeric_limits' in namespace 'std'
virtual double __ToDouble() const { return std::numeric_limits<double>::quiet_NaN(); }
Was this detailing more helpful? The last message seems important. Notice how it says there is no member named 'numeric_limits' in namespace 'std' in function __ToDouble() in line 223 in file Kha/Backends/Kore/khacpp/include\hx/Object.h. Does this make sense to you (it's a bit alien to me, I must confess)? There are quite a few lines more in the error message, but they're all connected to this one error, so I didn't print them. Help, please!
Android (Native) No Go
Yes, that did it, thank you!
However, I had to wait over 20 minutes for the thing to compile! And the final APK size, with an empty assets folder, was over 10 whooping megs! Which is why I'd like to ask you to continue supporting the android-java target. I know it's slow, but the stuff I'm doing isn't too demanding. Besides, it compiles in less than 2 minutes and the APK is really very small. For the 'tiles & a few sprites' kinda project the android-java target is, I think, ideal. If I was doing 3D, the android-native target would be the way to go, undoubtedly, but I'm not. I'd like to say I have no idea what sort of work goes into maintaining a Kha backend, but I really like the android-java one, and I'd like to ask you to think twice before discarding it.
Thanks again!