I can't open Android Device Monitor - android-studio

I am using Android Studio. I can't open Android Device Monitor, Tools > Android > Android Device Monitor. I occurred an error. See the log file at:
C:\Users\Peter Phyo\AppData\Local\Android\sdk\tools\lib\monitor-x86\configuration\1433318221838.log.

Do you have JAVA_HOME in your system environment variables?
JAVA_HOME=C:/Program Files/Java/jdk1.8.0_11

Run android studio as administrator. It will definitely work. No need to reinstall neither android studio nor java.

In my case, after upgrading Android Studio 3.1.2, I tried open C:\Users\yourUserName\AppData\Local\Android\Sdk\tools\monitor, Windows alert "can't find 'lib\monitor-location'. Make sure you typed the name correctly, and then try again". Then I tried open tools\lib\monitor-x86_64\monitor, it works!

I'm on Windows and open Android Studio in Administrative Mode (Run as administrator). Worked for me.

I had the same problem, i solved it using jPortable, if you're using Windows then take this one, there are two versions 32bits and 64bits : https://portableapps.com/apps/utilities/java_portable I changed the location for the extraction from C:\SDK\tools\lib\monitor-x86_64\CommonFiles\Java64 to C:\SDK\tools\lib\monitor-x86_64\jre and it worked.

You need to set path to your ..jre\bin location :
Check in: File > Project Structure your JDK location
add the \bin there , my path is : C:\Program Files\Android\Android Studio\jre\bin
set the path in your Environment Variables, for WINDOWS 7 :
the From the desktop, right click the Computer icon.
Choose Properties from the context menu.
Click the Advanced system settings link.
Click Environment Variables
New System Variable
set the path the following way :
Variable name: Path
Variable value: your path
in my case: Variable value: C:\Program Files\Android\Android Studio\jre\bin
Now you can start the Monitor.exe, my location is here : C:\Users\Admin\AppData\Local\Android\Sdk\tools\lib\monitor-x86_64
for WIN7 32bit start the Monitor.exe from
...Android\Sdk\tools\lib\monitor-x86

Make sure have installed JDK7 or JDK8 depending on your OS bits
If you are using 32bits your install JDK7 or 8 of 32bits
After you install JDK, your JAVA_HOME in your system will be located in
C:\Program Files\Java\jdk1.8.0_40
To check if your JAVA_HOME is set, CLICK Start Menu > Computer > Right Click on Computer > Properties > Control Panel Home will appear, > click Advanced System Settings, under > Advanced Tab click > Environment Variables and check on the > System Variables for > Path if Java [C:\ProgramData\Oracle\Java\javapath;] is there, than you are good to go.
Make sure you have your JAVA_HOME in your system environment variables.
Hope this well help you. If it helped you, please mark it, so that it can the useful to others.

Please ensure you have Android SDK Tools installed.
I had a fresh copy of Android Studio and kept getting this error.
To install:
Tools -> Android -> SDK Manager -> SDK Tools (tab) -> Tick Android SDK Tools x.x.x (if it's not installed) -> Apply
Once installed / finished, try restarting Android Studio then selecting Android Device Monitor from the Tools drop down again.

If you want to see file explorer the please go from this path
View -> Tool Windows -> Device File Explorer.
I hope this path solve your problem.

Related

Emulator tool window missing from android studio

My Android Studio IDE is missing the tool window "Emulator" in View -> Tool Windows though the "Launch in a tool window" option is checked in File -> Settings -> Tools -> Emulator.
I don't know what changed this but it used to work properly.
I can't seem to find anyone with the same issue.
Finally, this solved the problem in my case.
Go to File-> Project Structure->Modules and add Android and Apply.
Automatically displays Emulator Menu in Right Panel!
First , you should check the following things:
1- Install Java JDK .
2- add Path(JAVA_HOME) to environment variables ( Windows operating system) .
3- Install a Gradle
4-add Path(GRADLE_HOME) to the environment variables .
5- Install the SDK Android
6- add Path (ANDROID_HOME) to the environment variables (ANDROID_HOME).

Android Studio AVD Manager - setting environmental variable doesn't work

Goal:
manage Android Virtual Devices (avd) using the (graphical) AVD manager shipped with Android Studio, but using a different storage folder.
Default folder: /home/user1/.android/avd/
Wanted folder: /mnt/data/some/more/path/.android/avd
According to the docs, this should work:
(Loaded in .bashrc)
export ANDROID_SDK_HOME='/mnt/data/some/more/path'
export ANDROID_EMULATOR_HOME="${ANDROID_SDK_HOME}/.android"
export ANDROID_AVD_HOME="${ANDROID_EMULATOR_HOME}/avd"
export ANDROID_SDK_ROOT='/mnt/data/some/more/path/Sdk'
export PATH="${PATH}:${ANDROID_SDK_ROOT}/emulator"
export PATH="${PATH}:${ANDROID_SDK_ROOT}/tools"
export PATH="${PATH}:${ANDROID_SDK_ROOT}/tools/bin"
export PATH="${PATH}:${ANDROID_SDK_ROOT}/platform-tools"
This works indeed on the command line:
$ emulator -list-avds
Nexus_5X_API_29_x86
Pixel_2_API_28
and running emulator -avd Pixel_2_API_28 works fine too.
However, AVD manager shows me no devices and when I use the only visible button + Create Virtual Device..., the new device will be created in the Default folder (/home/user1/.android/avd).
Worth mentioning (but I don't know if related): In settings>Tools>Terminal > And then looking at the list of Environment Variables, I cannot find eg. $ANDROID_SDK_HOME under 'Include system environment variables'.
But at the other side, when opening a terminal in Android Studio, they are available.
Am I doing something wrong or is this a bug (and should I rapport it)?
Thanks
Environment:
Linux Mint 19.3 Cinnamon
Android Studio 3.6.3
After searching some more, this bug is already reported:
https://issuetracker.google.com/152333601
Star this issue there if this bothers you too.
Add the path to "Edit Custom Properties" (gear bottom left android
studio). Like so: ANDROID_AVD_HOME=PATH_TO_FOLDER_HERE
Restart Android Studio
Source: Comment #4 on this issue: https://issuetracker.google.com/issues/78686872

Android Studio doesn't accept Android SDK Location

I've got a couple of years of Java experience but i'm new to Android Development. I installed Android Studio and on first launch it offers me to specify Android SDK Location in Settings/System Settings/Android SDK.
Android SDK is in C:\Program Files\AndroidSdk - so I:
Click Edit
Specify path C:\Program Files\AndroidSdk
Click Next
Then in Verify Setting menu button 'Next' is inactive so I click Finish
I'm back in Setting with same red message "Specify Android SDK Location".
N.B. I specified ANDROID_HOME = C:\Program Files\AndroidSdk
and added C:\Program Files\AndroidSdk\tools and C:\Program Files\AndroidSdk\tools\bin in PATH.
Maybe you have any idea why it doesn't take my SDK Location?
After you open Studio. Goto File->Project Structure
Then specify the correct SDK location.
You can verify in terminal or cmd whether the path you are providing there is actually reachable on your system. If not, it won't work.
I solved the problem! At first launch SDK Manager of Android Studio offers to install Android SDK on your PC, for this - specify EMPTY folder. I thought i had to give him the path to already existing SKD (non-empty folder) - that was the problem.
After specifying empty folder, everything had been installed successfully and seems to work fine.

Not able to connect adb after upgrate Android Studio to 3.4

unable to connect to adb.check the event log for a possible issue, verify that localhost entry is pointing to 127.0.0.1 or:: 1 for ipv4 or ipv6
Tried adb kill-server, restart, invalidate restart nothing works.
Same issue reported over here https://issuetracker.google.com/issues/130791561
Note: I have not added any file or anything in studio, it's fresh installed Studio after format a full system still issue is there.
Replace your platform-tools with this one and delete the other one.
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
I was also facing this issue in android Studio 3.4 version, but now I have fixed it , if you are using windows then follow these steps:
Download Platform tools from here
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
Extract downloaded zip file
Go To location "C:\Users\your_computer_user_name\AppData\Local\Android\Sdk" and Delete "Platform tools" folder
Copy and Paste, downloaded platform tool folder to above location
Now Go to your android studio and Rebuild your project Then run.
For Mac Users, follow these simple steps :
Just simply Navigate to Tools > SDK Manager> Android SDK>, then click on the Tab of SDK Tools, then look for Android SDK Platform-tools and update it.
Then the last step, Invalidate cache and restart your IDE, after that, then finally you restart your Mac. (Sometimes it's this step is unnecessary)
It will work out successfully.
Solution for Linux Users.
System info: Linux Mint Cinnamon 19.1 , Android Studio 3.4.1
Issue description: Problem with platform tools.
Solution: Remove the folder manually and update SDK tools through Android Studio.
Step 1: Go to your Android SDK installation folder. By default under your home directory. Choose platform-tools and simply delete. (/home//Android/SDK)
Step 2: Open Android Studio and go to SDK Tools. (File -> Settings -> Appearance & Behaviour -> System Settings -> Android SDK -> SDK Tools) By the moment you should be able to see Android SDK Platform Tools line unchecked.
Step 3: Put a check to install Platform Tools and press OK. Notice it'll relocate the folder to the directory where deleted.
Now that you re-installed the platform tools, restart the Android Studio and your deployment targets should show up.
If you don't install the platform tool back and ever try to build or run a project you'll get this IDE error. Just FYI :)
So that's all. Enjoy.
Happy coding
If you use Windows, you might have a corruption in api-ms-win-crt-runtime-l1-1-0.dll.
Try to update it - you can get the update from Microsoft's website.
You should check it - path/to/sdk/platform-tools and try to run adb.exe
When you update Sdk platform tools(which contains adb.exe) to release 28.0.2 and if you are using windows 8.1 then it needs few updates from windows.
As per SDK Platform tools release notes(https://developer.android.com/studio/releases/platform-tools):
Updated Windows requirements : The platform tools now depend on the Windows Universal C Runtime, which is usually installed by default via Windows Update. If you see errors mentioning missing DLLs, you may need to manually fetch and install the runtime package."
Windows update url: https://support.microsoft.com/en-ca/help/2999226/update-for-universal-c-runtime-in-windows
Prerequisite for Windows update url: https://www.microsoft.com/en-us/download/details.aspx?id=42327
Faced the exact same issue but after updating with prerequisite url first then the other url provided now it is working perfectly fine for me.
It worked for me by selecting -> Use libusb backend
This worked for me on Windows:
Goto cmd write %temp% hit enter -> delete all data from there.
Restart your Computer.
Open Android Studio now, it will work.
Clear all cache memory (related to Android Studio)
Restart ADB manually from Android Studio (first option)
Open Command prompt and got android sdk>platform-tools> adb kill-server
press enter
and again adb start-server
press enter
Restart ADB manually form Android Stidio (second option)
go to your (SDK store path) sdk>platform-tools>adb
press enter
ex. D drive > sdk>platform-tools>adb
Restart your system
Delete the platform-tools folder from the sdk and replacing with the same from your another pc. I am also facing this problem after updating to 3.4. If you face same problem please update to Android Studio 3.5 Canary Channel.
The reason is for ADB server problem. Simply re-run your adb.
(Go to your SDK folder then inside platform-tools folder you can see adb.exe. copy the path location and paste it in your computers system Environment variable. Set a new path there and paste the adb.exe file location there. hope it will solve )
If you are using Genymotion, there is an update that fix the problem.
Genymotion 3.0.2 (April 18th, 2019)
Corrections
We have fixed an
incompatibility with the adb tool bundled in the platform-tools 28.0.2
package of the Android SDK, which caused failures to start virtual
devices.
This new version of adb changed the behavior of the “adb connect
:” command by making the “port” part mandatory. This
broke Genymotion Desktop in a few places where it did not pass the
port. We have adjusted the way we call “adb connect” and also updated
the version we ship with the product to match the one in
platform-tools 28.0.2.
If non of the above answers worked for you (as same happend to me), down grade to the old version of Android Studio by following these steps:
Uninstall current Android Studio
Go to Android Studio Archive and download any older version
After installation, Open the project. You might see an error like this
This version of Android Studio cannot open this project, please retry with Android Studio 3.4 or newer.
Now, open project gradle and update classpath tools.build version. I.e. in my case Android studio version is 3.2 and classpath 3.2.1
Hope it might save someone time.
I faced this issue last night, and I tried these methods to fix:
download older platform-tools and place it in the android sdk folder.(not work for me)
adb kill-server, adb start-server.(not work for me, adb had no response with these cmd)
kill the process that occupies port 5037.(for me, there is no other .exe run at this port)
reinstall platform-tools in Android Studio.(not work)
download ADB Kits and replace them in platform-tools folder.(work!!!)
It seems that my adb file has been modified or replaced by some programs. You can try these methods, and I hope some of them can work for you.
I had this issue only after a Genymotion update, on Mac.
What worked for me: Open Genymotion preferences, Select ADB, choose "Use custom Android SDK tools" and points to your Android SDK folder.
Actually the problem is not with the android studio version 3.4
Problem is with the android platform tools version which is latest one 29.
So install the previous version of the android platform tools version it will solve your problem. as above #Ved mentioned.
Ved link:
https://dl.google.com/android/repository/platform-tools_r26.0.0-windows.zip
EndTask adb.exe from Background processes (TaskManager) and Run Application again.
It works for me

SDK Location not found Parse projects [duplicate]

I'm trying to install PhoneGap and I'm getting the following error:
Error: ANDROID_HOME is not set and "android" command not in your PATH. You must fulfill at least one of these conditions.
Error (screenshot)
What do I do to ensure Android is set up correctly for use with Cordova?
For Windows:
set ANDROID_HOME=C:\ *installation location* \android-sdk
set PATH=%PATH%;%ANDROID_HOME%\tools;%ANDROID_HOME%\platform-tools
Taken from this installation guide.
For Mac OS X:
export ANDROID_HOME=/<installation location>/android-sdk-macosx
export PATH=${PATH}:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
I have MAC OS X Yosemite, Android Studio 1.0.1, JDK 1.8, and Cordova 4.1.2
When I tried to add the android project:
cordova platforms add android
I received the message:
ANDROID_HOME is not set and "android" command not in your PATH
Based in cforcloud's answer...
'Error: the command "android" failed' using cordova
and
http://developer.android.com/sdk/installing/index.html?pkg=studio
I used the following:
export ANDROID_HOME="/Users/<user_name>/Library/Android/sdk"
export ANDROID_TOOLS="/Users/<user_name>/Library/Android/sdk/tools/"
export ANDROID_PLATFORM_TOOLS="/Users/<user_name>/Library/Android/sdk/platform-tools/"
PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS
echo $PATH
When I tried to create the android project, I received this message:
Creating android project...
/Users/lg/.cordova/lib/npm_cache/cordova-android/3.6.4/package/bin/node_modules/q/q.js:126
throw e;
^
Error: Please install Android target "android-19".
I ran Android SDK Manager, and installed Android 4.4.2 (API 19) (everything but Glass Development Kit Preview). It worked for me.
===
This is the content of my .bash_profile file.
export PATH=$PATH:/usr/local/bin
export JAVA_HOME=`/usr/libexec/java_home -v 1.8`
launchctl setenv STUDIO_JDK /library/Java/JavaVirtualMachines/jdk1.8.0_25.jdk
export ANDROID_HOME="/Users/<UserName>/Library/Android/sdk"
export ANDROID_TOOLS="/Users/<UserName>/Library/Android/sdk/tools"
export ANDROID_PLATFORM_TOOLS="/Users/<UserName>/Library/Android/sdk/platform-tools"
PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS
To edit .bash_profile using Terminal, I use nano. It is easy to understand.
cd
nano .bash_profile
I hope it helps.
for windows:
Right click on My computer -> properties -> Advanced system setting -> Environment Variables
Edit Path on system variables to ;\yourSdkHome\tools;\yourSdkHome\platform-tools.
Then Close your cmd prompt and reopen.
On Linux, add this to the end of your .bashrc, .profile or appropriate file for your shell:
export ANDROID_HOME=/home/youruser/whatever/adt-bundle-linux-x86_64-20140702/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools
Please notice that these environment variables will be available for newly created shells, not the already open.
Using Android Studio on Windows the system variables settings have changed a little.
You still have to add a system variable ANDROID_HOME, but pointing to the directory containing the android SDK usually installed in C:\Users\YOUR_USERNAME\AppData\Local\Android\android-studio\sdk.
You also need to add the following to the Path system variable:
;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;
Taken from: https://github.com/simnova/webdevdocs/wiki/Installing-PhoneGap-and-Android-Studio-on-Windows
SDK Path also be in C:\Users\USER\AppData\Local\Android\sdk
This is what I just tried to make it work. I was in:
os x Yosemite version 10.10.2
cordova version 4.2.0
android studio 1.0.1
Java SE Development Kit 7
set path:
# on ~/.zshrc file (open a text editor)
export ANDROID_HOME="/Users/<user>/Library/Android/sdk/"
export ANDROID_TOOLS="/Users/<user>/Library/Android/sdk/tools"
export ANDROID_PLATFORM_TOOLS="/Users/<user>/Library/Android/sdk/platform-tools"
PATH=$PATH:$ANDROID_HOME:$ANDROID_TOOLS:$ANDROID_PLATFORM_TOOLS
reopen terminal
install "android-19" from android SDK manager
$ android
# pick "SDK Platform Android 4.4.2, API 19"
and then go to a Cordova-based project directory
$ ionic platform add android
Android path set in linux:
$export ANDROID_HOME=/usr/lib/android-sdk-linux
$export PATH=$PATH:$ANDROID_HOME/tools
$export PATH=$PATH:$ANDROID_HOME/platforms-tools
than
$cordova run android
In Linux,
edit .bashrc file and add the ANDROID_HOME and PATH variable,
export ANDROID_HOME=/usr/local/android-sdk-linux/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools
After saving .bashrc file, run
source ~/.bashrc
then in type
android in a terminal
if it will run, ANDROID_HOME and PATH is set,
if you get this message,
bash: /src/android-sdk/tools/android: Permission denied
then run
sudo chmod a+x /usr/local/android-sdk-linux/tools/android
otherwise you will get same error message
Error: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
NB: Use your android sdk installation path instead of /usr/local/android-sdk-linux/
For Windows I just had to add an env variable pointing to the SDK folder. Done!
(The accepted answer didn´t work for me)
Only one change was needed to fix the problem:
Go to Start -> Control Panel -> System -> Advanced(tab) -> Environment Variables -> System Variables
set ANDROID_HOME to C:\Program Files (x86)\Android\android-sdk
ANDROID_HOME is deprecated now instead of using ANDROID_HOME use ANDROID_SDK_ROOT
as per Google android documentation -
ANDROID_SDK_ROOT sets the path to the SDK installation directory. Once set, the value does not typically change, and can be shared by multiple users on the same machine. ANDROID_HOME, which also points to the SDK installation directory, is deprecated.
If you continue to use it, the following rules apply:
If ANDROID_HOME is defined and contains a valid SDK installation, its value is used instead of the value in ANDROID_SDK_ROOT.
If ANDROID_HOME is not defined, the value in ANDROID_SDK_ROOT is used.
If ANDROID_HOME is defined but does not exist or does not contain a valid SDK installation, the value in ANDROID_SDK_ROOT is used instead.
For details follow this Android Documentation link
I had to close and re-open my windows console (or open a new console), and then open the SDK manager (ran android), after which a bunch of updates and installs had to complete.
For those who are working with Ionic Framework on windows and doesn't have andorid studio installed on their PCs, you must have either download Android Studio or at list download the SDK Manager.
If you choose the SDK Manager option you have to set the path for the Enviroment Variable:
Variable name: ANDROID_HOME, Variable value: the path where you installed the android SDK, in my case is, C:\Android\android-sdk.
You have to add the variable to the Path variable system by adding this:
;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools;.
Then if you got the "JDK error" just download it from the Oracle website and create a system variable like the Android SDK:
Variable name: JAVA_HOME, Variable value: the path where you installed the JDK, in my case is, C:\Program Files\Java\jdk1.8.0_144. Then add it to the Path variable system by adding ;%JAVA_HOME%\bin.
Then if you got the "Gradle error" just fallow the installations steps on the official website of gradle.
Finally you can continue to creating your ionic app's apk.
Note: you have to reopen the cmd window several times or restart your pc after making those changes. Hope this work for you.
Using Android Studio on Mac, run this on your terminal:
export ANDROID_HOME=/Applications/Android\ Studio.app/sdk/
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platforms-tools
Then, when you type
android
at your terminal, it will run something
You just need to type a command in flutter_console.bat type flutter config --android-sdk <path-to-your-android-sdk-path>
Go to system properties.
Click change setting.
Click advance tab.
Click Environment Variables button.
In system variables area click new button.
Set ANDROID_HOME in the Variable name field.
Set C:\Program Files (x86)\Android\android-sdk in the Variable value field.
Click ok button.
Double click Path variable in the list.
Click new button.
Past C:\Program Files (x86)\Android\android-sdk\platform-tools in the filed.
Click new button again.
Past C:\Program Files (x86)\Android\android-sdk\tools in the field.
Press enter 3 times.
That's all you need to do.
The main reason of this would be the path ( ANDROID_HOME ) is not set in appium. You can confirm that by checking the last step first
step 1 :- Checkout the path where android sdk is located
it could be in c drive/program files or below location mostly
C:\Users\yourUserName\AppData\Local\Android\Sdk
Step2 :- Set the System variables . By typing in search bar in window (you can open this window for setting system variables)
Last step :- To confirm the problem will not repeat verify this, Open appium click on edit configuration and confirm if you can see the path set
It's is mostly with missing andriod SDK. for this issue and "JAVA_HOME" error following solution worked for me... whole day saved after following steps.
To build and run apps, you need to install SDKs for each platform you wish to target. Alternatively, if you are using browser for development you can use browser platform which does not require any platform SDKs.
To check if you satisfy requirements for building the platform:
$ cordova requirements
Requirements check results for android:
Java JDK: installed .
Android SDK: installed
Android target: installed android-19,android-21,android-22,android-23,Google Inc.:Google APIs:19,Google Inc.:Google APIs (x86 System Image):19,Google Inc.:Google APIs:23
Gradle: installed
Requirements check results for ios:
Apple OS X: not installed
Cordova tooling for iOS requires Apple OS X
Error: Some of requirements check failed
By the way, one other possibility is that you do have a too old version of cordova android platform.
Error: Android SDK not found. Make sure that it is installed. If it is not at the default location, set the ANDROID_HOME environment variable.
Then:
cordova platform update android --save
if Linux users still have the same error, probably they have used "sudo" for adding android platform.. a quick solution for this here, or you have installed cordova using sudo, also there is a solution for this problem here.
Hope this help!
I also faced this same issue, I got a solution with this.
I did the following steps :
Open system properties
Environment variables
create a new system variable
name: ANDROID_HOME
value: copy your SDK path( Ex: my SDK path E:\SoftWares\Android-SDK)
close your current cmd, and restart it
run flutter doctor
this should work on windows
I encountered this error and I had to set the ANDROID_HOME using bash_profile.
Then run the source ~/.bash_profile before running appium from terminal.
You can set the ANDROID_HOME variable from inside Visual Studio as well:
Go to Tools->Options->Cross Platform->C++ and enter the path under Android SDK.
If nothing else works, make sure that you have correct permissions and ownership set up during building. A quick fix can be:
sudo chown -R <you>:<your_group> *
sudo chmod -R 755 *

Resources