Android Studio Error on Arch Linux - android

i install Android Studio on my Arch linux.but after running I got this Erorr:
Sync with Gradle for project 'My Application' failed: Cause: error=13, Permission denied
this is my whole Log from Android Studio:
download log file
i install Android studio version 2.2.2 and useing my java package:
[sayres#Arch bin]$ java -version openjdk version "1.8.0_112" ,OpenJDK Runtime Environment (build 1.8.0_112-b15) ,OpenJDK 64-Bit Server VM (build 25.112-b15, mixed mode)
merci

Try running android studio with root permissions using sudo. Another fix for this could include executing chmod +x gradlew in your project directory.
This second command just sets the execution flag for your grade wrapper.

Android-sdk will is installed on /opt/android-sdk , so you have to run it as root, or better add a new user group.
The instructions are available on Arch Wiki: https://wiki.archlinux.org/index.php/android

Related

"Android target: avdmanager: Command failed with exit code 1" when running Meteor Android

I'm using Ubuntu 18.04.
I installed java 8, android studio and all dependencies listed here. When I run
meteor run android-device
I get the following error:
Your system does not yet seem to fulfill all requirements to build apps for Android.
Please follow the installation instructions in the mobile guide:
http://guide.meteor.com/mobile.html#installing-prerequisites
Status of the individual requirements:
✓ Java JDK
✓ Android SDK
✗ Android target: avdmanager: Command failed with exit code 1
✓ Gradle
java -version output:
openjdk version "1.8.0_212"
OpenJDK Runtime Environment (build 1.8.0_212-8u212-b03-0ubuntu1.18.04.1-b03)
OpenJDK 64-Bit Server VM (build 25.212-b03, mixed mode)
javac -version output:
javac 1.8.0_212
I have tried both using AVD or a physical android phone but I get same error.
Another error I get by running AVD standalone is that AVD starts but the virtual phone screen remains black, never starts.
Provide a way to set $JAVA_HOME path.
On macOS 10.5
paste below code in your bash_profile (if you use bash)
#JAVA
export JAVA_HOME=$(/usr/libexec/java_home)
export PATH=$JAVA_HOME/bin:$PATH
export CLASS_PATH=$JAVA_HOME/lib
Make config work
source ~/.bash_profile
Check variable
echo $JAVA_HOME
If you find there has some out message, good luck.
You have to set sdk path. Run below commands in your project console. Change ANDROID_HOME to your sdk path
export ANDROID_HOME="/home/Android/Sdk"
export PATH="${PATH}:${ANDROID_HOME}tools/:${ANDROID_HOME}platform-tools/"
After setting up the sdk path run below command to start your application in android emulator
meteor run android
JAVA_HOME path was wrongly set. I found this out by executing avdmanager from terminal (Android/SDK/tools/bin/avdmanager) and the error was more explicit there.

Android Emulator not running for Cordova App - adb -s emulator-5584 shell cat /proc/cpuinfo

I'm trying to make my environment work with Cordova and Android emulator with no success. I have installed the Android Studio and I can successfully start the Android Emulator.
I have created a cordova application with the command below:
cordova create myApp
I added support for the Android platform:
cordova plataform add android
I had the following output:
Using cordova-fetch for cordova-android#~6.2.2
Adding android project...
Creating Cordova project for the Android platform:
Path: platforms\android
Package: io.cordova.hellocordova
Name: HelloCordova
Activity: MainActivity
Android target: android-25
Subproject Path: CordovaLib
Android project created with cordova-android#6.2.3
Installing "cordova-plugin-whitelist" for android
This plugin is only applicable for versions of cordova-android greater than 4.0. If you have a previous platform version, you do *not* need this plugin since the whitelist will be built in.
--save flag or autosave detected
Saving android#~6.2.3 into config.xml file ...
Then I try to run the application:
cordova run android
The emulator starts, after a while, that I have the error below in the command prompt:
No target specified and no devices found, deploying to emulator
No emulator specified, defaulting to Nexus_5X_API_24
Waiting for emulator to start...
Error: Failed to execute shell command "getprop,dev.bootcomplete"" on device:
Error: C:\Users\username\AppData\Local\Android\sdk\platform-tools\adb.exe: Command failed with exit code 3221226356
Does anyone knows how to fix this error?
Some others environment info:
C:\>node -v
v7.4.0
C:\>cordova -v
7.0.1
C:\>java -version
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Edit 1
I have done those steps:
Uninstalled "Android SDK Tools"
Uninstalled "Android Studio"
Deleted files from "C:\Users\USER\AppData\Local\Android\sdk" and "C:\Program Files\Android\Android Studio" files (Because some maybe in use during the uninstallation)
Installed Android Studio
Updated Android Studio
When I execute the command below, I have more information about the error:
cordova run android --verbose
With this output:
Command finished with error code 3221226356:
C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe
-s,emulator-5584,shell,cat,/proc/cpuinfo Error: Failed to execute shell command "cat,/proc/cpuinfo"" on device: Error:
C:\Users\USER\AppData\Local\Android\sdk\platform-tools\adb.exe:Command
failed with exit code 3221226356
When I execute the command below, the adb shows the emulator cpu info, after that, the process stops and the windows ask to break or debug
adb -s emulator-5584 shell cat /proc/cpuinfo
Downgrade your SDK platform-tools to rev25.0.1.
If you dev in windows, you can download it in https://dl-ssl.google.com/android/repository/platform-tools_r25.0.1-windows.zip
delete or rename your old platform-tools folder, and extract the downloaded file to it.
Works for me!
I encountered the same issue with an emulator of Nexus5 & Oreo/Nougat.
I changed my emulator to Galaxy Nexus & Lollipop and it worked fine without any modification in the Cordova directories.
It does not seem to be the right solution, but some lower combinations might be available for avoiding this issue.
The command line is:
$ cordova emulate android
The following is the success log:
No emulator specified, defaulting to Galaxy_Nexus_API_22
Waiting for emulator to start...
emulator: Requested console port 5584: Inferring adb port 5585.
emulator: WARNING: encryption is off
path /home/ximia/.android/avd/Galaxy_Nexus_API_22.avd/system.img.qcow2
Waiting for emulator to boot (this may take a while)...BOOT COMPLETE
Edit your virtual device (ADV) and go into advanced settings and uncheck Multi-Core CPU.
Work fine to me.

cordova requirements android target not installed cmd: Command failed with exit code 1 Error output:

C:\Users\GINOM HANGSHING\hello>cordova requirements
Requirements check results for android:
Java JDK: installed 1.8.0
Android SDK: installed true
Android target: not installed
cmd: Command failed with exit code 1 Error output:
'android' is not recognized as an internal or external command,
operable program or batch file.
Gradle: installed C:\Program Files\Android\Android Studio\gradle\gradle-3.2\bin\gradle
Error: Some of requirements check failedenter image description here
Try to update your android platform by
C:\Users\GINOM HANGSHING\hello>cordova platform update android --save
Add System variable, Path. Add "\tools" directory (in addition of "\platform-tools") of your Android SDK folder. There "android.bat" is located.
Restart any open terminals.
How to check Android SDK folder: Android SDK location
If you do not find a \tools folder in your Android SDK folder, you can either try reinstalling your Android SDK or downloading and extracting the tools without the IDE from the links below (Be sure to have read and agreed with the terms of service before downloading any of the command line tools)
Windows no installer: https://dl.google.com/android/repository/sdk-tools-windows-4333796.zip
MacOSX: https://dl.google.com/android/repository/sdk-tools-darwin-4333796.zip
Linux: https://dl.google.com/android/repository/sdk-tools-linux-4333796.zip
This is how I solved the issue on my machine.
(Deepin 20 community)
After updating my android platform by running the following commands:
cordova platform rm android
and
cordova platform add android
I configured my environment variables and path as follows:
export ANDROID_SDK_ROOT="path-to-android-studio/Sdk"
export JAVA_HOME="/usr/lib/jvm/jdk1.8.0_301/"
export PATH="$PATH:$ANDROID_SDK_ROOT/platform-tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/tools"
export PATH="$PATH:$ANDROID_SDK_ROOT/tools/bin"
export PATH="$PATH:$ANDROID_SDK_ROOT/emulator"
That solved the problem

Build not found in Phonegap 3.0 for android

I have installed Cordova along with Phonegap and installed node.js in my system(ubuntu)
by using following commands:
Install Nodejs http://nodejs.org/
Install Cordova 3.0.x
$ sudo npm install -g cordova
Install Phone Gap 3.0.x
$ sudo npm install -g phonegap
Then i created project using phonegap command:
$ phonegap create hello
Trying to run into my local by using following command:
$ phonegap local run andriod
Now at first i am getting following error:
shoaib#shoaib:~/Documents/hello$ phonegap local run android
[phonegap] adding the Android platform...
[error] An error occured during creation of android sub-project. /home/shoaib/.cordova/lib/android/cordova/3.0.0/bin/create: line 54: jar: command not found
This i solved by running following command:
ls -la /home/shoaib/.cordova/lib/android/cordova/3.0.0/bin
Now when i again run
$ phonegap local run andriod
I am getting below error:
root#shoaib:/home/shoaib/Documents/hello# phonegap local run android
[phonegap] compiling Android...
[error] An error occurred while building the android project. /bin/sh: 1: /home/shoaib/Documents/hello/platforms/android/cordova/build: not found
I am using Android SDK 17
and version as 4.2.2 .
Any solution for this issue?
I had a similar problem. build and run were missing along with a few other files and lib was an empty directory. Downloaded cordova-android from here extracted and copied everything from its /bin/templates/cordova/ to the project (/platforms/android/cordova/). Then I could build and install the app.
Still had to start the emulator, check the running emulator with platforms/android/cordova/lib/list-started-emulators and then pass it when installing or it would take forever to install it on an emulator.
$ platforms/android/cordova/lib/list-started-emulators
emulator-5554
$ phonegap install --emulator=emulator-5554 android
I had already installed the JDK but the same error.
To fix this I just removed the phone test project and make sure that:
Java, javac and jar where in the path
(both should work)
java -version
javac -version
jar -version
Android sdk path was properly set and JAVA_HOME environment variable was properly set.
Then I remake the project and everything worked.
Hey got the solution.
I install open jdk 6.0 and problem is resolved.

Android ICS Compilation Issue

I successfully Downloaded the source code for Android 4.0.3.
But I am unable to compile it on my machine.
My Machine configuration is UBUNTU 11.10 64 bit,4 GB RAM
When I am running the lunch command getting the following error.
/bin/bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: prebuilt/linux-x86/toolchain/arm-linux-androideabi-4.4.x/bin/arm-linux-androideabi-gcc: Permission denied
/bin/bash: build/core/find-jdk-tools-jar.sh: Permission denied
build/core/config.mk:268: *** Error: could not find jdk tools.jar, please install JDK6, which you can download from java.sun.com. Stop.
** Don't have a product spec for: 'full'
** Do you have the right repo manifest?
JDK is already in a path.When I Run the Command java -version I am getting following OutPut
java version "1.6.0_26"
Java(TM) SE Runtime Environment (build 1.6.0_26-b03)
Java HotSpot(TM) 64-Bit Server VM (build 20.1-b02, mixed mode)
Can Anyone Help to proceed?
If you check the script build/core/find-jdk-tools-jar.sh, you can see that it first checks an environment variable called ANDROID_JAVA_HOME. If you set the ANDROID_JAVA_HOME environment variable to your JDK path, it should fix this error.
This is caused by build/core/find-jdk-tools-jar.sh with wrong result for "which javac".
Usually, this is caused by javac is not configured as a alternative for system. So there is no link of /usr/bin/javac for your javac.
Please setup the alternative for javac:
$sudo update-alternatives --install "/usr/bin/javac" "javac" "/usr/lib/jvm/jdk1.6.0_32/bin/javac" 1
note: the installed directory of javac for me is "/usr/lib/jvm/jdk1.6.0_32/", you can change it by your configuration.
You are trying to run 32-bit binaries (the NDK toolchain) on a 64-bit OS, so first make sure you have the 32-bit compatibility libs installed:
sudo apt-get install ia32-libs
If that doesn't solve it, then make sure you do have execute permission on those files.
-Open terminal
-type: chmod 777 WORKING_DIR -R
-this will fix the error

Categories

Resources