Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failure in cross-compiling for Android on OS X #11920

Closed
rzambre opened this issue Jun 29, 2016 · 3 comments
Closed

Failure in cross-compiling for Android on OS X #11920

rzambre opened this issue Jun 29, 2016 · 3 comments

Comments

@rzambre
Copy link
Contributor

@rzambre rzambre commented Jun 29, 2016

Host: OS X 10.11.5
Target: Nexus 6P (Android 6.0 has an API-level of 23)

I used the toolchain generated by this command:

/path/to/my/android-ndk-r12/build/tools/make-standalone-toolchain.sh --platform="android-23" --toolchain=arm-linux-androideabi-4.9 --install-dir=./toolchain --ndk-dir=/path/to/my/ndk --arch=arm

The above command is slightly different from the one on Building for Android wiki page w.r.t. the eabi version (the new NDK comes with 4.9) and the platform number.

I set the environment variables through the .servobuild file. Here are the values I set:
sdk = "/path/to/my/sdk"
ndk = "/path/to/my/android-ndk-r12"
toolchain = "/path/to/my/toolchain"
platform = "android-23"

I also tried the same with the platform set to "android-18" but I still get the same error. In all my trials, the build always fails at heartbeats-simple-sys v0.3.0 and the error is Specified Android native API level 'android-8' is not supported by your NDK/toolchain.

Compiling openssl-sys v0.7.13
Build failed, waiting for other jobs to finish...
error: failed to run custom build command for heartbeats-simple-sys v0.3.0
Process didn't exit successfully: /Users/rzambre/Documents/servo/servo-android/target/release/build/heartbeats-simple-sys-352cd6b5cb86c823/build-script-build (exit code: 101)
--- stdout
running: "cmake" "/Users/rzambre/Documents/servo/servo-android/./.cargo/registry/src/github.com-1ecc6299db9ec823/heartbeats-simple-sys-0.3.0/heartbeats-simple" "-DCMAKE_TOOLCHAIN_FILE=/Users/rzambre/Documents/servo/servo-android/./.cargo/registry/src/github.com-1ecc6299db9ec823/heartbeats-simple-sys-0.3.0/heartbeats-simple/cmake-toolchain/android.toolchain.cmake" "-DCMAKE_INSTALL_PREFIX=/Users/rzambre/Documents/servo/servo-android/target/arm-linux-androideabi/release/build/heartbeats-simple-sys-352cd6b5cb86c823/out" "-DCMAKE_C_FLAGS= -O0 -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_CXX_FLAGS= -O0 -ffunction-sections -fdata-sections -fPIC" "-DCMAKE_BUILD_TYPE=Release"
-- Configuring incomplete, errors occurred!
See also "/Users/rzambre/Documents/servo/servo-android/target/arm-linux-androideabi/release/build/heartbeats-simple-sys-352cd6b5cb86c823/out/build/CMakeFiles/CMakeOutput.log".

--- stderr
CMake Error at cmake-toolchain/android.toolchain.cmake:800 (message):
Specified Android native API level 'android-8' is not supported by your
NDK/toolchain.
Call Stack (most recent call first):
/usr/local/Cellar/cmake/3.5.2/share/cmake/Modules/CMakeDetermineSystem.cmake:98 (include)
CMakeLists.txt:3 (project)

thread 'main' panicked at '
command did not execute successfully, got: exit code: 1

build script failed, must exit now', /Users/rzambre/Documents/servo/servo-android/./.cargo/registry/src/github.com-1ecc6299db9ec823/cmake-0.1.17/src/lib.rs:463
note: Run with RUST_BACKTRACE=1 for a backtrace.

[Warning] Could not generate notification! Optional Python module 'pyobjc' is not installed.
Build completed in 0:08:54

I'm not seeing any ERROR messages in the previous scripts that compile C files.
What could be causing this issue?

@larsbergstrom @glennw

@aneeshusa
Copy link
Member

@aneeshusa aneeshusa commented Jun 29, 2016

I suspect this may be related to #11876.

@rzambre rzambre added the P-android label Jun 29, 2016
@mmatyas
Copy link
Contributor

@mmatyas mmatyas commented Jun 30, 2016

Meanwhile, a temporary fix is to run the build like this:
ANDROID_NATIVE_API_LEVEL=android-18 ANDROID_PLATFORM=android-18 ./mach build --rel --android
You might need to ./mach clean first though.

@mbrubeck mbrubeck added the A-build label Jun 30, 2016
@rzambre
Copy link
Contributor Author

@rzambre rzambre commented Jul 4, 2016

The fix by mmatyas works well. Closing the issue.

@rzambre rzambre closed this Jul 4, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
4 participants
You can’t perform that action at this time.