Unable to build for android under Ubuntu 14.04 LTS

Hi,

I am trying to test the demo piratepig example into android. I have setup everything using openfl setup android. All android-sdk, android-ndk, apache-ant are set.

But for some reason android build is failing:

arm-linux-androideabi-g++ -Iinclude --sysroot=/media/najm/B0ACFB15ACFAD4B6/android-ubuntu/android-ndk/platforms/android-9/arch-arm -I/media/najm/B0ACFB15ACFAD4B6/android-ubuntu/android-ndk/sources/cxx-stl/gnu-libstdc++/4.4.3/include -I/media/najm/B0ACFB15ACFAD4B6/android-ubuntu/android-ndk/sources/cxx-stl/gnu-libstdc++/4.4.3/libs/armeabi/include -DHXCPP_VISIT_ALLOCS -DHXCPP_API_LEVEL=311 -I/usr/lib/haxe/lib/hxcpp/3,1,39/include -Iinclude -fpic -fvisibility=hidden -ffunction-sections -funwind-tables -fstack-protector -fno-short-enums "-D_LINUX_STDDEF_H " -Wno-psabi -D__ARM_ARCH_5__ -D__ARM_ARCH_5T__ -D__ARM_ARCH_5E__ -D__ARM_ARCH_5TE__ -march=armv7-a -mfpu=vfpv3-d16 -mfloat-abi=softfp -fomit-frame-pointer -fexceptions -fno-strict-aliasing -finline-limit=10000 -DANDROID=ANDROID -Wa,–noexecstack -O2 -DNDEBUG -c -frtti -o obj/android-v7/__pch/haxe/hxcpp.h.gch /usr/lib/haxe/lib/hxcpp/3,1,39/include/hxcpp.h
sh: 1: arm-linux-androideabi-g++: Permission denied

I tried the command with sudo but nothing changed, then I tried with “sudo -i” and following message appears

This is the first time you are runing haxelib. Please run haxelib setup first

while haxelib is already working fine building html5, flash and linux without any problem ( I mean its already setup )

Sounds like something weird with permissions, try to use chmod to change the permissions of your Android NDK install, like “chmod -R 777 path/to/android-ndk”

Thankyou sir, I tried your method and chmod happened without any error but still android build throwing same error.

Maybe an execution permission problem, find this file and then do chmod +x arm-linux-androideabi-g++.

Thanks @ibilon, you are correct about permission. I tried gui for setting permission but as soon as I check “allow executing” it get reset, then I tried using terminal and it ran the chmod command fine but still build throws the same error. Later I check the gui permission window and it is still uncheck where “allow executing”.

I am very grateful with your help kindly help me here, as I have encountered many times in other places while I am the root user of the machine

I just saw the second part of your first post,
haxelib is set for an user, so if you want to use it as root too you’ll have to do sudo haxelib setup and enter the same path you use as a normal user.

The removal of the exec flag is really weird, maybe try chattr +i file to block permission change (that block a lot of things including removal and overwrite, do a -i to remove).

Hi,

I tried few different things, I just moved the whole setup to my home folder so it gets all the rights needed and I can control the rights issue.

Now when I run the build command: openfl build android
it stops with fatal error:

Error: Assembler messages:
Fatal error: invalid -march= option: `armv7-a'

What version of the NDK/SDK are you using?

NDK is r8b

android-sdk_r22.0.5-linux

Hmm, I’m not sure I’ve seen this before. Can you tell what command it is running exactly when it hits this problem? arm-linux-androideabi-ar, or something?

You could also try using a newer or older version of HXCPP, and see if it makes a difference:

haxelib install hxcpp 3.1.39
haxelib set hxcpp 3.1.39

haxelib install hxcpp 3.1.48
haxelib set hxcpp 3.1.48

Hi,
Thanks, I tried

openfl setup android

again and this time didn’t change the install paths and all set. I have just made the apk using

sudo openfl test android

problem was no Android-API were installed correctly.

I have the following Messages while building tess-two, and cannot build

Information:Gradle tasks [:tess-two-test:generateDebugSources, :tess-two-test:generateDebugAndroidTestSources, :tess-two-test:mockableAndroidJar, :tess-two-test:prepareDebugUnitTestDependencies, :tess-two:generateDebugSources, :tess-two:mockableAndroidJar, :tess-two:prepareDebugUnitTestDependencies, :tess-two:generateDebugAndroidTestSources, :eyes-two:generateDebugSources, :eyes-two:mockableAndroidJar, :eyes-two:prepareDebugUnitTestDependencies, :eyes-two:generateDebugAndroidTestSources]
:tess-two-test:preBuild UP-TO-DATE
:tess-two-test:preDebugBuild UP-TO-DATE
:tess-two-test:checkDebugManifest
:tess-two-test:preReleaseBuild UP-TO-DATE
:tess-two-test:generateDebugBuildConfig
:tess-two:preBuild UP-TO-DATE
:eyes-two:preBuild
:tess-two:preReleaseBuild UP-TO-DATE
:eyes-two:preBuild UP-TO-DATE
:tess-two:compileReleaseNdk
:eyes-two:preDebugBuild UP-TO-DATE
:eyes-two:checkDebugManifest
:eyes-two:preDebugAndroidTestBuild UP-TO-DATE
:eyes-two:preDebugUnitTestBuild UP-TO-DATE
:eyes-two:preReleaseBuild UP-TO-DATE
:eyes-two:preReleaseUnitTestBuild UP-TO-DATE
:eyes-two:generateDebugBuildConfig UP-TO-DATE
:eyes-two:mergeDebugShaders UP-TO-DATE
:tess-two-test:generateDebugBuildConfig UP-TO-DATE
:tess-two-test:mergeDebugShaders
:tess-two:compileReleaseNdk UP-TO-DATE
:tess-two:compileLint
:eyes-two:compileDebugShaders
:tess-two:copyReleaseLint UP-TO-DATE
:tess-two:mergeReleaseProguardFiles
:tess-two-test:mergeDebugShaders UP-TO-DATE
:tess-two-test:compileDebugShaders UP-TO-DATE
:tess-two-test:generateDebugAssets UP-TO-DATE
:tess-two-test:generateDebugResValues UP-TO-DATE
:tess-two-test:preDebugAndroidTestBuild UP-TO-DATE
:tess-two-test:prepareDebugAndroidTestDependencies
:tess-two-test:compileDebugAndroidTestAidl UP-TO-DATE
:eyes-two:compileDebugShaders UP-TO-DATE
:eyes-two:generateDebugAssets UP-TO-DATE
:eyes-two:generateDebugResValues UP-TO-DATE
:eyes-two:mockableAndroidJar UP-TO-DATE
:eyes-two:compileDebugNdk UP-TO-DATE
:tess-two:mergeReleaseProguardFiles UP-TO-DATE
:tess-two:packageReleaseRenderscript UP-TO-DATE
:tess-two:checkReleaseManifest
:tess-two:prepareReleaseDependencies
:tess-two:compileReleaseRenderscript
:eyes-two:compileLint
:eyes-two:copyDebugLint UP-TO-DATE
:eyes-two:mergeDebugProguardFiles UP-TO-DATE
:eyes-two:packageDebugRenderscript
:tess-two-test:processDebugAndroidTestManifest UP-TO-DATE
:tess-two-test:compileDebugAndroidTestRenderscript
:tess-two:compileReleaseRenderscript UP-TO-DATE
:tess-two:generateReleaseResValues
:eyes-two:packageDebugRenderscript UP-TO-DATE
:eyes-two:incrementalDebugJavaCompilationSafeguard
:tess-two:generateReleaseResValues UP-TO-DATE
:tess-two:generateReleaseResources UP-TO-DATE
:tess-two:packageReleaseResources UP-TO-DATE
:tess-two:compileReleaseAidl UP-TO-DATE
:tess-two:generateReleaseBuildConfig
:eyes-two:incrementalDebugJavaCompilationSafeguard UP-TO-DATE
:tess-two:generateReleaseBuildConfig UP-TO-DATE
:tess-two:mergeReleaseShaders
:eyes-two:ndkBuild
:tess-two:mergeReleaseShaders UP-TO-DATE
:tess-two:compileReleaseShaders UP-TO-DATE
:tess-two:generateReleaseAssets UP-TO-DATE
:tess-two:mergeReleaseAssets UP-TO-DATE
:tess-two:processReleaseManifest UP-TO-DATE
:tess-two:processReleaseResources
:tess-two-test:generateDebugAndroidTestBuildConfig
:tess-two:processReleaseResources UP-TO-DATE
:tess-two:generateReleaseSources UP-TO-DATE
:tess-two:incrementalReleaseJavaCompilationSafeguard UP-TO-DATE
:tess-two:ndkBuild
:tess-two-test:mergeDebugAndroidTestShaders
:tess-two-test:compileDebugAndroidTestShaders
:tess-two-test:generateDebugAndroidTestAssets
:tess-two-test:mergeDebugAndroidTestAssets
:tess-two-test:generateDebugAndroidTestResValues UP-TO-DATE
:tess-two-test:generateDebugAndroidTestResources
:tess-two-test:mergeDebugAndroidTestResources
Android NDK: NDK Application ‘local’ targets unknown ABI(s): arm64-v8a x86_64 mips64

Android NDK: Please fix the APP_ABI definition in /home/phenomtec/Desktop/tess-two-master/tess-two/jni/Application.mk

make: Entering directory /home/phenomtec/Desktop/tess-two-master/tess-two/jni’ make: Leaving directory/home/phenomtec/Desktop/tess-two-master/tess-two/jni’
:tess-two:ndkBuild FAILED
Android NDK: NDK Application ‘local’ targets unknown ABI(s): arm64-v8a x86_64 mips64

Android NDK: Please fix the APP_ABI definition in ./jni/Application.mk

make: Entering directory /home/phenomtec/Desktop/tess-two-master/eyes-two/src/main’ make: Leaving directory/home/phenomtec/Desktop/tess-two-master/eyes-two/src/main’
/opt/android-ndk-r9/build/core/setup-app.mk
Error:(91) *** Android NDK: Aborting . Stop.
Error:(91) *** Android NDK: Aborting . Stop.
:eyes-two:ndkBuild FAILED
FAILURE: Build completed with 2 failures.

1: Task failed with an exception.

What went wrong: Execution failed for task ‘:tess-two:ndkBuild’. > Process ‘command ‘/opt/android-ndk-r9/ndk-build’’ finished with non-zero exit value 2
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. ============================================================================== 2: Task failed with an exception. -----------
What went wrong: Execution failed for task ‘:eyes-two:ndkBuild’. > Process ‘command ‘/opt/android-ndk-r9/ndk-build’’ finished with non-zero exit value 2
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. ============================================================================== Information:BUILD FAILED Information:Total time: 1.87 secs Information:2 errors Information:0 warnings Information:See complete output in console

What version of the NDK are you using?