Gradle build is running for infinite time - android

I have latest Android Studio 2.1.2 with updated SDK and Operating System is Ubuntu 14.04 LTS. When I build my project than it starts building a gradle and it runs for infinite time. I have modified some basic settings like check an offline work and set org.gradle.daemon=true in gradle.properties file. I still can't figure out what is the main problem behind this.

when ever you find gradle is stuck at first run for unlimited time
you need these 2 commands
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
run it in terminal
an keep it safe some where
Update 1 :
if you have tried these commands then try to close existing project
remove .android .androidStudio settings .gradle from home and reopen your android studio make new project and wait it will for sure work
i have faced same situation

Related

Can't open android virtual device in Android Studio

I'm starting my android virtual device in Android Studio as usual.And the codes is definitely right because i run it the day before yesterday.But today it didn't work as I have updated the emulator first.How to fix it?
My computer is windows 10,the SDK Tools has upgraded to the latest version(Include android emulator).The java version is "1.8.0-211".
This is the event log
I managed to solve the problem after a lot of trial and error.
Firstly I changed the build-tools.
After that, Gradle build finished with an aapt error, for which I installed the following.
sudo apt-get install lib32stdc++6
sudo apt-get install lib32z1
These solved the problem for me.
Open AVD Manager and wipe device data.
Also File -> Invalidate Caches/Restart. Invalidate and restart.

How to install Android studio in Ubuntu 14.04?

I have already downloaded the android studio IDE.zip and also downloaded the android SDK.
How do I install it, I'm new to Ubuntu ?
In Ubuntu you can use 2 approvach to install Android Studio First one is use the new Developer tools that Ubuntu Team integrated directly on ubuntu. For that you can follow this manual (is writted by an Ubuntu Team member)
https://paolorotolo.github.io/android-studio/
If you want to use the latest version you can simple unzip the file you already have and run the /bin/studio.sh file.
To do that, first check if the file studio.sh has run permissions pressing right click in the file, properties --> permission tab.
After that, open a terminal cntrl + alt + t and navigate to the folder where you unzip Android Studio.
Then after make cd /bin run studio.sh with ./studio.sh &
When you have Studio running you can go to Configure option and then select Create Desktop Entry to create a entry in your Unity launcher
You can install Android studio in Ubuntu with apt or apt-get command.
Please use the following commands:
sudo apt-add-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio

Exception in thread "png-cruncher_x" [duplicate]

I've installed Android Studio 1.2, and created a new project. When I attempt to build, it hangs. This is in the Gradle Console, along with about 20 other copies, with different numbers after png-cruncher_:
Exception in thread "png-cruncher_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:104)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:107)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:204)
at java.lang.Thread.run(Thread.java:745)
I had the same problem with Debian Jessie for AMD64. I did this, and it works:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
I had the same issue whilst running Android Studio 1.5.1 for Windows 8.1 (64 bit), and what I did to solve the problem was by adding the following two system environment variables:
SLAVE_AAPT_TIMEOUT = 30
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_65
(Please note: The path for the JAVA_HOME system environment variable is dependant on where your JDK is located and that the version of your JDK may differ from the example above).
I had this problem on Windows 8.1 64 bits and what ended up solving everything was running gradle in the command line in debug mode, on the project folder:
gradlew -d assembleDebug
Running without the -d flag had the same problem.
After running the first time, everything was ok, I could even clean and rebuild my project.
I had this problem and what was missing were a library to be installed on the SDK.
Just installing the correct library immediately solved the problem.
In my case was the Android Support Library, as I was creating a navigation drawer.
The errors shown in the gradle console didn't give me a clue for the solution, and didn't helped me at all.
Click on SDK manager, and click on the tab SDK Tools, check "Android Support Library" and click apply.
This is a known bug reported here --> https://code.google.com/p/android/issues/detail?id=188627
The workaround on Mac is to reboot your computer.
If you are running on a Linux x64 machine you probably miss some required libraries. The offical sdk guide states:
Required libraries for 64-bit machines:
If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
of course don't forget to
sudo apt-get update
first.
By pausing the antivirus I don't have anymore that problem, or better by making a rule at the antivirus in order to accept a given '.class' filename recognized as trojan, then banned at compile-time.
Check your firewall if it is coming in your way. Disabling my firewall works for me but i don't know if it's the right fix.
I had the same problem with CentOS 6.5. Before this error, I found the cause of the error, as follows.
AAPT err(Facade for 1129807373): xxx/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by xxx/lib64/libc++.so)
“libc.so.6: version `GLIBC_2.14' not found” . The highest version of CentOS 6.5 is 2.12, and we need to upgrade to 2.14.
Display the installed glibc version:
# rpm -qa | grep glibc
To download the corresponding RPM package. -> ftp.redsleeve.org/pub/steam/
Install the RPM package as follows:
# rpm -Uvh glibc-2.15-60.el6.x86_64.rpm glibc-common-2.15-60.el6.x86_64.rpm glibc-devel-2.15-60.el6.x86_64.rpm glibc-headers-2.15-60.el6.x86_64.rpm --nodeps --force
I uninstalled 1.2 and installed 1.1, but it did't work.
Because I used local SDK installed previously, I uninstalled and reinstalled 1.1 and installed SDK to new path.
After I used SDK in new path, I don't have those errors any more.
And I upgraded Android Studio to 1.2, and also I don't have errors.
Downgrading Build Tools rescued me.

Android Studio fails to build new project, timed out while wating for slave aapt process

I've installed Android Studio 1.2, and created a new project. When I attempt to build, it hangs. This is in the Gradle Console, along with about 20 other copies, with different numbers after png-cruncher_:
Exception in thread "png-cruncher_2" java.lang.RuntimeException: Timed out while waiting for slave aapt process, try setting environment variable SLAVE_AAPT_TIMEOUT to a value bigger than 5 seconds
at com.android.builder.png.AaptProcess.waitForReady(AaptProcess.java:104)
at com.android.builder.png.QueuedCruncher$1.creation(QueuedCruncher.java:107)
at com.android.builder.tasks.WorkQueue.run(WorkQueue.java:204)
at java.lang.Thread.run(Thread.java:745)
I had the same problem with Debian Jessie for AMD64. I did this, and it works:
sudo dpkg --add-architecture i386
sudo apt-get update
sudo apt-get install libncurses5:i386 libstdc++6:i386 zlib1g:i386
I had the same issue whilst running Android Studio 1.5.1 for Windows 8.1 (64 bit), and what I did to solve the problem was by adding the following two system environment variables:
SLAVE_AAPT_TIMEOUT = 30
JAVA_HOME = C:\Program Files\Java\jdk1.8.0_65
(Please note: The path for the JAVA_HOME system environment variable is dependant on where your JDK is located and that the version of your JDK may differ from the example above).
I had this problem on Windows 8.1 64 bits and what ended up solving everything was running gradle in the command line in debug mode, on the project folder:
gradlew -d assembleDebug
Running without the -d flag had the same problem.
After running the first time, everything was ok, I could even clean and rebuild my project.
I had this problem and what was missing were a library to be installed on the SDK.
Just installing the correct library immediately solved the problem.
In my case was the Android Support Library, as I was creating a navigation drawer.
The errors shown in the gradle console didn't give me a clue for the solution, and didn't helped me at all.
Click on SDK manager, and click on the tab SDK Tools, check "Android Support Library" and click apply.
This is a known bug reported here --> https://code.google.com/p/android/issues/detail?id=188627
The workaround on Mac is to reboot your computer.
If you are running on a Linux x64 machine you probably miss some required libraries. The offical sdk guide states:
Required libraries for 64-bit machines:
If you are running a 64-bit version of Ubuntu, you need to install some 32-bit libraries with the following command:
sudo apt-get install libc6:i386 libncurses5:i386 libstdc++6:i386 lib32z1 lib32bz2-1.0
If you are running 64-bit Fedora, the command is:
sudo yum install zlib.i686 ncurses-libs.i686 bzip2-libs.i686
of course don't forget to
sudo apt-get update
first.
By pausing the antivirus I don't have anymore that problem, or better by making a rule at the antivirus in order to accept a given '.class' filename recognized as trojan, then banned at compile-time.
Check your firewall if it is coming in your way. Disabling my firewall works for me but i don't know if it's the right fix.
I had the same problem with CentOS 6.5. Before this error, I found the cause of the error, as follows.
AAPT err(Facade for 1129807373): xxx/aapt: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by xxx/lib64/libc++.so)
“libc.so.6: version `GLIBC_2.14' not found” . The highest version of CentOS 6.5 is 2.12, and we need to upgrade to 2.14.
Display the installed glibc version:
# rpm -qa | grep glibc
To download the corresponding RPM package. -> ftp.redsleeve.org/pub/steam/
Install the RPM package as follows:
# rpm -Uvh glibc-2.15-60.el6.x86_64.rpm glibc-common-2.15-60.el6.x86_64.rpm glibc-devel-2.15-60.el6.x86_64.rpm glibc-headers-2.15-60.el6.x86_64.rpm --nodeps --force
I uninstalled 1.2 and installed 1.1, but it did't work.
Because I used local SDK installed previously, I uninstalled and reinstalled 1.1 and installed SDK to new path.
After I used SDK in new path, I don't have those errors any more.
And I upgraded Android Studio to 1.2, and also I don't have errors.
Downgrading Build Tools rescued me.

can not install android-studio on ubuntu - error 'cannot access sdk'

I have been trying to install android studio on Ubuntu 14.04 (64)
I have followed these steps.
From the terminal I typed:
sudo add-apt-repository ppa:paolorotolo/android-studio
sudo apt-get update
sudo apt-get install android-studio
It installed so I found it using
dpkg -L android-studio
The application was installed in /usr/share/applications/android-studio which I physically clicked on from nautilus - which started the setup wizzard. I clicked standard install.
It took a long time downloading the entire sdk but once it was fully downloaded it gave me this message:
Android SDK is up to date.
Creating Android virtual device
Unable to access SDK
And gave me just the option to finish which closed the setup wizzard.
I tried the whole process again as root (sudo nautilus and again physically clicking on the application icon). It downloaded the whole sdk a second time - and gave the same error.
I'm not sure if this is a Ubuntu problem, an Android Studio problem or just a me problem. Please help.
I'm using the Android Studio under Ubuntu since February and I'm always installing it the same way:
Download zip archive here
Unzip it
Move unpacked Studio to /opt dir
Run /opt/android-studio/bin/studio.sh
After that I usually go to Tools -> Create desktop entry... and creating the AS entry in Unity launcher. Works without any issues.
OK it has been a lot of searching but it appears the problem is that the adb and some other sdk tools still use some 32 bit libraries which have been deprecated and are no longer supplied with the latest version of Ubuntu 64
Hopefully this issue will be resolved soon in the meantime I got it working with:
$ sudo apt-get install lib32z1 lib32ncurses5 lib32bz2-1.0
$ sudo apt-get install apt-get install lib32stdc++6
And so far it is working as expected.

Categories

Resources