I would like to import the library libsndfile. According to it's doc I need a standalone toolchain for this. Now I'm trying to build said toolchain with Cygwin as described in the official guide but get the error message:
Unsupported platform: CYGWIN_NT-10.0.
I am new to android development and must admit that I struggle with the official guide quite a bit. From what I understand the --arch argument refers to the system I'm building for and the --api argument to the (minimum?) Android version it is running. Which toolkit exactly it is should be irrelevant at this point as long as they are compatible. So for now let's go with --arch x86_64 and --api 21. Overall the in- and output look as follows:
$ ./build/tools/make_standalone_toolchain.py --arch x86_64 --api 21 -v --install-dir ../toolchains/oboe_record_proto/
Unsupported platform: CYGWIN_NT-10.0
This may not be a satisfying answer but here what worked for me in the end:
According to the comment by matzeri, Cygwin is not supported (anymore). My attempts to solve it with Mingw / Msys as suggested were without success either.
Ths, I installed python under Windows and ran the script from the Windows command line.
python .\build\tools\make_standalone_toolchain.py --arch x86_64 --api 21 -v --install-dir ..\toolchains\oboe_record_proto
The toolchain was generated as expected.
Related
I am pretty new to Qt (and linux for that matter), but need to build an Android app based on Qt with some basic bluetooth functionality. I have been able to build Qt for Android from source and develop a simple app, but QtBluetooth cannot be found.
Starting point:
Ubuntu 18.10 x64
Android NDK r18b
Android SDK (android-27)
OpenJDK v1.8.0_212
Qt 5.12.3
This is my configure command:
./configure -xplatform android-clang -android-ndk [path to NDK] -android-sdk [path to SDK] -android-ndk-host linux-x86_64 -android-toolchain-version 4.9 -no-warnings-are-errors -android-ndk-platform andoird-27 -opensource -confirm-license -v
The configure output shows that none of the Qt Bluetooth components are enabled, and that this is because
"None of [libbluetooth.so libbluetooth.a] could be found in [] and global paths."
"pkg-config use disabled globally"
This is really frustrating because I've installed those libraries: both of those files are in the /usr/lib/x86_65-linux-gnu/ directory! Also pkg-config is installed...
I have tried adding this path (/usr/lib/x86_64-linux-gnu/) to the configure command and copying these libraries into directories that I would have thought are already included, but these workarounds have been fruitless. I am using git to clean the submdodules and main directory between each attempt.
What am I missing?? It feels like this is sooo close to working.
I spend hours struggling on this issue and I feel dumb as f***. I followed this doc, installed everything I needed until the effective building step:
p4a apk --debug --private $HOME/Documents/Code/Python/app_kivy/identifier/main.py --package=org.example.myapp --name "My application" --version 0.1 --bootstrap=sdl2 --requirements=python2,kivy
[INFO]: Will compile for the following archs: armeabi
[INFO]: Found Android API target in $ANDROIDAPI
[ERROR]: Could not find `android` or `sdkmanager` binaries in Android SDK. Exiting.
Here is the end of my .bashrc
# Adjust the paths!
export ANDROIDSDK="$HOME/Android/Sdk/"
export ANDROIDNDK="$HOME/Apps/android-ndk-r16b/"
export ANDROIDAPI="19" # Minimum API version your application require
export ANDROIDNDKVER="r16b" # Version of the NDK you installed
I tried several paths variants, tried both the full Android Studio and the ‘just the command line tools’ methods of the doc, nothing. NB android and sdkmanager are installed in different folders (resp. tools and tools/bin). I am pretty sure that I am missing something in the .bashrc but what am I missing?
Thanks in advance for any insight
This p4a error message is less specific than it implies. $ANDROIDSDK need not even be a valid path to produce this error. That in mind, you should first check that it has even been exported properly by running the command echo $ANDROIDSDK. If you don't see the expected path printed out, you'll need to run your .bashrc script again the way you normally would.
If you do see the expected path, then the most likely problem is that the contents of $HOME/Android/Sdk/ aren't what p4a was expecting. For that I unfortunately can't offer a suggestion of what might be wrong without knowing what the contents are.
I have an android system with two different CPU ABI - armeabi-v7a and x64 .For which one I have to build the application code to get it working.My application (in c language) anyway doesnt run for either of the platforms.
OR is there any common tool chain with which I can build the same.
arm-eabi-gcc?
The NDK contains all the toolchains you need to run your program on Android platforms.
To setup the architectures you need to compile to, you should set the APP_ABI variable inside Application.mk or pass it to the ndk-build command.
APP_ABI:=all will make your ndk project being built for all the supported architectures: armeabi, armeabi-v7a, arm64-v8a, x86, x86_64, mips, mips64.
You can also list which architectures you want to build for: APP_ABI:= x86_64 x86 armeabi-v7a arm64-v8a and also use all32 and all64 as shortcuts to all the 32-bit and all the 64-bit architectures.
To determine which platforms are supported by a target device, you can call adb shell getprop ro.product.cpu.abi (preferred arch) and adb shell getprop ro.product.cpu.abi2 (second arch).
Starting with Android 5.0, use adb shell getprop ro.product.cpu.abilist instead, that returns a list of all the supported ABIs, sorted in preference order.
I don't think you can target completely different architecture (arm and x86) with android provided ndk (cross-compilers). You can target multiple ABI supported by arm with following variable
TARGET_ARCH_ABI
possible values are:
armeabi For ARMv5TE
armeabi-v7a
for more details you can check this link.
To run in x86 or amd64 system you can normally use a gcc to create the .so file and use JNI to test functionally (remember Android F/W will be unavailable there).
If you are looking for rapid building-testing cycle I think it's better for you to use an x86 based emulator like AndroVM (now Genymotion). In that way you can write code for android device and test it real quick.
I tried to make a standalone Android NDK toolchain on Linux 64 bit:
~/build/android-ndk-r9/build/tools $ ./make-standalone-toolchain.sh --platform=android-14 --ndk-dir=/home/user/build/android-ndk-r9 --system=linux-x86_64 --install-dir=/home/user/build/android-14-toolchain
Auto-config: --toolchain=arm-linux-androideabi-4.6
Copying prebuilt binaries...
No files are actually copied. Something goes wrong. The NDK ist the latest release r9.
How can I run the script so that the files get copied to the installation directory?
A suggestion: Use the --verbose option if you haven't already done so; it will tell you in which stage the error occurs.
Here are the options I ran to make a standalone toolchain targeting android-14 and arm-linux-androideabi-4.7
sudo sh make-standalone-toolchain.sh --verbose --toolchain=x86-4.7\
--install-dir=/project/arm-cc --ndk-dir=/project/android/ndk/android-ndk-r9\
--platform=android-14
I work with older releases of Android (Gingerbread 2.3.4). To develop for these versions I use now Ubuntu 10.04. At the same time, I would like to use more recent version: 12.04 or maybe 12.10. It is written here:
Building on Ubuntu 12.04 is currently only experimentally supported
and is not guaranteed to work on branches other than master.
So here is my question, has anybody tried to build old versions of Android on Ubuntu 12.04? I do not like new unity interface so I also consider xfce or kde. That's why here is the second question, will I have any troubles with building if I change window system?
Yes, it is possible to build Gingerbread on Ubuntu 12.10.
Biggest problem is that Ubuntu 12.10 has newer gcc 4.7, which is very strict.
It is possible to fix it by patching Android source to be compliant with new gcc requirements. However, this can be difficult to do, especially when it involves patching older kernel sources.
You can bypass this by simply installing older gcc 4.4 (which is default version in Ubuntu 10.10).
sudo apt-get install gcc-4.4-multilib g++-4.4-multilib
After that, you need to make gcc 4.4 to be the default compiler for your Android compilation.
Easiest way is to simply symlink gcc, g++, cpp to point to older versions and add it to PATH:
mkdir ~/bin
cd ~/bin
ln -s /usr/bin/g++-4.4 g++
ln -s /usr/bin/gcc-4.4 gcc
ln -s /usr/bin/cpp-4.4 cpp
# you might want to add line below to ~/.bashrc:
export PATH=$HOME/bin:$PATH
Now, you need to have Java installed. Unlike newer Android 4, Gingerbread can be built using OpenJDK, so you should be able to simply
sudo apt-get install openjdk-6-jdk
to get working JDK.
Also see this thread.