Aidl not found,but it already exists - android

if i type in buildozer -v android release.and not in root.
Check that aidl can be executed
build-tools folder not found /home/m/.buildozer/android/platform/android-sdk-20/build-tools
Search for Aidl
Aidl not found, please install it.
but if i type in aidl
enter image description here

I have been having this error for a long time and multiple instances, even after trying to reinstall Aidl, reinstall buildozer, and deleting .buildozer project file.
Problem
This was caused by installation of wrong/outdated/mixed android-sdk build tools at;
~/.buildozer/android/platform/android-sdk/build-tools
Note:
Buildozer can only build without Aidl error if only the latest/correct android-sdk build-tools are installed.
Solution
Navigate to android-sdk build-tools path as shown below;
cd ~/.buildozer/android/platform/android-sdk/build-tools
Check the latest build tool you have, type;
ls
You should see a list of folders with names 29.0.0, 29.0.2, or any other folders.... this can be different. Note the latest version, eg (from example above is 29.0.2)
If this folder is empty proceed.
Type;
sudo rm -Rf *
Then run the following command;
cd ~
On the command below, replace "build-tools;29.0.0" version flag with your latest version (Noted above from ls command). eg ("build-tools;29.0.0" to "build-tools;29.0.2"). Use the command as it is if the build-tools folder was empty.
Hit enter to download.
~/.buildozer/android/platform/android-sdk/tools/bin/sdkmanager "build-tools;29.0.0"
Navigate to your Buildozer build project folder, run;
buildozer android debug
I hope this will help you solve the problem.

Related

Android SDK on Alpine - adb No such file or directory

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.

How to accept licenses with flutter doctor?

When running flutter doctor in the cmd it is indicated that android licenses need to be accepted by running the command flutter doctor --android-licenses.
Running the command got me an error that a repositories.cfg could not be found at a specific directory.
I did create the empty file in the directory and waited 4~5 minutes as suggested in this SO post repositories.cfg could not be loaded.
Running the command again results in a new error:
Warning: An error occurred during installation: Failed to move away or delete existing target file: C:\installs\sdk\tools Move it away manually and try again..
Deleting the tools folder did not solve the issue.
What do I have to do to be prompted to accept the Android licenses?
A way to resolve the issue is to copy the tools folder to another place (e. g. C:\temp). Then navigate the cmd to the directory with cd C:\temp\tools\bin
sdkmanager.bat --sdk_root=YOUR_DIRECTORY_HERE --licenses
YOUR_DIRECTORY_HERE should be replaced with the path to your original SDK folder (C:\installs\sdk). Once that is done, delete the C:\temp\tools copied folder.
This answer was influenced by Can't update \tools - Android SDK Command Line Tools for Windows

Android Studio can't find aapt in M preview

You have the M preview channel build tools installed (at time of writing, rev 23rc1) and you get an error something like this:
Error:android-apt-compiler:
Cannot run program ".../sdk/build-tools/23.0.0_rc1/aapt": error=2, No such file or directory
The build-tools binaries have moved (again)! You find them now under the bin directory.
$ ls build-tools/23.0.0_rc1/bin/
aapt arm-linux-androideabi-ld dexdump llvm-rs-cc split-select
aidl bcc_compat i686-linux-android-ld mipsel-linux-android-ld zipalign
So as a temporary fix, symlink them.
cd $ANDROID_HOME/build-tools/23.0.0_rc1/
ln -s bin/* ./
As you say the build-tools binaries have moved. So, a temporary fix is open the SDK Manager and remove the Tools of Preview Channel 23rc1 and make the 22.x version as default. Later Rebuild your project and done.
I hope this is useful.

Building liblinphone for Android

I am building Linphone application for android. I am using windows xp 32 bit.
1) Download android ndk
2) Installed the autotools: autoconf, automake, aclocal, libtoolize pkgconfig
3) run the ./prepare_sources.sh/
I got the output in terminal as
$ ./prepare_sources.sh /cygdrive/d/android/androidNdk/android-ndk-r8d
using /cygdrive/d/android/androidNdk/android-ndk-r8d as android NDK
./prepare_sources.sh: line 23: git: command not found
Applying patch to ffmpeg
can't find file to patch at input line 3
Perhaps you used the wrong -p or --strip option?
The text leading up to this was:
|--- submodules/externals/ffmpeg/libavcodec/arm/int_neon.S.orig 2011-09-30 19:43:21.935593025 +0200
|+++ submodules/externals/ffmpeg/libavcodec/arm/int_neon.S 2011-09-30 19:44:21.115168033 +0200
File to patch:
Any info, questions or anything really is highly appreciated
Part 1
The following steps can help you create and install the build on your device or emulator(Tested on Mac):
Step1: you need to have the Android SDK and NDK configured and istalled
Also install Autotools Mac users can use this link (Follow point 2.3 only in the link)
Other platform users please make sure you install it correctly.
Step2: Mac users open up your terminal and clone the git repo on any directory you want
to by running the following command: (Other users sorry i don't know how but i think you can figure it out that how you can get the git repo on your directory using command promt or whatever you are using)
$ git clone git://git.linphone.org/linphone-android.git --recursive
After you get the Repo copied into your directory now go to the directory and open the README file and read out the whole file.
Step3: Now we will follow as the instructions written in README file
First Go to root directory of the downloaded project using the following command on Terminal:
Mac users on terminal write cd and
then drag and drop the "linphone-android" folder on terminal
(when you drag and drop the folder terminal will get the path of the folder and then you can hit enter to get into the directory of that folder)
$ cd /Users/myname/Desktop/Android/linphone-android
or just use simple command cd to get into the folder
$ cd Desktop
$ cd Android
$ cd linphone-android
Now when you get into the directory on terminal then check your PATH of SDK & NDK installed on your Mac run
$ echo $PATH
if you see the path with SDK and NDK location then it's ok to proceed with Step4 and skip the below part and if not then you need to setup the PATH before you execute the make and make install script in Step 4:
To set up path use :
$ export PATH=/Users/myname/Documents/adt-bundle-mac-x86_64-20130729/sdk/platform-tools:/Users/myname/Documents/adt-bundle-mac-x86_64-20130729/sdk/tools:/Users/myname/Documents/android-ndk-r9:$PATH
it's like export PATH=(Path of your SDK platform tools folder):(Path of your SDK tools folder):(Path of your NDK folder):$PATH
This will set up the path and to confirm again run
$ echo $PATH
Now you will see that the path of SDK and NDK is there.
Step 4: Now if the Path is already setup you can simply run
$ make
Now connect your Device to you Mac/Pc and see if eclipse has detected it.
After the device is connected run:
$ make install
$ make generate-sdk (optional)
This will install the application into your phone. (you need to have an working SIP username and password to configure in the app)
This above steps worked for me and i was able to get the app running on my device.
Part 2
Importing into Eclipse :
After you have made your build then now you need to import it into eclipse.
Step1: Go to eclipse click on File Menu then Import then select
Existing Android Code into Workspace
Hit Next and Browse to the linphone-android project folder
And Only tick linphone-android folder and Leave Copy project into workspace untick.
Do this Like the below image:
And hit finish.
Now you right click on "linphone-android" (project name) and go to Properties and Java Build Path and then Order and Export and then reorder them as my image below and untick gcm.jar
Hit OK
And Boom No errors
Now just run it on device or emulator. (Make sure your minimum target SDK matches with your device or emulator.)
The above steps worked fine for me and it will work for you as well.
All the Best !!
According to README in root dir of linphone-android you don't need to run prepare_sources.sh, remaining steps for you is to run "make" and "make install":
LINPHONE for ANDROID
**************
To build liblinphone for Android, you must:
0) download the Android sdk with platform-tools and tools updated to latest revision (at least API 16 is needed), then add both 'tools' and 'platform-tools' folders in your path.
1) download the Android ndk (>=r8b) from google and add it to your path.
2) install the autotools: autoconf, automake, aclocal, libtoolize, pkgconfig
2bis) on some 64 bits systems you'll need the ia32-libs package
3) run the Makefile script in the top level directory. This will download iLBC source files and convert some assembly files in VP8 project.
$ make
4) To install the generated apk into a plugged device, run
$ make install
Existing answers shows how to build old linphone but to Build Latest Linphone for Android You can follow these Steps:
1) First Download Android SDK (at least API 16 is needed)
2) Then Download Android NDK(>=r9d) from Google.
3) Then Install cmake, python, yasm nasm Dependencies which is further required while installing Linphone. you can install these tool through Terminal.
4) Then You have to download source code of Linphone using following command:
git clone git://git.linphone.org/linphone-android.git --recursive
5) After Downloading Source code You have to set Path of Android SDK,NDK and also JDK
in Android SDK You have to give path upto Tools.
For Example : in console type following command
export SDK_PATH=/home/rajesh/android/adt_bundle/sdk
export NDK_PATH=/home/rajesh/android/android-ndk-r10c
export JDK_PATH=/usr/lib/jvm/java-7-openjdk-i386/
export PATH=$PATH:$NDK_PATH:$SDK_PATH/platform-tools:$SDK_PATH/tools:$JDK_PATH
6) After setting path you have to navigate through Linphone directory and type command “./prepare.py” then This will configure the build and generate a Makefile in the top level directory.
If you get following error: CMake Error Could not find the intltoolize program then
Refer
http://lists.nongnu.org/archive/html/linphone-users/2015-07/msg00092.html
7) After setting path you have to navigate through Linphone directory and type command “make” then it will generate apk for Linphone.
8) To generate a liblinphone SDK zip containing a full jar and native libraries, run
$ make liblinphone-android-sdk
I hope this helps.

jenkins android can't find sdkmanager.jar

I'm running Jenkins on Mac OS. I have an ant build file that tries to execute <exec executable="android"> in one of the targets. I have the correct path as I've included android sdk tools and platform-tools folders to it, but I am still getting the following error.
android can't find sdkmanager.jar
If I move described jar from lib folder to tools folder I'm getting some other similar error related to another jar, so it seems it just can't get this jar from lib folder. Please help.
I solved my problem. I had correct path and sdk installation directory. Problem was that my Jenkins was running under another user and couldn't locate directory with android lib because they where denied for it. So problem was in sdk folder permissions.
I've just ran chmod -R 0755 mySdkDirLocation from console under bash and became the happiest developer on earth for the moment:)
After I ran chmod -R 0755 mySdkDirLocation. The error "android can't find sdkmanager.jar" went away. But when I ran android update sdk -u, I cannot install archives. So I ran chmod 777 mySdkDirLocation. Then the downloading worked.

Categories

Resources