Android Studio AVD, CRASH, GRADLE PROBLEMS, cannot start up - android

The AVD fails to load, it doesn't recognise it. It asks me to run this manually, which I did via: "Run as Administrator" on android.bat found in the Android local, platform-tools folder.
I also did all the necessary SDK-platform and tools update for the relevant devices, etc. Still doesn't work.
I followed also a lot of 50 topics on Stack Overflow and Google bug
issue to find my solution to this. Still no luck.
I even clean project, rebuild project, deleted .gradle folder, tools folder, platform-tools folder to the point of uninstalling everything of Android Studio and their old caches.
Even with new Android Studio installation, I still cannot load up the AVD.
Before I did the whole complete uninstallation, yes I did kill the adb.exe many times via cmd and the rest of the lurking PID processes.
It was reported a bug in Android Studio 7 years ago and with everyone having solutions to this problem. I am still unable to fix this.
UPDATED 23.02.17 The issue still NOT resolved. Currently I am using another pc to do my development
More information
SDK_HOME = C:\Users\My Name\AppData\Local\Android\Sdk
Gradle version: 2.14.1
Android Plugin version 2.2.3
Workspace = C:\Users\My Name\MyProjects (Local, not version control or open source on cloud)
Source of download: https://developer.android.com/studio/index.html
Android Studio 64 bit 2.2.3 version
Laptop: 64 bit PC
Windows 10
Virtual Machines = Mac, Linux
UPDATED 25.02.17 Log specifically from .gradle assembleDebug log. (10 seconds after, standstill, left overnight and couldn't create a new project with NO CODE and couldn't load up Android Studio)
Looking in classpath from com.intellij.util.lang.UrlClassLoader#736e9adb for /com/sun/jna/win32-x86-64/jnidispatch.dll
Found library resource at jar:file:/C:/Program%20Files/Android/Android%20Studio/lib/jna.jar!/com/sun/jna/win32-x86-64/jnidispatch.dll
Trying C:\Users\User\.AndroidStudio2.2\system\tmp\jna8874909424579227886.dll
Found jnidispatch at C:\Users\User\.AndroidStudio2.2\system\tmp\jna8874909424579227886.dll
Looking for library 'user32'
Adding paths from jna.library.path: null
Trying user32.dll
Found library 'user32' at user32.dll
Loading library manifest C:\Users\User\AndroidStudioProjects\MyApplication2\app\src\main\nevercreated.xml
Merging main manifest C:\Users\User\AndroidStudioProjects\MyApplication2\app\src\main\AndroidManifest.xml
Merging library manifest C:\Users\User\AndroidStudioProjects\MyApplication2\app\src\main\nevercreated.xml
Merging manifest with lower nevercreated.xml:1:1-12:12
Merging applicati
on with lower nevercreated.xml:3:5-11:19
UPDATE 26/2/17 I did a chkdsk /f /r /x check and no bad sectors were found in the hard drive, to ensure that read and write or hard drive issues were the cause of the problem. No issues with the hard drive to affect this issue.
JDK was also reinstalled to ensure that the JDK was not hindering the problem. No firewalls or firewall programs were enabled, all of them were disabled and uninstalled. No problem even with firewall on for many months before too, so this is not a concern.
All processes were indeed TASKKILL before any other processes would occur. Still no luck.
UPDATE 27.2.17 I ordered a new SSD to arrive tomorrow and I will make a new installation (dual-boot) Linux and Windows 10 and install Android Studio on both systems to see whether it will work or not. So I took the extreme measure to have uninstall and reinstalled the program, no luck, the operating system, no luck and now I will test on a new hard drive soon. (FINGERS CROSS). Even though there is no bad sectors or error on this hard drive through checking the logs.
UPDATE 28.2.17 I reinstalled the whole operating system and I bought another new SDD. The Android Studio problem is solved.
REFLECTION
I reinstalled operating system before, but still had Android Studio problems. This leads me to think that it is a hard drive issue, an internet connection (firewall) issue OR Android Studio bug issue.
Unfortunately, I cannot pin point what caused my problem. It randomly happened out of no where. BUT I hope this will provide comfort to those who experienced almost 10 days of gruelling annoyance.

Related

Android studio isn't opening [duplicate]

Every time I run Android Studio, this loading screen pops up, but Android Studio stays here and doesn't load. It's like this following picture except that the loading bar is loaded all the way but stuck there. I am running Windows 10.
I have tried many things, including setting the system variables JDK_HOME to where my JDK is located and the same for JAVA_HOME. I have also set a path. I ran as admin many times and let AS through a firewall.
I have also restarted and reinstalled countless times.
The version of AS is 2.0, and I am running the latest versions of Java.
Any help?
Open file Android Studio setup directory/bin/idea.properties
Add disable.android.first.run=true to end
Restart Android Studio
PLEASE NOTE: This will break patch updating to the next version. We
now check full binary checksums on the whole installation to prevent
various install corruption bugs as well as to preserve application
signatures. Therefore, make a copy of this file first, and before
updating, put it back.
Please try the following method to fix that issue:
Find the folder of your AndroidStudio: based on the following directory
macOS: ~/Library/Application Support/Google/AndroidStudio[version]
Delete the AndroidStudio folder.
Restart
Ref:https://developer.android.com/studio/known-issues#studio-config-directories
In order to know how to debug the problem, I executed the bin\studio.bat script in the terminal and inspected the actual Idea exceptions in order to fix the problem.
For me, this was the issue:
ERROR - llij.ide.plugins.PluginManager - java.net.BindException: Address already in use: bind
java.util.concurrent.CompletionException: java.net.BindException: Address already in use: bind
This means the plugin manager is trying to listen on a port that is not available. Is something listening on that port? For me, it was the stupid "excluded ports" by Windows, so I simply stopped the service:
net stop winnat (as administrator), and confirmed that Android Studio started to work.
No need to re-install, delete precious configuration (and plugins, etc.). Just read the log provided by the bin\studio.bat script, and I was able to fix the issue.

Android Studio 2.3.1 | Gradle "AppName" project refresh failed

For 2 days I can't start coding my first android app, because of an issue with Android Studio 2.3.1.
There is many discussions about that out there, but non of them helped me so far.
I'm not able to use Run button for my app or even to edit the main_activity.xml file in the program window. Also the following error occurs when Android Studio starts running.
Screen shot of the error:
I'm workin' on Windows 7, 64bit, 8gb RAM, Java 1.8.0.121. Installed Android Studio 2.3.1 using android-studio-bundle-162.3871768-windows.exe file with no custom settings.
To solve the problem I've tried:
reinstall Android Studio
remove .gradle catalog
use File>>Invalidate Crashes/Restart
nothing helps.
Problem solved!
In my particular case the problem was caused by uncomplete Android Studio installation.
The reason of such an installation was Comodo AntiVirus
I noticed that there was some .bat files blocked during the installation. Comodo doesn't inform about it, but you can check it on blocked features list.
So I removed completely Android Studio, turned off all blocking functions in Comodo and quited it. Then installed AS once again.
Now it works fine. Ad least so far... Luckilly there's no Gradle error, so I hope there won't occur further problems.
Hope that this tip's gonna be helpful to somebody.
Have a good day folks!

Gradle gets stuck at either 'build' or 'assembleDebug' when using the 64bit or 32bit version of Android Studio

The issue I've had over the past few months is that Android Studio would often get stuck on Gradle: build, as seen here. Android Studio itself would stay responsive but the build simply wouldn't progress. It also never generates any kind of error, so I can't really post any useful information. Once in a blue moon it might suddenly work, but nothing reliable.
Recently I found a post here on Stack Overflow where someone's Android Studio would get stuck on Gradle: build when he tried to create a new project, and he noticed that this issue didn't exist in the 32-bit version of Android. So I thought, why not try that. Turns out that building isn't an issue anymore, but assembleDebug is, when trying to build the application. As can be seen here.
Of course all these commands work flawlessly when run using command prompt and gradlew.
What I've tried so far:
Reinstalling Android Studio (including the removal of .AndroidStudioProject)
Upgrading Android Studio to the latest version
Removing any build files from projects
Creating completely new projects in Android Studio
Switching from 64-bit to 32-bit Android Studio
I'm running the latest version of Android Studio, using version 19.1.0 of the build tools, gradle v0.11+ and am on Windows 8.1.
Is there anything else I can try? This is starting to become seriously annoying. The last possible solution I can come up with is just doing a complete format and a fresh Windows installation.
I was experiencing the same problem, and the solution was very unexpected in my case: AVAST antivirus was somehow interfering with the Gradle:build process.
Deactivating this antivirus solved the problem!
Because there is no answer to this problem I will share, what I have done, to solve this issue. From what I have seen, the problem is that there is a dependancy(or many) from a maven repo that can not be loaded. So you have to take all dependacy one by one and check if exist on the maven repo.
For example I was having a dependancy for "org.jraf:android-switch-backport:1.3.1" from "http://JRAF.org/static/maven/2" that at that time could not be opened.
My build.gradle looked like this:
repositories {
mavenCentral()
maven {
url "http://JRAF.org/static/maven/2"
}
}
compile "org.jraf:android-switch-backport:1.3.1
For me, this problem occurred when I was USB tethering using an Android device. The first build took anywhere from 5-10 minutes, and every subsequent build took about 3-7 seconds. I found that by disabling USB tethering, the first build completed quickly (and so would all subsequent builds). After the first build completed, I could reenable USB tethering.
If you have a fresh Ubuntu 14.04 with Android Studio 1.5, you may be missing a library. Try this:
sudo apt-get install lib32z1
Another stack overflow answer
It happens 1 in 2 times for me. The hack that works for me is File->Exit and confirm exiting. Then a message shows up telling me that Gradle is running and then all of a sudden the screen to choose the device shows up. I Click NO and all goes well again.
Anyway, still a bummer, but I have not found an answer yet.
My problem was that the Android Sdk executables were missing the executable bit. You can check some of your binaries like /Sdk/build-tools//aapt to see if they have permission to execute. If not you can solve it by running this on the Sdk folder
chmod -R +x ./
If you are behind a proxy on ubunthu you might need to set your gradle system wide proxy:
sudo nano ~/.gradle/gradle.properties
And enter the following entries:
systemProp.http.proxyHost=<Your Host>
systemProp.http.proxyPort=<Your Host Port>

Unable install app into emulator 2.3.3 : INSTALL_FAILED_DEXOPT

I use the latest adt-bundle-windows-x86_64-20130717, with
Android SDK Tools - 22.0.4
Android SDK Platform-tools - 18
I had tried to install app on emulator 2.3.3, both for ARM and Intel. However, it no longer work (It used to work in my same Win64 machine before I'm using latest adt)
Installation error: INSTALL_FAILED_DEXOPT
Please check logcat output for more details.
Launch canceled!
My emulator setting is as follow.
I had followed how to solve INSTALL_FAILED_DEXOPT this error?. It doesn't help for my case.
Note that, emulator with 4.1.2 work extremely well for Intel. I even try to email the APK, and download -> install from emulator. But, this is what I'm getting Application not installed
Any workaround to overcome this problem?
My logcat is having such logging
E/PackageManager(855): Package org.yccheok.jstock.gui has mismatched uid: 10031 on disk, 10033 in settings
E/dalvikvm(1241): LinearAlloc exceeded capacity (5242880), last=468
E/dalvikvm(1241): VM aborting
E/installd(798): dexopt failed on '/data/dalvik-cache/data#app#org.yccheok.jstock.gui-1.apk#classes.dex' res = 11
Note, the problem will not occur, if I were using emulator 4.1.2
Most of the time associated with excessive values for LinearAlloc. Putting verbose mode for logcat could give you more details (can even pinpoint the problem). There no definite fix I heard of.Sometimes it can be fixed by wiping AVD, some get fix by increasing SD card only, some had to recreate new AVD, some fixed it by reinstalling ADT, there are lots of fixes people speak of, answer can be varied as actual problem.
Sometimes problem can be corrupted files, or application install entries which makes android confused whether app is installed or not. Or by use of complex libraries, or even problem with the compiler itself. There's not a lot of clear information on this error from Google, they say it is related to a bug in Android OS that doesn't frees files handles in some cases. However as looking to logcat it always connected to some dex files. and so as to DDMS and compiler.I suggest you to try all of the fixes I stated, also refer the given links
Issue 22586: Dexopt fails with "LinearAlloc exceeded" for deep interface hierarchies
Cleanup redundant interfaces from iftable to avoid excessive LinearAlloc use
Issue 42538: INSTALL_FAILED_DEXOPT solved by dex.disable.merger=true
If everything failed please put your verbose logcat
Try uninstalling your app before installing it again. It seems to have solved the issue for some according to this
I was facing the same issue after upgrading ADT and I was stuck for this issue for almost half and a day.After every HIT and TRY method found the solution.
**
ONE OF LIBRARY PROJECT BUILD TARGET WAS HIGHER THEN MY PROJECT , JUST
CHANGED LIBRARY PROJECT BUILD TARGET TO 3.0 AND MY PROJECT BUILD
TARGET TO 4.0.3 AND IT VANISHES.
**
Just posted my solution if it helps others in future.
It's very hard to find out what the error is from the information you provided.
Try the following
Clean your project
Uninstall your app
Download a different version of adt bundle
Experiment with different emulators with different values
Try to use a real device, does the problem still occur?
Look through these links, maybe your problem is similar:
http://blog.elsdoerfer.name/2009/05/25/android-fix-package-uid-mismatches/
How to solve Installation failed due to invalid APK file?
LinearAlloc exceeded capacity (5242880), last=1092 Error while installing on my Samsung Tablet Device
INSTALL_FAILED_DEXOPT error when trying to install application
Good luck!

Why does Eclipse + ADT plugin keep the CPU at 100%

The second I open up layout.xml file from a simple skeleton app in Eclipse example plugin, the cpu usage locks up to 25% IE. 1 full core. and it's been on like this for the last 30minutes I wanted to let him run a longer time because I thought it is working something in the background but it just keeps doing that.
I've tested this on 2computers so far and the setup is
install Android SDK,
install Eclipse IDE for Java Developers,
install ADT plugin: http://dl-ssl.google.com/android/eclipse/
open new project, select a skeleton project for Android 2.3.3
and just open the layout skeleton activity and perhaps change to android 2.3.3 in the upper right corner and maybe setup to theme.black.noTitleBar.Fullscreen.
And now your processor should be hitting 100% ( on one core ) and should be locked like that from now on.
Is there any solution to this issue, because at home I only have 1 core and I can not work on anything.
Does any one have any clue as to why this is happening ?
http://my.jetscreenshot.com/demo/20110517-gbr8-201kb
I'm seeing the same issue so I filed a bug report at http://code.google.com/p/android/issues/detail?id=18865.
The Android team have now released a fix and it works for me. You have to upgrade to the latest revision of each SDK module that you downloaded through the android tool. The latest version of the ADT also has a number of fixed for long-standing issues.
I can't answer "Why" this happens. But I can say what fixes it.
I encountered this on Ubuntu 12.04 64 bit. I had 100% cpu and eclipse hang when I switched to debug view - Eclipse was unusable and had to kill it. I found the below bug report
https://code.google.com/p/android/issues/detail?id=34641
Following the comments there, I tried
cd /usr/lib/x86_64-linux-gnu/gtk-2.0/modules
mv libgail.so libgail.so.moved
Eclipse did not hang (no 100% cpu) when I switched to debug view.
Start Eclipse with -Dcom.sun.management.jmxremote (put it into eclipse.ini or start eclipse.exe with this option).
When Eclipse runs, start jconsole and look at the thread dump to see which thread hogs the CPU. It's the one which isn't WAITING. File a bug report.
I had the same problem and it was resolved just by moving my workspace to C:/workspace instead of Win 7 Libraries.

Categories

Resources