I have installed Android studio V 3.1.1
i am trying to launch UIautoamtorviewer.bat file from
C:\Users\panmishr\AppData\Local\Android\Sdk\tools\bin
however it always gives me error
SWT folder '..\framework\location of your Java installation.' does not exist.Please set ANDROID_SWT to point to the folder containing swt.jar for your platform.
below are list of env variables , which i have set
ANDROID_HOME: C:\Users\panmishr\AppData\Local\Android\Sdk
ANDROID_SWT:C:\Users\panmishr\AppData\Local\Android\Sdk\tools\lib\x86_64
JAVA_HOME :C:\Program Files\Java\jdk1.8.0_171
in Path Variable , i have included
C:\Users\panmishr\App;C:\Users\panmishr\AppData\Local\Android\Sdk\tools
C:\Users\panmishr\AppData\Local\Android\Sdk\platform-tools
My machine is 64 bit windows 7 .
Let me know, what i have missed.
I was able to resolve this with the help of sdkmanager.bat
Go to bin folder
C:\Users\panmishr\AppData\Local\Android\Sdk\tools\bin
run
`**sdkmanager.bat**`
it will give the correct error, like in my case JAVA_HOME path was
Set to old path in registry.
Run regedit
Search JAVA_HOME
Delete the old JAVA_HOME key and value.
log off the machine
run uiautomatorviewer.bat
This time it worked!!
In my case, I had the same problem because I was changed my JVM and I didn´t restart the PC afther that. So the only think that I did was restart the computer and all the regedit files was update
I was able to fix the problem with below Steps:
set ANDROID_SWT = "C:\Users\xxxx\AppData\Local\Android\Sdk\tools\lib\x86_64"
{ The mentioned location is where swt.jar is located.}
Open CMD -> run uiautomatorviewer
It works !!
From my research Uiautomatorviewer works only with the version Java 8. So any version above 8 will not work. I had Java 17 installed and had to uninstall it.
You can download the the previous version of Java at this link from the official Oracle website:
https://www.oracle.com/java/technologies/javase/javase8u211-later-archive-downloads.html
Download the x86 version relative to you operating system. (For example I am using a Windows and downloaded: jdk-8u291-windows-i586.exe)
Now you have to configure the environment variables for "JAVA_PATH". To access this on Windows click on file explorer, right click, and select "properties".
On the right side of the windows form, select "Advanced system settings."
Click "Environment Variables" near the lower right corner of the window.
At this screen set "JAVA_HOME" to "C:\Program Files (x86)\Java\jdk1.8.0_291" as shown in the screenshot below.
From here, restart the computer and go the cmd and enter uiautomatorviewer.
This fixed the issue for me. Be sure to have your emulator turned on and remember to shut off the appium server when you are taking a screenshot of the emulator.
I'm working with KonyOne Studio to build and test apps. The Android SDK is located in C:\Android\adt-bundle-windows-x86_64-20130729\sdk and the emulator is located at C:\Android\adt-bundle-windows-x86_64-20130729\sdk\tools\emulator.exe. When I try to run apps, I get the error:
Windows cannot find 'emulator.exe'. Make sure you typed the name
correctly, and then try again.
When I just run the emulator.exe executable, I get a quick cmd screen and it disappears as quick as it appeared. Nothing shows up in my task manager.
I've set the following environment variables:
JAVA_HOME: C:\Java\jdk1.6.0_32
PATH: C:\Java\jdk1.6.0_32;D:\Users\SIMONSJP.GROUPINFRA\AppData\Roaming\npm;
C:\KonyOne\ImageMagick;C:\apache-ant-1.9.2\bin;C:\Java\jdk1.6.0_32\bin;
C:\Android\adt-bundle-windows-x86_64-20130729\sdk\platform-tools;
Ofcourse the above is without spaces. I don't understand why the emulator doesn't run. Can anyone figure out why it isn't working?
Your path variable only includes platform-tools. It needs to include the path to the emulator too.
Two ways:
Copy the emulator.exe to platform-tools
add the tools folder to path variable.
Extract your sdk zip at some other place, copy tools directory, replace it with your actual sdk tools folder contents.
Restart eclipse if required...
This worked for me.Hope same happens with you too...
I just downloaded and installed Android Studio. For whatever reason, it won't open. I've tried running it as administrator, but that doesn't seem to work either. I've also tried uninstalling and reinstalling, but I'm still having this same problem.
On windows open task manager and check if android studio is there.
End the task and start the app again it works like a charm
Figured it out! I'm sure someone will run into this in the future, so here goes.
Even though it found my JDK during installation, it wasn't able to find it when I was trying to open it, for some reason. Simple fix. Add a JDK_HOME environment variable to your system variables. It should contain the path to your JDK's ROOT directory. i.e. c:\Program Files\Java\jdk1.7.0_21\
For me this technique works
Hover on icon, then hover on app
Press right click and select maximize
This link http://tools.android.com/knownissues lists another cause for the launcher malfunctioning.
I quote the link here:
"
On some systems the launcher script does not find where Java is installed. Workaround is to set a variable indicating the location of Java [b/55281]:
Open Start menu > computer > System Properties > Advanced System Properties
In the Advanced tab > Environment Variables, add new system variable JAVA_HOME that points to your JDK folder, for example C:\Program Files\Java\jdk1.7.0_21.
Another issue we found is that the launcher script uses an option that is unknown to Java on some system [b/55267]
Open the installation folder of Android Studio (e.g. C:\Programs Files\Android\android-studio, or C:\Users\\AppData\Local\Android\android-studio) and find the "bin" directory in there.
Open a "cmd.exe" (command prompt), cd to the android-studio\bin folder and run "studio.bat". You will most likely see an error: for example b/55267 is about the option -XX:+UseCodeCacheFlushing not being recognized. Report the error, remove the line from the studio.exe.vmoptions or studio64.exe.vmoptions and it should now work.
Apologies for this weak launcher."
OS: Windows 10 64bit
Need to delete below folder and try launch Android Studio again.
C:\Users\your_user_name\AppData\Roaming\Google\AndroidStudio4.1
Source: developer android
I am Installing Android Studio 4.1.1 in my Windows 10 and trying to open as normal as well run as administration both ways but did not open as regular.
When I saw in Task Manager then it was run as a background process then simply I was Endtask it in that background process and re-open. It works for me...!!!
Just add a JDK_HOME variable with the path of your JDK as value and start the IDE again. That's the only thing to do, hope this closes the other questions.
Windows 7 user:
I tried all the above ideas ( adding JDK_HOME, JAVA_HOME environment variables), but the final trick was to run as admin.
If that fails, try "where java" in cmd.exe.
If it lists c:\system32\java.exe first, then rename the file.
(i) Open the folder where android-studio is installed. (C:\Program Files (x86)\Android\android-studio)
(ii)- Right click on the android-studio folder and scroll to properties.
(iii)While in Properties window, click on Security.
(iv)Click the Edit Button
(v) Select User/Admin...or others
(vi)Check "Allow" in front of "Full control"
(vii) Either Apply or Press OK
....At this point you have to wait for it to install....Enjoy!!!
And I use Window 8...!!! So same thing applies to Window 7...wonder why the security on it...
I am on Windows 8 64 bit machine.
I already had JDK installed and jdk.1.7.0 folder was present in C:\Program Files\Java. But path for that folder didn't work. You must have jdk.1.7.xxx folder present on your machine and give that folder as JDK_HOME in Environment variable.
You can take latest JDK version from here
Make sure to choose Windows x64 version. Install JDK and then set your path. For those who are not sure how to set path in Windows 8, I have got following screenshots.
Go to bottom right corner. Click on Settings. Click on PC Info.
Click on Advanced System Setting link on left side.
Click on Environment Variables button. A Winodw will open with 2 listboxes. Click on New button below System variables listbox. New Window will pop up. Provide name as JDK_HOME and path as your path like "C:\Program Files\Java\jdk1.7.0_55". No need to take bin folder into the path.
None of the above mentioned solution worked for me. And there is no studio.bat file in bin directory.
So, I downloaded a 32-bit android-studio for my system (as it is 32bit) from here (official website) and it worked!
PS: The link might be broken in the future, just google for the 32 bit android studio.
(After wasting half a day on it, finally, I got it running)
I am running it on Windows 8.1. Also, I had JDK 1.7.0_13.
I tried the following:
Open Start menu > Computer > System Properties > Advanced System Properties In the Advanced tab > Environment Variables
Add new system variable JAVA_HOME that points to JDK folder, C:\Program Files\Java\jdk1.7.0_13\
Just to be on the safer side, also add new system variable JDK_HOME that points to JDK folder, for example, C:\Program Files\Java\jdk1.7.0_13\
Append new PATH in system variable that points to JDK folder, C:\Program Files\Java\jdk1.7.0_13\
But still it didn't work. Then it struck me that might be, my Java version is old. I downloaded the latest version from here.
I uninstalled JDK 1.7.0_13 and installed version 8 i.e. JDK 1.8.0_131.
Now do all the above steps but, replace the path with C:\Program Files\Java\jdk1.8.0_131\ OR whichever your latest version is.
Success!! Now it works.
In my case, I have existing projects and during trying the opening Android Studio, it just showed me the name of the project.
The thing I did was changing the name of that project and forcing Android Studio to ask me to choose which project at the beginning.
In my case, it was a windows related bug. Android Studio was configured properly and working like a charm, but it was opening in the second disconnected windows.
My solution was to press [Win] + Tab and then choose Android Studio on half of the screen so that it readjusts. Finally, I maximized it and it opened it in the correct screen.
I was able to resolve the same issue by refer to the solution provided in Android Developer Portal,
Studio doesn't start after upgrade
If Studio doesn't start after an upgrade, the problem may be due to an invalid Android Studio configuration imported from a previous version of Android Studio or an incompatible plugin. As a workaround, try deleting (or renaming, for backup purposes) the directory below, depending on the Android Studio version and operating system, and start Android Studio again. This will reset Android Studio to its default state, with all third-party plugins removed.
For Android Studio 4.1 and later:
Windows: %APPDATA%\Google\AndroidStudio Example: C:\Users\your_user_name\AppData\Roaming\Google\AndroidStudio4.1
macOS: ~/Library/Application Support/Google/AndroidStudio Example: ~/Library/Application Support/Google/AndroidStudio4.1
Linux: ~/.config/Google/AndroidStudio and ~/.local/share/Google/AndroidStudio Example: ~/.config/Google/AndroidStudio4.1 and ~/.local/share/Google/AndroidStudio4.1
In my case executing these in the command line worked after ending the Android Studio process in the task manager:
net stop winnat
net start winnat
Check the log file in :
C:\Users\<yourid>\.AndroidStudio<version>\system\log\idea.log
It might give you some clue.
You don't have to reinstall the Android Studio. In my case, I just deleted "C:\Users\User.AndroidStudio3.5" folder. Then Android Studio is opened. The folder contains just personel settings such as your ide theme darcula etc.
I invalidated cache and restartI deleted the Android studio version folder which was C:\Users\User.AndroidStudio3.5 for me and it worked like charm.
What worked for me was simply rebooting the computer. I'm certain that logging off and logging in will work to so the environment variables can refresh on profile level after installation.
Change the JAVA_HOME system environment variable to C:\Program Files\Android\Android Studio\jre
The direct path to installed java may not work sometimes due to version conflict.
I had Android studio crash on my machine crying about ram. Then it just wouldn't start again. Restarting th ecomputer wouldn't help and I know it has nothing to do with Java.
What ended up fixing it was runing Android Studio trough the Start Menu, or the instalation folder and not the pinned icon ...
Make sure you are not using two Languages (Hindi + English) as input method because android studio install required some time stamp and suppose you are using Hindi language that time and letters will not match at the time of opening
Solution is - select primary Language as English while installing Android Studio.
To change steps
press Windows
search word language
remove Hindi Language
then install Android Studio
I edited studio.bat file.
I added actual jdk placement to SET JDK= line at the beginning of file:
SET JDK=C:\\\Program Files\\\Java\\\jdk1.8.0_151
You must upgrade to 4.0.1 version!
The same problem happened with me. Actually my C drive wasn't full still I wanted to install android studio in D drive. The problem was resolved when I deleted it and again installed android studio.
Install it in C drive (You don't have to do anything for that. Actually, just click next...next.. next.. while installing and you are done.
)
Zuhair Naqi's solution is good, but in my case I don't have the option to maximize. So I found another method, because in my case the Android Studio (Bumblebee) does not open every time the windows was updated.
Select right click on the android studio icon, and open some recent project.
A new window will open with the recent project correctly.
You close the window that you couldn't see, and from there you can open projects normally.
I was able to solve it by going to control panel and uninstalling android studio, then restarting the computer so that any running instances would close. Next I deleted the folder
C:\Program Files\Android\Android Studio
Re-installed everything, and everything was working fine.
I'm setting up a new eclipse environment. I just installed the ADT plugin and restarted eclipse as Administrator. When I try to open the SDK Manager via Window -> Android SDK Manager, I see the following in the Console:
I'm not sure what's causing the [Encoding Issue]x86_64 error. I'm assuming I need to go and manually edit some configuration file by hand so that the path doesn't contain the bad character, but I'm not sure which file/where. Does anyone know what file I need to edit to fix this, or possibly some alternative fix?
Eclipse -> Preferences -> Android (On left list) -> SDK Location (On Right box)
Put the correct location of your SDK's folder
If You downloaded all required Software correct, maybe You forgot to set the SDK Location in Eclipse. Go to Windows-->Preferences-->Android. On the top of the window is a field SDK-Location. There you should browse to your SDK location, after You have done this, press Apply-Button.
Under the Android SDK install directory (...\Android\android-sdk) there's a tools directory containing a file called android.bat. The line
for /f %%a in ('%java_exe% -jar lib\archquery.jar') do set swt_path=lib\%%a
is setting swt_path to the invalid string lib\♀x86_64.
You can see this by removing the #echo off command on the first line and adding this line right after the for /f... command.
echo %swt_path%
My fix was to hardcode the correct path right after the for \f... command, like so
set swt_path=lib\x86_64
I'm assuming this is a bug with the bat file itself (not using proper encoding, or something of that nature).
in windows sometimes you can have problems with reaching the file.maybe you can switch the eclipse folder's place for example to desktop.and reinstall the sdk for eclipse again.we solved a problem like that on my friends computer by following this way
I updated the Android SDK tools from revision 11 to revision 12, and the emulator now fails to start. When I try to run emulator.exe, I get:
invalid command-line parameter: Files\Android\android-sdk\tools/emulator-arm.exe.
Hint: use '#foo' to launch a virtual device named 'foo'.
please use -help for more information
The path to emulator.exe is C:\Program Files\Android\android-sdk\tools.
How do I fix it?
As was previously suggested, it does seem to be caused by the fact that there is a space in the default installation path of the Android SDK: C:\Program Files\Android\android-sdk\
There are a couple of possible solves, though-
move installation directories to paths that do not contains spaces (as already mentioned)...
but simpler and possibly slightly less cumbersome is simply adjusting the path in Eclipse to use 8-dot-3 directory name(s). Since I'm running Win7, I have two Program Files directories, the second one being "Program Files (x86)" which is where the sdk installed. So the 8-dot-3 path is PROGRA~2. Thus, I simply changed the "SDK Location" value in the Android Preferences in Eclipse from C:\Program Files\Android\android-sdk\ to C:\PROGRA~2\Android\android-sdk\ and everything now works fine.
If you don't know the 8-dot-3 name of your desired path, just fire up a Command Prompt and execute "DIR /X"... the short name will be displayed next to each directory.
Same problem for me, though this is my first time trying to work with Android SDK in general. I believe the problem is with the location of the SDK. Note the "paramater" "Files\Android\android-sdk\tools/emulator-arm.exe." I believe there is a bug in google's code where it doesn't have the directory the SDK is located in in quotes, meaning, if there is a space anywhere in the directory name, it won't work. Can someone with their SDK in a directory with no spaces confirm my theory?
To work around the issue, you can call "C:\Program Files\Android\android-sdk\tools\emulator #foo" from the command line, where "foo" is the name of your emulator.
I got this problem just now, and I found a solution.
My path to the emulator-arm.exe is C:\Program Files\Android\android-sdk\tools. When I try emulator-arm #my_avd from the command line (my_avd is my Android Virtual Device name), it works.
I fixed this problem on Windows XP. Just cut from "C:\Program Files\Android\android-sdk" and paste content directory to "C:\Android\android-sdk". Set my system varaible 'ANDROID_HOME'="C:\Android\android-sdk". Set path to Android SDK in Eclipse as "C:\Android\android-sdk". That's it!
Everything works fine.
Since the cause of this issue is the space within filepath names of the Windows install directory then another workaround is to use the file short names (i.e. 8.3 alias filenames).
Specifically, if root install directory for Android SDK is
c:\Program Files\.. then use c:\PROGRA~1\..
or if
c:\Program Files(x86)\.. then use c:\PROGRA~2\..
You can then launch the SDK Manager via the command-line by running:
start c:\PROGRA~2\Android\android-sdk\tools\android.bat
Fixed in r13. Update your SDK Tools!
I think you are saying you changed the minSDK version of your app and now the emulator wont run...? this is because your emulator is the wrong version... assuming you changed the minSDK of your app correctly, all you need to do is create a emulator with the same SDK version. Open the Android SDK / AVD manager (icon top right of screen next to print token) and create a emulator with minSDK 12.
Moving your Android SDK folder to somewhere that the complete path will be without white spaces will fix the problem.
I also got this problem after updating SDK Tools from revision 11 to 12.
I found it was a problem with a space in the upper directory name where android-sdk-windows resides, then I copied both 'eclipse' and 'android-sdk-windows' directories from my 'Program Files (x86)' to the root of drive D:.
All is solved now!
As an alternative to PROGRA~2 method (which is not working for example in Intellij IDEA), you can create a symlink named, for example, prg to Program Files (run mklink /? from command line to learn how to do it), then run emulator as C:\prg\Android\android-sdk\tools\emulator.exe. Change path to SDK/emulator in your IDE also.
I had a same problem when I setup r12. I found out this problem was caused by blank spaces in the path you setup android SDK. The solution is that you should move the folder of android SDK to a place without spaces, in your case : E:\andriod-sdk or D:\abc\xyz\android-sdk.