Invalid NDK - cross compile for Android using Conan manager - android

I'm trying to install a Conan project for Android on a Windows host.
I created a new profile for this purpose.
Its contents:
[settings]
os=Android
os.api_level=23
os_build=Windows
arch_build=x86_64
arch=armv8
compiler=clang
compiler.libcxx=libc++
compiler.version=9
build_type=Release
[options]
[build_requires]
*: android-ndk/r23, cmake/3.19.0, ninja/1.10.1
[env]
Unfortunately, the result of invoking the command
conan install .. --build=missing --profile android-arm64-v8a
is an error:
Cross-build from 'Windows:x86_64' to 'Android:armv8'
Installing (downloading, building) binaries...
ERROR: There are invalid packages (packages that cannot exist for this configuration):
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
android-ndk/r23: Invalid ID: os=Android is not supported by android-ndk (no binaries are available)
What am I doing wrong? How to fix it?

It seems you are still using the legacy cross-build method.
But it is probable that most of the recipes in ConanCenter are prepared for the new cross-build method that consist of having 2 profiles:
The "build" profile, with settings and options for the current build machine, the machine that is compiling
The "host" profile, with settings and options for the machine that will run the code being compiled.
If you are building for Android from a Windows machine, the "build" profile will be the Windows one, and the "host" one will be the Android one
Try removing os_build, arch_build from your profile, and use 2 profiles, passing in command line both the --profile:build default (or Windows profile) and --profile:host=android

Related

Error while building objectdetection3d example on Windows 10 wsl (Ubuntu 20.04.3) for Android

I'm following the steps (Mediapipe Android) to build an Android application(Objectdetection3d) using Mediapipe,I've successfully completed the installation procedure for Window's Subsystem for Linux (WSL) using Ubuntu 20.04.3
I'm now trying to build the objectdetection3d example from the Mediapipe repository on WSL by following these Mediapipe instructions.
I am specifying $ANDROID_HOME and $ANDROID_NDK_HOME with
export ANDROID_HOME=/mnt/c/Users/[USER]/AppData/Local/Android/Sdk
export ANDROID_NDK_HOME=/mnt/c/Users/[USER]/AppData/Local/Android/Sdk/ndk/21.4.7075529
Then, I am building the objectdetection example with
bazel build -c opt --config=android_arm64 mediapipe/examples/android/src/java/com/google/mediapipe/apps/objectdetection3d:objectdetection3d'
And I get this error :
Error
what should i do for solution ?

Android Sdk issue with Ubuntu 20.04lts

Ubuntu only finds ANDROID_HOME when not running with sudo. When sudo is used, it does not find the installation. Please help!
administrator#administrator-System:~/ap_ids/app$ cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: installed android-29,android-28
Gradle: installed /home/administrator/gradle-6.4.1/bin/gradle
administrator#administrator-System:~/ap_ids/app$ sudo cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: not installed
Failed to find 'ANDROID_HOME' environment variable. Try setting it manually.
Failed to find 'android' command in your 'PATH'. Try update your 'PATH' to include path to valid SDK directory.
Android target: not installed
android: Command failed with exit code ENOENT
Gradle: not installed
Could not find gradle wrapper within Android SDK. Could not find Android SDK directory.
Might need to install Android SDK or set up 'ANDROID_HOME' env variable.
Some of requirements check failed
Global paths should be set at /etc/profile. So put your export ANDROID_PATH ... statement there.
But why would you want to run cordova in sudo?
Quoting:
Many Linux distributions support the Linux Standard Base /etc/profile.d directory where configurations such as additional paths directives can go without touching the stock system files.
cat >> /etc/profile.d/some_name.sh << \EOF
PATH=$PATH:/path_to_android/bin
EOF

How do you define the NDK installation that ndk-build uses?

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.

NDK + Eclipse on Mac OS X: ERROR: Unknown host operating system:

Since I updated my NDK version to r10e (and deleted r9b which I've used consistently before), I get the following in Eclipse:
/Applications/android-ndk-r10e/ndk-build all
ERROR: Unknown host operating system:
/Applications/android-ndk-r10e/ndk-build: line 40: dirname: command not found
/Applications/android-ndk-r10e/ndk-build: line 132: uname: command not found
I'm definitely using the correct Mac OS X version of the NDK, and ndk-build works fine from the terminal.
The new NDK path is defined in Eclipse preferences of course.
What's going on here?

buildozer for android cant build my app

I build my app to apk before, but sience few days I can't do build or update for android.
My .buildozer/android/platform/python-for-android is empty, but I don't know if it's a reason? It looks like any command can't work for android, for example:
buildozer android release gives me:
...
id: 3 or "android-19"
Type: Platform
Desc: Android SDK Platform 4.4.2
Revision 3
----------
id: 4 or "android-18"
Type: Platform
Desc: Android SDK Platform 4.3
Revision 2
...
----------
id: 55 or "extra-google-play_licensing"
Type: Extra
Desc: Google Play Licensing Library, revision 2
By Google Inc.
Google Play Licensing client library
Install path: extras/google/play_licensing
----------
id: 56 or "extra-google-webdriver"
Type: Extra
Desc: Google Web Driver, revision 2
By Google Inc.
WebDriver
Install path: extras/google/webdriver
# Android packages installation done.
# Check application requirements
# Run './distribute.sh -l'
# Cwd /home/t/py/other/foodapp/.buildozer/android/platform/python-for-android
/bin/sh: 1: ./distribute.sh: not found
# Command failed: ./distribute.sh -l
Try running
buildozer android update
I was having some issues with it building the apk, but after running the clean and then update it worked.
Hey I have two solutions for your problem:
Just remove the .buildozer/ folder in your project and try again
Run the command: buildozer clean

Categories

Resources