Android NDK Installation on ubuntu - android

I downloaded the latest ndk from http://developer.android.com/tools/sdk/ndk/index.html#Installing.
For installing the ndk i used the following command in the terminal.
chmod a+x android-ndk-r10c-darwin-x86_64.bin
It returned saying chmod: cannot access `android-ndk-r10c-darwin-x86_64.bin': No such file or directory
Please help!

It's android-ndk-r10d-linux-x86_64.bin. if you are using ubuntu 64 bit version, you should download linux-x86_64.bin one. darwin is for Mac OS X, if you have downloaded the right file, use this command
chmod a+x android-ndk-r10d-linux-x86_64.bin

Please set Path on Command android-ndk-r10c-darwin-x86_64.bin is placed
and run this line like:
C:\User\folder Name of android-ndk-r10c-darwin-x86_64.bin placed\
chmod a+x android-ndk-r10c-darwin-x86_64.bin

Related

how can I install java runtime on Android device?

I need to install some packages and Linux programs on my android devices. for example I want to use something similar YUM or get-apt command (I know these are Linux Commands) through windows powershell connected to my android device. but it does not recognize these commands. even ADB does not work, e.g. adb update -y is unknown command. How can i do this, is it possible. if the android kernel is linux so I guess there must be a way. I checked this but didnt help me:
Is it possible to install the JDK on an android device?
Thanks
EDITED: I used the link below , thanks to my friend for good answer. this is the command i used :
pkg install wget && wget https://raw.githubusercontent.com/MasterDevX/java/master/installjava && bash installjava
BUT when i run java command it says "Killed". No Idea!
Try Termux, a linux terminal emulator for android.A minimal base system is installed automatically - additional packages are available using the APT package manager. You can use following commands to install java8.
pkg install git
git clone https://github.com/MasterDevX/Termux-Java.git
cd Termux-Java
chmod +x installjava
bash installjava
When installed, run java -version to check, if it's correcty installed.
After that you can run java using Java command.
$ apt update && apt upgrade
$ apt install openjdk-17
First of all install termux.
Then run following commands :
$ pkg update -y && pkg upgrade -y
$ termux-setup-storage
And give the storage permission.
After that download these 2 files.
JDK-9 : https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb
JRE-9 : https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb
Remember the filenames, and the folder where you downloaded the files.
Go back to termux and run :
$ cd /sdcard/<folder name>
Replace foldername with your download folder.
$ mv file1 file2 $HOME
Replace file1 and file2 with actual filenames.
Alternative :
If you don’t want to download and move files manually you can use this commands (not recommended) :
$ pkg install wget -y
$ wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb
$ wget https://archive.org/download/openjdk-9-jre-headless_9.2017.8.20-1_x86_64/openjdk-9-jre-headless_9.2017.8.20-1_arm.deb
It will download files within your termux home directory.
Finally run,
$ apt-get install -y ./openjdk-9-jdk-headless_9.2017.8.20-1_arm.deb
$ apt-get install -y ./openjdk-9-jre-headless_9.2017.8.20-1_arm.deb
And You're done.
Try typing java or javac.
If you don’t see an Error you're good to go.
See Source
First, you need to install termux from their f droid link. Their playstore version is not updated. You can find the fdroid link from their github repository.
run the following command:
apt update
apt search openjdk
If you find a version of openjdk available, for example : presently openjdk-17 is available
install it using command:
apt install package-name
example:
apt install openjdk-17
follow the prompts and java will be installed in your termux.
Download java is possible
Check this github link
Termux java https://github.com/EagleComrade/Termux-java.git
It provides direct installtion of java from termux-source
Installtion from unwanted sources are not really trusted
So this tool is realy great
Do the following for install java without errors.
pkg install git
git clone https://github.com/EagleComrade/Termux-java.git
cd Termux-java
chmod +x install.sh
./install.sh
Java is installed .......
Install termux and run these commands
pkg update
pkg install openjdk-17
java --version
Install ubuntu on termux from anlinux... Then use
$ apt install default-jdk
Job done!

How to convert .py to APK file using Python for Android on Windows?

I am working on Kivy framework. I have some sample of Kivy which has .py extension which I want to convert to .apk files. I want to check whether these working on Android or not.
I have some information about this. We have two ways to build an .apk file:
Using Python for Android,
Using Buildozer.
But Buildozer is only supported on Linux. I thought it has some problems on Windows.
Hence, I want to use Python for Android. But I have no idea how to approach this one.
Have anyone tried this one.
You can use VirtualBox Get it here and any Linux Distribution such as Ubuntu Ubuntu.
After installing Ubuntu to your Virtualbox you can use below commands:
Run these commands on Terminal
sudo apt install git
sudo apt install python3-pip
git clone https://github.com/kivy/buildozer.git
cd buildozer
sudo python3 setup.py install
Now, navigate to your project directory using cd (or) goto your Project directory, RightClick -->select 'Open in terminal' and in Terminal type:
buildozer init
Above Command creates a buildozer.spec file controlling your build configuration. You should edit it appropriately with your app name, file extensions used in the project, external dependencies etc. After configuring your buildozer.spec fille run below commands:
sudo apt update
sudo apt install -y git zip unzip openjdk-8-jdk python3-pip autoconf libtool pkg-config zlib1g-dev libncurses5-dev libncursesw5-dev libtinfo5 cmake libffi-dev libssl-dev
pip3 install --user --upgrade Cython==0.29.19 virtualenv # the --user should be removed if you do this in a venv
sudo pip3 install cython #(optional) If you got any Error as Cython not Found, use this
which buildozer
Above command is to check buildozer was added to your PATH), If no results found, add the following line at the end of your ~/.bashrc file--> export PATH=$PATH:~/.local/bin/
buildozer appclean
buildozer android debug
If you are asked for any licence agreement type y and click Enter
Once this process completes you will get a .apk file in your project directory bin/yourapp.apk
Kivy themselves used to have a virtual machine prepared with everything installed ready to go!
For some reason they stopped, now you have to install the Virtual Machine yourself.
You can see how to do this here
here is a link you can find everything that is related to getting .Apk files
https://python-for-android.readthedocs.io/en/latest/quickstart/#usage

How to fix cannot find libgcc.a: No such file or directory error

I'm trying to make a standalone compile of the kernel for my android phone, using Google Toolchain, and have already tried Uber and linarc.
All of them give the same error, which I don't understand:
/home/aayushgupta219/kernel/toolchain64/bin/aarch64-linux-android-ld: cannot find libgcc.a: No such file or directory
/home/aayushgupta219/kernel/toolchain64/bin/aarch64-linux-android-ld: cannot find libgcc.a: No such file or directory
Makefile:814: recipe for target 'vmlinux' failed
make: *** [vmlinux] Error 1
Here is a copy of the source.
Here is a copy of the logfile
OK. In case anyone is having same error and finding no fix here is my own fix for it. I was on Ubuntu 16.04 having gcc5 and was getting this error. I upgraded to Ubuntu 17.04 with gcc6 preinstalled and now no more such errors.
-Fist of all
use command
gcc -m32 -print-libgcc-file-name.
then use
sudo apt-get install -y build-essential gdb git vim
sudo apt-get install gcc-multilib
if it dosent work.
-Second
gcc -m32 -print-libgcc-file-name will give you a path that include libgcc.a.
just copy that to this place.
that path is /usr/lib/gcc/x86_64-linux-gnu/7/32/libgcc.ain my computer
use cp /usr/lib/gcc/x86_64-linux-gnu/7/32/libgcc.a ./

getting Error: spawn EACCES while ionic build android in ubuntu 14.04

i developed one project in ionic2
while i am doing ionic build android i am getting this error
my ionic info is
Cordova CLI: 6.3.0
Ionic Framework Version: 2.0.0-beta.10
Ionic CLI Version: 2.0.0-beta.36
Ionic App Lib Version: 2.0.0-beta.19
OS: Distributor ID: Ubuntu Description: Ubuntu 14.04.5 LTS
Node Version: v4.4.7
I searched in google but no solution works for me..
How can i fix this Bug?
This is Permission Error While Building App
You Need to Give Permission Gradle
sudo chmod -R 777 /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/gradle
Enjoy :)
hit this command
sudo chmod -R a+rwx /appfolder
It is caused by permission problem. More info on problem here.
If this does not solve your problem then its probably issue of permission in your user profile directory. Try above command on user directory. It will take some time to apply permission.
Regards.
Use the verbose when you make your cordova build:
cordova build -verbose
It will return to you the path that requires the chmod +x
I was using Cordova to run my Hybrid app on my Android device, and I got this error twice during the unsuccessful build ...
Error: spawn EACCES
#Krunel Vaghela's answer above helped me somewhat ...
This is Permission Error While Building App
You Need to Give Permission Gradle
sudo chmod -R 777 /Applications/Android\ Studio\ 3.0\ Preview.app/Contents/gradle
But I kept having this error:
"chmod: -r: no such file or directory"
I was using this command:
[Sandis-Macbook-Pro:Users sandi$ sudo chmod -R 777 /Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle
Note that my Android app is named "Android Studio.app" (with a space in the name). Solution is to simply wrap the path in quotes like so:
[Sandis-Macbook-Pro:Users sandi$ sudo chmod -R 777 "/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle"
NOTE: In order to find out which folder was having the permissions problem, I had to use this command:
sudo build -verbose
Which yielded the path to the permissions problem folder like this:
ANDROID_HOME=/Users/sandi/Library/Android/sdk
JAVA_HOME=/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home
Running command: "/Applications/Android Studio.app/Contents/gradle/gradle-4.1/bin/gradle" -p /Users/sandi/Desktop/CORDOVA_NOV16/HHUB_NOV17/hhub_CURRENT/platforms/android wrapper -b /Users/sandi/Desktop/CORDOVA_NOV16/HHUB_NOV17/hhub_CURRENT/platforms/android/wrapper.gradle
Error: spawn EACCES
So take the path after "Running command:" - put that, inside quotes, after the ...
chmod -r 777
And that's what saved my day.
Had the same problem, I got it fixed by giving 777 permissions on my Sdk folder :
chmod -R 777 /YOURINSTALLOFANDROID/Sdk
After upgrading to Android 3.2, gradle version has been changed up to 4.6.
So I had to use this following command to modify gradle file permission in my Mac Terminal.
sudo chmod 755 "/Applications/Android Studio.app/Contents/gradle/gradle-4.6/bin/gradle"
Just Remove "node_modules" folder and re-install it using
sudo npm i
Hope It get works ..Thanks..!

Android SDK path issue when using calabash-android

I'm getting a "Could not find an Android SDK please make sure it is installed" error when trying to run calabash-android commands. I've installed the Android SDK via brew. Here are the contents of my .bash_profile:
ANDROID_HOME=/usr/local/Cellar/android-sdk/24.2
PATH=$PATH:$ANDROID_HOME/tools
PATH=$PATH:$ANDROID_HOME/platform-tools
PATH=$PATH:$ANDROID_HOME/build-tools
if [ -f ~/.bashrc ]; then
source ~/.bashrc
fi
[[ -s "$HOME/.profile" ]] && source "$HOME/.profile" # Load the default .profile
[[ -s "$HOME/.rvm/scripts/rvm" ]] && source "$HOME/.rvm/scripts/rvm" # Load RVM into a shell session *as a function*
PATH=$PATH:/usr/local/apache-ant-1.9.4/bin
PATH=$PATH:/usr/local/share/npm/bin
JAVA_HOME=/usr/libexec/java_home
export PATH
Here's my $PATH:
echo $PATH
/Users/mchumak/.rvm/gems/ruby-2.1.1/bin:/Users/mchumak/.rvm/gems/ruby-2.1.1#global/bin:/Users/mchumak/.rvm/rubies/ruby-2.1.1/bin:/usr/local/bin:/usr/bin:/bin:/usr/sbin:/sbin:/usr/local/Cellar/android-sdk/24.2/tools:/usr/local/Cellar/android-sdk/24.2/platform-tools:/usr/local/Cellar/android-sdk/24.2/build-tools:/Users/mchumak/.rvm/bin:/Users/mchumak/.rvm/bin:/opt/local/bin:/opt/local/sbin:/Users/mchumak/.rvm/bin:/usr/local/apache-ant-1.9.4/bin:/usr/local/share/npm/bin
"which android" produces:
/usr/local/bin/android
The contents of that particular file are:
#!/bin/bash
TOOL="/usr/local/Cellar/android-sdk/24.2/tools/android"
exec "$TOOL" "$#"
I can run the Android SDK Manager from the command line just fine, and it shows the correct SDK path (/usr/local/Cellar/android-sdk/24.2).
I'm stumped. Any ideas why calabash-android can't find the SDK?
This will fix your issue,
echo "export PATH=$PATH:/Users/#username/Library/Android/sdk/platform-tools/sdk/platform-tools/" >> ~/.bash_profile
install android-platform-tools -> brew install android-platform-tools
- Also ensure yourself have admin rights
Looking at your $PATH output seems like android sdk path isnt loaded into PATH. Add below to your .bash_profile
PATH=$PATH:$ANDROID_HOME
calabash-android run /Users/marcg/Downloads/app-news.apk
I received that following error
Could not find any platform directory in '/Users/marcg/Library/Android/sdk/platforms'
I corrected this with the symlink below:
/Users/marcg/Library/Android/sdk/platforms
platforms$ ln -s ../platform-tools/ platform
I ran again and get an error that the android jar was missing from a standard directory of /Users/marcg/Library/Android/sdk/platforms
I then copied that android.jar to this platforms dir
Dir now looks like:
/Users/marcg/Library/Android/sdk/platforms
us164912:platforms marcg$ ls -l
total 49640
-rwxr-xr-x 1 marcg Users 25409822 Oct 5 09:26 android.jar
lrwxr-xr-x 1 marcg Users 18 Oct 5 09:14 platform -> ../platform-tools/
Still getting
Did not find 'android.jar' in any standard directory of '/Users/marcg/Library/Android/sdk/platforms'. Calabash will therefore take longer to load
I copied the android.jar to the platform-tools directory and remaining error went away.
Steps to correct:
Make a symlink in platforms that points to platform-tools
ln -s ../platform-tools/ platform
Copy the android.jar to the platform-tools dir
Would be better if the framework allowed you configure via file or additional env vars where to find each of these. My earlier attempt to set ANDROID_HOME to the platform-tools dir didn't work and why I did a symlink.

Categories

Resources