I cannot resolve this error, even though it is mentioned as resolved here in M1.
Unknown host CPU architecture: arm64 , Android NDK SiliconM1 Apple MacBook Pro
My error code.
[CXX1405] error when building with ndkBuild using /Users/adamheinrich/Desktop/android-solocoo-2.0/Solocoo/app/src/main/jni/Android.mk: Build command failed.
Error while executing process /Users/adamheinrich/Library/Android/sdk/ndk/20.1.5948944/ndk-build with arguments {NDK_PROJECT_PATH=null APP_BUILD_SCRIPT=/Users/adamheinrich/Desktop/android-solocoo-2.0/Solocoo/app/src/main/jni/Android.mk NDK_APPLICATION_MK=/Users/adamheinrich/Desktop/android-solocoo-2.0/Solocoo/app/src/main/jni/Application.mk APP_ABI=arm64-v8a NDK_ALL_ABIS=arm64-v8a NDK_DEBUG=1 APP_PLATFORM=android-22 NDK_OUT=/Users/adamheinrich/Desktop/android-solocoo-2.0/Solocoo/app/build/intermediates/cxx/Debug/x2j681s3/obj NDK_LIBS_OUT=/Users/adamheinrich/Desktop/android-solocoo-2.0/Solocoo/app/build/intermediates/cxx/Debug/x2j681s3/lib APP_SHORT_COMMANDS=false LOCAL_SHORT_COMMANDS=false -B -n}
ERROR: Unknown host CPU architecture: arm64
After editing ndk-build with text editor I have.
What else can I do?
How can I install .dmg beta ndk? It is not available in SDK Manager via Android Studio.
Also after editing this file my OS says it is corrupted/ damaged. How can I edit it properly?
Using Sublime Text editor instead of Macbook text editor allowed me to edit it without corrupting it. Edit ndk-build file in Library/Android/sdk/ndk
to:
#!/bin/sh
DIR="$(cd "$(dirname "$0")" && pwd)"
arch -x86_64 /bin/bash $DIR/build/ndk-build "$#"
Related
In circleci environment, calling ndk-build in console gives me the error :
/home/circleci/project/android-ndk-r10d/ndk-build: 158:
/home/circleci/project/android-ndk-r10d/ndk-build: file: not found
but then it runs the ndk-build executable. I'm not sure what's the reason.
The ndk log is below:
NDK_LOG=1 ndk-build -n | grep HOST -C 5
HOST_OS=linux
HOST_ARCH=x86_64
/home/circleci/project/android-ndk-r10d/ndk-build: 158: /home/circleci/project/android-ndk-r10d/ndk-build: file: not found
HOST_ARCH=x86 (32-bit userland detected)
HOST_TAG=linux-x86
GNUMAKE=/usr/bin/make (system path)
Android NDK: NDK installation path auto-detected: '/home/circleci/project/android-ndk-r10d'
Android NDK: GNU Make version 4.1 detected
Android NDK: Host OS was auto-detected: linux
Android NDK: Host operating system detected: linux
/bin/sh: 1: file: not found
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to linux-x86
Android NDK: Host tools prebuilt directory not found
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'echo -n' tool: printf %s
Android NDK: Host 'cmp' tool: cmp
Android NDK: Host 'awk' tool: awk
/home/circleci/project/android-ndk-r10d/build/core/build-local.mk:148: *** Android NDK: Aborting . Stop.
Exited with code 2
so to resolve the "/bin/sh: 1: file: not found" issue, I installed 'file using:
sudo apt-get install -y file
but I still have the error:
#!/bin/bash -eo pipefail
NDK_LOG=1 ndk-build -n | grep HOST -C 5
HOST_OS=linux
HOST_ARCH=x86_64
HOST_ARCH=x86 (32-bit userland detected)
HOST_TAG=linux-x86
GNUMAKE=/usr/bin/make (system path)
Android NDK: NDK installation path auto-detected: '/home/circleci/project/android-ndk-r10d'
Android NDK: GNU Make version 4.1 detected
Android NDK: Host OS was auto-detected: linux
Android NDK: Host operating system detected: linux
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to linux-x86
Android NDK: Host tools prebuilt directory not found
Android NDK: Host 'echo' tool: echo
Android NDK: Host 'echo -n' tool: printf %s
Android NDK: Host 'cmp' tool: cmp
Android NDK: Host 'awk' tool: awk
/home/circleci/project/android-ndk-r10d/build/core/build-local.mk:148: *** Android NDK: Aborting . Stop.
Exited with code 2
How do I resolve this
Android NDK: Host tools prebuilt directory not found
I am new to kivy, and try to build an app for android using kivy.
When i was creating an apk for the app
buildozer android debug
with log_level=2
it shows:
Tool unzip is missing
Command failed: ./distribute.sh -m "kivy" -d "kivytut"
Buildozer failed to execute the last command
The error might be hidden in the log above this error
Please read the full log, and search for it before
raising an issue with buildozer itself.
In case of a bug report, please add a full log with log_level = 2
I'm unable to find any tool called upzip for buidozer(python-for-android) on the internet.
Help.
install unzip using:
sudo apt-get install unzip
moreover following are the tools that must be installed:
git
ant
python2
cython (can be installed via pip)
a Java JDK (e.g. openjdk-7)
zlib (including 32 bit)
libncurses (including 32 bit)
unzip
virtualenv (can be installed via pip)
ccache (optional)
These are several dependencies for python-for-android
How do you define the NDK installation that ndk-build uses? I used the r10e build for a good while, then updated my NDK and modified my $PATH to point to the new location, but when I build using the ndk-build command in Terminal it still uses the older android-ndk-r10e version.
I know this because I use the NDK_LOG=1 option when invoking ndk-build and it produces the following verbose information as it builds my project. Notice the references to "/NDKDev/android-ndk-r10e". That's my old installation.
~/Documents/MyNDKProject-- $ ndk-build NDK_LOG=1
HOST_OS=darwin
HOST_ARCH=x86_64
HOST_TAG=darwin-x86_64
GNUMAKE=/Users/user1/Documents/NDKDev/android-ndk-r10e/prebuilt/darwin-x86_64/bin/make (NDK prebuilt)
Android NDK: NDK installation path auto-detected: '/Users/user1/Documents/NDKDev/android-ndk-r10e'
Android NDK: GNU Make version 3.81 detected
Android NDK: Host OS was auto-detected: darwin
Android NDK: Host operating system detected: darwin
Android NDK: Host CPU was auto-detected: x86
Android NDK: HOST_TAG set to darwin-x86
Android NDK: Host tools prebuilt directory: /Users/user1/Documents/NDKDev/android-ndk-r10e/prebuilt/darwin-x86_64/bin
Android NDK: Host 'echo' tool: echo
. . .
Also note that when I enter echo $PATH at the Terminal prompt it gives:
/opt/local/bin:/opt/local/sbin:/usr/bin:/bin:/usr/sbin/:/sbin:/usr/local/bin:/Applications/android-sdk-macosx/ndk-bundle:/Applications/android-sdk-macosx
and where you see /Applications/android-sdk-macosx/ndk-bundle is exactly where it used to refer to the android-ndk-r10e path, so I'm certain I've updated my PATH successfully. So anyhow, IF the PATH environment variable is not what ndk-build uses to determine the NDK installation to use, what does it use, and how can I modify it so that it uses my new installation which is at:
/Applications/android-sdk-macosx/ndk-bundle
Fixed. The problem was that when the .bash_profile file is successfully sourced in a given Terminal session it does not have any effect on other instances of Terminal that are open. I had two instances of Terminal open and because I hadn't closed the one with which I was calling ndk-build the changes to .bash_profile weren't being applied.
I'm cross compiling hostapd for allwinner a13 board by following command
export PATH=PATH:/path_to_toolchain
export CC=arm-none-linux-gnueabi-gcc
make
hostapd binary generated successfully but when I execute hostapd in board then it gives
"/system/bin/sh: hostapd: No such file or directory"
adb push hostpad /system/bin/
root#android:/ # chmod 777 /system/bin/hostapd
root#android:/ # hostapd
/system/bin/sh: hostapd: No such file or directory
So how to resolve this issue?
What toolchain are you using? You should use the same NDK toolchain as was used for your Android image, otherwise you'll have architecture/library mismatch.
Execute file hostapd and file on any binary in your Android image and you'll see the difference.
you can avoid above problem by
1) compile statically or
2) compile your hostpd with same toolchain which you used in android build system.
arm-none-linux-gnueabi toolchain and android toolchain will having library mismatch.
so I am trying to deploy a simple program to my Galaxy S5 with Buildozer. I run buildozer --verbose android debug deploy run which goes fine until the very last part:
Traceback (most recent call last):
File "build.py", line 491, in <module>
make_package(args)
File "build.py", line 354, in make_package
subprocess.check_call([ANT, arg])
File "/usr/lib/python2.7/subprocess.py", line 511, in check_call
raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command '['ant', 'debug']' returned non-zero exit status 1
# Command failed: /usr/bin/python build.py --name 'School Organized' --version 1.2.0 -- package org.test.schoolorganized --private /home/jolechiw/School-Organized/.buildozer/android/app --sdk 14 --minsdk 8 --orientation landscape debug
The last part of the output can be found here. I really dont understand what went wrong with "Command Failed" but it might be a path error? I am really not sure.
EDIT:
I dont know if this matters but my source code for the app is here
I had, I believe, the same problem recently, and I'm fairly sure the problem was really the name of my app.
I don't think you can have a space in the name 'School Organized'. Try removing that or replacing it with an underscore (or whatever), wherever it appears in your buildozer.spec file, and build again.
I don't really have a way to check this was definitely the same error as mine, but it was at the least very similar and this tweak definitely fixed it.
today I had the same building issue. The problem was in Java itself rather than in buildozer.
It MUST be done using Java 7:
piotr#jnlk ~/Kivy/SomeApp $ which java
/usr/bin/java
piotr#jnlk ~/Kivy/SomeApp $ java -version
java version "1.8.0_11"
Java(TM) SE Runtime Environment (build 1.8.0_11-b12)
Java HotSpot(TM) 64-Bit Server VM (build 25.11-b03, mixed mode)
piotr#jnlk ~/Kivy/SomeApp $ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
(...)
# Distribution already compiled, pass.
# Build the application #137
# Package the application
# Command failed: /usr/bin/python2 build.py (...) --orientation landscape debug
Building with Java8 fails, but when I changed JAVA_HOME variable to the location of Java7:
piotr#jnlk ~/Kivy/SomeApp $ export JAVA_HOME=/usr/lib/jvm/java-1.7.0-openjdk-amd64
piotr#jnlk ~/Kivy/SomeApp $ export PATH=${JAVA_HOME}/bin:${PATH}
piotr#jnlk ~/Kivy/SomeApp $ java -version
java version "1.7.0_55"
OpenJDK Runtime Environment (IcedTea 2.4.7) (7u55-2.4.7-1ubuntu1~0.13.10.1)
OpenJDK 64-Bit Server VM (build 24.51-b03, mixed mode)
piotr#jnlk ~/Kivy/SomeApp $ buildozer android debug
piotr#jnlk ~/Kivy/SomeApp $ buildozer android debug
# Check configuration tokens
# Ensure build layout
# Check configuration tokens
# Preparing build
(...)
# Android packages installation done.
# Check application requirements
# Check garden requirements
# Compile platform
# Distribution already compiled, pass.
# Build the application #138
# Package the application
# Android packaging done!
# APK <some-app-name>.apk available in the bin directory
Building was completed successfully :)