I made a neko project for Windows using FlashDevelop. I want to see if I can port it for android without remaking code or too much of it. In the past I was able to port to hmtl5 without having to remake code. Of course making an APK is different and requires getting some packages installed, I know that. The question is can I build android or I have to start a new project (like AS3) and go on in its own way?
I setup the
Path to Android SDK [C:\Programs\Android Development\platform-tools]: (contains adb, other files and the build-tools folder)
Path to Android NDK [C:\Programs\Android Development\android-ndk-r20]:
Path to Java JDK [C:\Programs\Android Development\jdk1.8.0_221]:
A simple project that displays an image. Errors I get when building 'android'
‘arm-linux-androideabi-g++’ is not recognized as an internal or external command,
operable program or batch file.
Error: Could not create PCH
Build halted with errors.
Or
in NativeCFFI.hx error: function body required
#:cffi private static function lime_jni_create_method(className:String, method:String, signature:String, isStatic:Bool, quiet:Bool):Dynamic;
‘arm-linux-androideabi-g++’ is not recognized as an internal or external command, operable program or batch file. Error: Could not create PCH Build halted with errors.
That error comes from an Android NDK that is too recent. Current HXCPP releases only support versions up to r15c, so I suggest you downgrade to that version.
Alternatively, you could try installing HXCPP from GitHub, as support for newer NDKs was recently merged.
Related
I have a CMake project which has an external dependency (Crypto++). The external project has a vcxproj file provided, so in order to add it to the build process, I added it like this:
ExternalProject_Add(CryptoPP
SOURCE_DIR ${CRYPTOPP_SRC_DIR}
CONFIGURE_COMMAND ""
BUILD_COMMAND "${MSBUILD_EXE}"
"/p:OutDir=<BINARY_DIR>/bin/$<CONFIG>/"
"/p:IntDir=<BINARY_DIR>/obj/$<CONFIG>/"
"/p:Configuration=$<CONFIG>"
"/p:Platform=${CMAKE_VS_PLATFORM_NAME}"
"<SOURCE_DIR>/${CRYPTOPP_PROJECT}"
INSTALL_COMMAND "${CMAKE_COMMAND}" -E make_directory <INSTALL_DIR>/lib
COMMAND "${CMAKE_COMMAND}" -E copy <BINARY_DIR>/bin/$<CONFIG>/cryptlib${CMAKE_STATIC_LIBRARY_SUFFIX} <INSTALL_DIR>/lib
)
This worked fine until I started using Windows 10. Now I'm getting this error: The Windows SDK version 8.1 was not found. Install the required version of Windows SDK or change the SDK version in the project property pages or by right-clicking the solution and selecting "Retarget solution".
I tried passing the SDK version from CMake, using the only related CMake variable I could find, by adding this flag to msbuild:
"/p:WindowsTargetPlatformVersion=${CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION}"
However, I'm still getting the same error. I tried displaying the value of the CMAKE_VS_WINDOWS_TARGET_PLATFORM_VERSION variable, and it always seems empty.
Modifying the dependency vcxproj is not an option. I don't know in advance what SDK version whoever needs to build the project has installed, so that's not an option.
I can't find any way to obtain and pass the SDK version to the external project build, what am I doing wrong?
I found the problem. I forgot to set the platform toolset. I was building my CMake project with v100 so it doesn't need an SDK version. Because I didn't configure the platform toolset for the external project, it used the one set in the project which was the latest (v141) which needed an SDK version.
So adding this flag fixed my setup:
"/p:PlatformToolset=${CMAKE_VS_PLATFORM_TOOLSET}"
I have downloaded android-ndk-r10e & I have also setted path in environment variable as well as NDK path for eclipse. I was able to build and run HelloJni sample app from eclipse, but when I use console to build it says
'ndk' is not recognized as an internal or external command,operable
program or batch file.
I have googled this and have also installed Cygwin even though it's not mentioned in offical google installation instructions(https://developer.android.com/ndk/guides/setup.html) but to no vain.
I have set my path but when I do echo %path% it dosen't show up. How can I use NDK from command lines.
The command you're probably looking for is ndk-build, not ndk.
I tried to run my ImageTargets 2.6.7 version in a new computer which runs new Vuforia SDK 3.0, android ndk 10 and all updated software according to Vuforia's Development Guide that I installed now, but I can't build successfully my C++ libraries, having the following error in Cygwin:
Android NDK: ERROR:jni/Android.mk:QCAR-prebuilt: LOCAL_SRC_FILES points to a missing file
Android NDK: Check that jni/../../../build/lib/armeabi/libVuforia.so exists or that its path is correct
/cygdrive/c/Development/Android/android-ndk-r10c/build/core/prebuilt-library.mk:45: *** Android NDK: Aborting . Stop.
I updated all system paths in Environment variables, I made all alterations according to this link (https://developer.vuforia.com/resources/dev-guide/migrating-your-android-sdk-project) in my project, but the problem still remains.
What can I do please?
Your response is really important for me
Looks like the path of the libVuforia.so file is not correct. To eliminate the doubt - use a full path to the file (not ../../../). That can be configured in your jni/Android.mk file.
I just installed the latest android SDK and NDK. I want to get familiar with OpenSL so I started with the native-audio example project in ndk/samples and I'm having trouble with native-audio-jni.c file. Eclipse cannot resolve any of the include files and doesn't recognize any of the OpenSL definitions. Doesn't even know what NULL means. I can build the project but once I open the .c file (once the file runs through the parser) the project won't build any more.
Other people have had the same problems and many solutions exist but none of them works for the latest SDK.
How can I fix all these errors?
I have some issues in building ics-openvpn project. When I deploy the app on the device and try to import a .ovpn file, I get cannot find minivpn. I think this error is related to an error during the app building.
I've downloaded android NDK and set the path in Eclipse, downloaded cygwin and launched ./build-native.sh, but it returns me the error
./build-native.sh: line 1: ndk-build: command not found
I've tried to modify the path in the .sh with the path of ndk-build, but I get another error:
NON-CYGWIN COMPATIBLE MAKE PROGRAM.....
Anyone knows what steps I have to follow to properly build the project?
You should not try to build it with the cygwin. There is also a build-native.bat in the project which allows the project to be build with windows. Make sure that you have installed the ndk and ndk-build is in your PATH.
Run build-native.bat
make sure you must have NDK 8b and set the environment variable for the ndk file