I installed Android sdk version and Andorid ndk .
Using Android SDK and AVD Manager, i installed SDK Plaform Android 2.2, API8, rev3 and 1.6, API4, revsion3
When i try rake run:android
I got the error saying
D:/Android_ndk/toolchains/arm-linux-androideabi-4.4.3/prebuilt/windows/bin/../lib/gcc/arm-linux-android
eabi/4.4.3/../../../../arm-linux-androideabi/bin/ld.exe: crtbegin_so.o: No such file: No such file or directory
collect2: ld returned 1 exit status
Any suggestion would be helpful
There appears to be an error on the 6b version of the NDK. Fall back to version 6 (the Mac version is here http://dl.google.com/android/ndk/android-ndk-r6-darwin-x86.tar.bz2, the Windows and Linux will be similar).
Unpack it, put it somewhere then run the rhodes-setup utility and tell it where the new NDK is - you should be good to go.
The issue arises on NDK r7c(linux) as well.
I found that the toolchain ignores the platform location ($NDK_ROOT/platforms/android-8/arch-arm/usr/lib/) and searches for it in the toolchain path, which is incorrect.
However, as the toolchain also searches for the file in the current directory, one solution is to link the correct platform crtbegin_so.o and crtend_so.o into the source directory:
cd src && ln -s NDK_ROOT/platforms/android-8/arch-arm/usr/lib/crtbegin_so.a
cd src && ln -s NDK_ROOT/platforms/android-8/arch-arm/usr/lib/crtend_so.a
NOTE 1:This answer is not specific to rhodes
NOTE 2:This assumes that the code is being compiled for API8 (Android 2.2). Please alter the path to the correct platform as per your requirement.
NOTE 3:Configure flags used:
./configure \
--host=arm-linux-androideabi \
CC=arm-linux-androideabi-gcc \
CPPFLAGS="-I$NDK_ROOT/platforms/android-8/arch-arm/usr/include/" \
CFLAGS="-nostdlib" \
LDFLAGS="-Wl,-rpath-link=$NDK_ROOT/platforms/android-8/arch-arm/usr/lib/ -L$NDK_ROOT/platforms/android-8/arch-arm/usr/lib/" \
LIBS="-lc"
Not sure if I'm pointing you in the right direction, but it seems your Rhodes application is looking for files like the SDK and AVD and can't find them.
First, make sure the build.yml in your project is pointing to your Rhodes folder. The sample-api does not have this set correctly by default.
Also, in the Rhodes folder make sure the rhobuild.yml has the correct location for your SDK and AVD. There is an example in that folder as well that shows you how it should look like.
If this not helps I would suggest you show more of the trace that leads to this error. Any more information is welcome since what you gave is not much to work with.
Related
I'm trying to build an Alpine image containing the Android SDK - specifically, the platform-tools package.
My Dockerfile does the following:
Installs Java and sets JAVA_HOME (needed for Android).
Downloads the Android SDK tools from Google.
Unzips the package.
Sets ANDROID_HOME. Also sets PATH so the sdkmanager executable can be used.
Installs platform-tools using sdkmanager.
Adds platform-tools to PATH.
platform-tools contains an executable named adb, but for some reason it cannot be seen. Running adb returns:
bash: /android-sdk/platform-tools/adb: No such file or directory
Here is my Dockerfile:
FROM alpine:latest
# Install bash and java
RUN apk update
RUN apk add bash openjdk8
ENV JAVA_HOME=/usr/lib/jvm/java-1.8-openjdk
ENV PATH="$PATH:$JAVA_HOME/bin"
# Download Android SDK and set PATH
RUN mkdir /android-sdk
RUN wget https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip && unzip *.zip -d /android-sdk && rm *.zip
ENV ANDROID_HOME="/android-sdk"
ENV PATH="$PATH:$ANDROID_HOME/tools/bin"
# Install platform-tools
RUN yes | sdkmanager "platform-tools"
ENV PATH="$PATH:$ANDROID_HOME/platform-tools"
RUN adb version # throws error: adb not found
I've looked at this question but the problem should be fixed with platform-tools v24.0 and higher.
Alpine uses musl libc instead of glibc and friends, so certain software might run into issues depending on the depth of their libc requirements.
adb is compiled with glibc, so it won't be able to run in Alpine, which usually results in the error: No such file or directory.
You can verify that a file is compiled with glibc by running file <path to file> | grep "interpreter /lib64/ld-linux-x86-64.so.2".
This may help, although the Gradle daemon randomly crashes for me on Alpine Linux when using the compatibility layer.
gcompat is the go-to compatibility layer for Alpine users.
apk add gcompat
After that you run your binaries as normal.
Source: https://wiki.alpinelinux.org/wiki/Running_glibc_programs
You can install android-tools like so:
RUN apk add \
android-tools \
--repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
The key is to set the --repository as shown, as it's only in the edge testing repo.
I don't think it includes the whole SDK, so may need to download and unzip as well for other tools. I don't know if this will handle everything you want, but adb prints a help document at least.
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've written a game for Android using Python and Kivy. I have downloaded android-sdk-linux and added its path to .bashrc. I've also cloned the python-for-android project to create an apk package of my program. But when I write the following command as instructed in the Kivy manual, I get an error:
./distubute.sh -m "kivy"
error:
Check build dependencies for Ubuntu
Check enviromnent
No ANDROIDSDK environment set, abort
Why?
This is a picture of my ./android.sh in $android-sdk-linux/tools:
Sincerely read the docs. In particular, pay attention to the environment variables you need to set mentioned at that bottom of the page.
Hope that helps.
I know that the question is a bit old, but:
export ANDROIDSDK="/path/to/android-sdk-linux"
export ANDROIDNDK="/path/to/android-ndk-rY" #change Y here
export ANDROIDNDKVER=rY #same here
export ANDROIDAPI=X #change X here
export PATH=$PATH:$ANDROIDNDK:$ANDROIDSDK/platform-tools:$ANDROIDSDK/tools
You have to change Y with the ndk version, and X with the API id.
You can add this to your ~/.bashrc.
It has solved the problem for me.
I'm trying to setup Android development with Eclipse (Indigo), on Fedora17.
Almost everything seems to work, just the javah is missing, to build the C headers with, for native (NDK / JNI) modules.
On my windows install of the tool chain it was in the same folder javac was in, but this is not the case on the Linux machine.
I previously installed Oracle's JDK1.7, found out that it's to new for something else I wanted to do (but also there, no javah), uninstalled it, now JDK1.6 is installed.
What might be wrong?
In linux machines, JavaH is normally located in /usr/bin/javah.
If you try to find this file with locate, it is normally a good idea to run before updatedb, since the database is not updated unless this command is run either by the user or a cron job. You could try finding the file with find / |grep javah
P.S. Sorry to post this as an asnwer. I suppose the corret way to go would have been a comment, but still don't have enough reputation to post a comment
This tool has been removed from the JDK
https://openjdk.java.net/jeps/313
Try gjavah rather than javah?
It turns out that javah link is not created during JDK install. You have to create it manually:
Check where is installed java:
$ ls -l `which java`
lrwxrwxrwx root root 26 15 juil. 02:05 /usr/bin/java -> /usr/java/default/bin/java
Create the symlink in the same directory:
$ su
# cd /usr/bin
# ln -s /usr/java/default/bin/javah
I just installed Android NDK, r5b, and while trying to follow the steps from Exploring the hello-jni Sample, on the command line I receive the error:
MacBook-2:~ mvermant$ cd ndk/samples/hello-jni
MacBook-2:hello-jni mvermant$ android update project -p . -s
-bash: android: command not found
I'm using Eclipse Helios release 2 with Android SDK r10 and ADT 10.0.0 on MAC 10.6.6. I have also checked to have GNU Make 3.81, and installed GNU Awk(though I am not sure it's in the right place).
I've searched a lot, and seems there might be a class path missing somewhere, but I can't figure out where exactly and what to do to fix it.
You should make sure the tools directory of your android-sdk is on your (shell) path.
Something like:
export PATH="/path/to/sdk/tools:$PATH"
before you execute your command.
In general you will also need two other directories to be on your path:
/path/to/sdk/platform-tools - for adb and other android sdk tools
/path/to/ndk - for ndk-build and ndk-gdb, which are ndk tools
You can also do some setup so that you don't have to run these commands every time you open Terminal.