I just launched the Android device monitor for the first time on OSX but it freezes and I am not able to click anywhere, it just does not respond to any mouse or keyboard input.
I think it's downloading, I have very good internet speed, but it's downloading very slowly. I tried to download a song and it downloaded 5 MB in 30 seconds, and for this case it's downloading 2 MB in 5-10 min and its size is about 540 MB, so please assist me with what should I do to download fast? Any help would be appreciated.
Is there any manual way to download and connect it to Android Studio?
Any way to make it respond to mouse clicks?
Finally Fixed!!!. This problem occured to me when i was using jdk-8u161-macosx-x64, downgrading the jdk from jdk-8u161-macosx-x64 to jdk-8u151-macosx-x64 solved the issue for me.
Remove your existing java jdk by running this command sudo rm -rf /Library/Java/*
Download the jdk-8u151-macosx-x64 from http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html
you need to sign up to oracle to download previous versions of jdk.
intall jdk-8u151-macosx-x64 by just following the instructions.
Alternatively you can keep latest jdk and update swt used by monitor:
get updated swt: https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.7.1a-201710090410/swt-4.7.1a-cocoa-macosx-x86_64.zip
unzip somewhere
copy extracted swt.jar over
lib/monitor-x86_64/plugins/org.eclipse.swt.cocoa.macosx.x86_64_3.100.1.v4236b.jar
While other answers are correct that the solution is to use an old version of the JDK, just replacing the latest JDK was not an option for me (and should not be for you, either!). To get monitor working with an older Java version installed along the newest one, do the following:
Find your android SDK location
Go to <android-sdk>/tools/libs/monitor-x86_64/
Find the monitor.app application and right click on it, select "Show Package Contents"
Expand Contents and edit Info.plist in a text editor
Look for the <key>Eclipse</Key> section
Uncomment one of the <string>-vm</string>... lines and point it to the 1.8 151 JDK, like so:
<string>-vm</string><string>/Library/Java/JavaVirtualMachines/jdk1.8.0_151.jdk/Contents/Home/bin/java</string>
Save the file
Start the app and it should work now!
Remember that you'll have to do this again when the tools are updated!
Finally issue resolved.
It was JDK java version.
Changed it to a level below and its working now.
java.version=1.8.0_152-ea --> not supported it seems
java.version=1.8.0_151 --> working fine with it
With android studio 3.0, you can use Device File Explorer. Tab button is right bottom side of the screen.
You can upload your file by right click - select upload.
This solution works: https://stackoverflow.com/a/51212642/4903059
Alternatively you can keep latest jdk and update swt used by monitor:
get updated swt: https://www.eclipse.org/downloads/download.php?file=/eclipse/downloads/drops4/R-4.7.1a-201710090410/swt-4.7.1a-cocoa-macosx-x86_64.zip
unzip somewhere
copy extracted swt.jar over lib/monitor-x86_64/plugins/org.eclipse.swt.cocoa.macosx.x86_64_3.100.1.v4236b.jar
But I had to download a newer swt when using Android Studio 4.0 on macOS Catalina 10.15.5:
https://archive.eclipse.org/eclipse/downloads/drops4/R-4.9-201809060745/download.php?dropFile=swt-4.9-cocoa-macosx-x86_64.zip
This tends to work for me but turn off WiFi on all the devices on your network. Also clear your cache.
If you just want to copy files from your local computer to simulator, I think you can use the adb command to achive this purpose.
Here is the sample command to copy your folder / file to the simuator's sdcard
adb push myFolder/ /sdcard/myFolder
Related
I'm trying to run a hello world flutter app for the first time on my device, but when I hit run on android studio, it shows initilizing gradle, and it stays like that for more than 20 minutes with no logging or error, I have an intel i5 as a CPU and I'm running it on Linux (dual boot, my download speed is quite slow (200 kb/s average download rate), in case this help
I installed the Flutter SDK and when I try adb devices on my machine it shows my device connected .
So why it's taking that time to run ? (until now it didn't run yet)
https://github.com/flutter/flutter/issues/15106
Please note riftninja's answer.
I look at this directory: C:\Users\myname.gradle\wrapper\dists
Yes, the gradle file is really big: 87M. You have to wait for a long time.
After this will be "Resolving dependencies....", which also slowly.
But finally it succeed.
I've faced the same problem, and my internet is currently very slow, so I solved it by changing the gradle in flutter project to an already downloaded one. Just follow these steps:
Go to C:\Users\YOUR_USER_NAME\.gradle\wrapper\dists
You should find one or more folders with the name of the distribution (for example with the name "gradle-4.6-all" if you were developing in Android Studio previously), choose one of these folders (make sure it is not empty) and copy its name.
Open Android Studio project explorer, and locate android\gradle\wrapper\gradle-wrapper.properties
You will find a line like this:
distributionUrl=https\://services.gradle.org/distributions/gradle-5.4.1-all.zip
Change gradle-5.4.1-all with the folder name you copied in step 2.
Run your app, and hopefully it works this time.
When running flutter project first time even correct configuration it takes very long time.
That is because of downloading gradel and dependencies for particular version.If you ar noob Wait it to complete automatically till all files get downloaded. By using command:
flutter run <project-name> -v you can see whats happening in background.
To Manually downloading gradle zip and put to suitable directory. Go in Project Dir:
/android/gradle/wrapper/gradle-wrapper.properties and click on url and download it.
After Downloading it visit to :/Users//.gradle/wrapper/dists/gradle-4.10.2-all/9fahxiiecdb76a5g3aw9oi8rv your version path may vary
and paste downloaded zip inside it.
For Dependencies to download you need to wait depending on Internet speed.
It is one time process until next updated version and dependencies come UP.
Providing an active internet connection worked for me.
To build gradle offline,
For Windows,
Go to File -> Settings.
And open the 'Build,Execution,Deployment'. Then open the
Build Tools -> Gradle
Then check the box -> Offline work below.
Click the OK button.
For Mac OS,
go to Android Studio -> Preferences, and the rest is the same.
Goto Android Studio - File - Other Setting - Default Project Structure
Uncheck use Embeded JDk
Below, set your JDK path.
Found in Program files - Java - Jdk.
try to making use of flutter run -v which will basically giving the info which is running in background.
The problem is that Gardle is downloading dependencies and not using any way to show progress(This is NOT good for UX), so it is better to run gradlew.bat in the terminal and things will become more clear, like this:
Now it is much better, You can have a cup of coffee while watching it ;)
I am updating my android studio but show me bellow error :
My android studio is 2.3.1
I had the same problem but starting the Android Studio in Administrator Mode has helped me to continue with the update.
The reason is that the SDK manager would write the location of the temp file where it downloads the installer. For example in OP's case its mentioned as below:
in a line form the log or error message
Due to some reason that file might not be available any more and Android studio instead of asking for a re-download would give this error.
The solution to fix this is to find the file .installData from where SDK manager is getting this info and delete it. This will force SDK manager to re download that component only and you don't need to download the complete SDK again
The content of the file looks something like this
#Tue May 16 18:41:10 GST 2017
class=com.android.repository.impl.installer.BasicInstaller
path=C\:\\Users\\user\\AppData\\Local\\Temp\\PackageOperation03
The content and path of the file would be different for different components
I got the same issue on Linux.
It was a permission issue on the SDK installation folder.
In Tools -> Android -> SDK manager there is the SDK installation folder at the top of the window.
Just do a chmod 777 -R on this folder, problem solved.
I had the same problem and i tried to uninstall/install the android studio but that didn't work out for me.
I had recently installed a fresh copy of windows. I'm using windows 10 64bit.
My problem turned out to be permission for the folder that contained the android studio/sdk.
To solve it, I removed old user permissions for user of old windows and added full control for my new user(not sure but i think modify permission would be enough).
To do so, I right click on the folder then selected the security tab.
Then click on Edit
Then click Add in the new screen
my user is named hany so i wrote hany then clicked on Check Names and it choose the right one.Click Ok
the user appears as Users (DESKTOP-8FKNNEM\Users) and then i check the Full control Then Ok
If the user had already existed in the Security tab then it should have permissions that would enable writing
I had this problem before and I tried to uninstall android studio and tried everything but I found the solution..
the solution is :
Download SDK from beginning , and change the SDK path to the new one, then it all will work .. good luck
delete
sdk-root\sources\android-##\.installer\.installData
and
sdk-root\platforms\android-##\.installer\.installData
My solution: (not as complicated as it looks)
Close project and exit Android Studio.
Run Android Studio as Administrator. (Right click on Android's icon will do.)
Android automatically loads a previous project, at exactly where I have left it supposedly.
However, it isn't where I have left it. It is at an earlier project where things (sdk settings/locations) have NOT gone wrong.
Next thing, I open the project I want to work on. A dialogue box appears saying that the Project SDK and Android SDK are pointing to different local folders. Two buttons allow me to choose which SDK location I want to use.
Either one should work!!!
Reflection:
It happens when we switch to a different user but tried to work on the same project.
We should remember to run Android Studio as Administrator unless we have an absolute clear mind about how SDK works.
Make sure you don't have an emulator running when you perform the sdk update. That was my problem that was giving this error.
Check the logs - Menu -> help -> show log in files.
In file explorer sort files by modified time.
Go to end at latest updated file you will find some error written there
In my case, it was "No space left on device".
ide.log location
Help -> Show Log in Explorer
Right click android studio and click run as administrator.. it will work.
It happens some times, you have to re-download it from the beginning with all the files because it seems that the download failed at some point, and then retry
Once I also stuck on that when tried to install emulator via AndroidSDK manager.
The solution is simple.
Right click on your Android sdk home and select sort by time.
And see last modified files.
In my case there were two text files. First file in root folder - ".knownPackages" with text something like: "ÈäUuMá–m ™ŒÝ¼´" and another one in".installdata"with endless text "nullnullnull....". But i forgot its location right now. You can search that in windows explorer.
Then I replaced them to a folder not related to Android home. Sdk re-generated them both after emulator installation.And it started work as it was before
Download Intel XAMP by clicking on this link https://software.intel.com/en-us/android/articles/intel-hardware-accelerated-execution-manager-end-user-license-agreement
After downloading extract this file and install intelhaxm-android.exe file
Problem Solved....
The easiest way I used to fix this issue is to run Android Studio as administrator (Note! My android studio installed on C:/ partition, so this issue caused by permissions)
enter image description here
I found a file ".installData" on the system drive of Windows on advice #dmsherazi. I in this file simply deleted a line in which the path is specified. Then I restarted the Studio and the update fell into place.
solution: install and reinstall Android Studio SDK
or deleting the \instantapps folder in C:\Users\UserName\AppData\Local\Android\Sdk\extras\google\instantapps could be the right solution
Go to "android-sdk" folder. Then go to "ndk-bundle", find and delete ".installData". Come back to Android Studio and goto "Help" and "Check for Updates...". I hope this will work for most of the systems. This problem solved on Android Studio 3.3.2 version.
Make sure that you have the correct access rights to the folder where the sdk is located
If this issue is with Ubuntu please try to start android studio as an administrator privilege by using the command
sudo sh studio.sh
It will resolve this issue.
If you are going for a console command it would be:
chmod -R 777 /www/store. The -R (or --recursive) options make it recursive.
Or if you want to make all the files in the current directory have all permissions type:
chmod -R 777 ./
If you need more info about chmod command see: File permission
First of all you have to show hidden files. then go to this location...
"C:\Users\pc\AppData\Local\Android\Sdk\emulator.installer"
there you will find a file by name ".installData". just delete it.
Come back to Android Studio and goto "Help" and "Check for Updates...". I hope this will work for most of the systems.
Thank me later😎
I had the same problem and I tried to delete sdk-root\.temp directory and it worked for me.
I restarted Android in Administrator mode and it worked for me
Check your internet connection/Change another internet connection and try again.
Will SDK Manager support for windows-8. I installed the android sdk for Windows 8.
But when I open the android sdk manager, a cmd-like screen just briefly flashes on for half a second then disappears. I have no idea what's going on and how to get this thing working.
I am facing same problem on Windows 8.1.
I saw following solution on internet:
Open /sdk/tools/android.bat file.
and
change
“set java_exe=” line to
set java_exe="C:\Program Files\Java\jre7\bin\java.exe"
Note:
The java.exe path could be different on your system.
But it didn't work in my case, try it on your side.
One thing strange is that if we run "/sdk/tools/android.bat" directly it works, but it does not run through "SDK Manager.exe" file.
Any other person facing same problem and got any solution?
Will SDK Manager support for windows-8
Yes, it works perfectly in Windows 8 also.
Follow below steps which worked for me :-
Go to (sdk-folder)/tools folder (For me it is C:\Users\Ajay\adt-bundle-windows-x86_64-20131030\adt-bundle-windows-x86_64-20131030\sdk\tools)
Open the file android.bat in any text editor.
Go to the line where set java_exe is located
Set the Path of java.exe which is located in your JRE. For ex : set java_exe="C:\Program Files\Java\jre7\bin\java.exe"
Save the file and try it again, now it should work !
Match your Machin's Java bit system with your android SDK bit system, i.e install a JDK x86 if you got android SDK x86. And usually android SDK works fine with Java x86 versions.
I installed android studio but while selecting android SDK I am getting following error. I tried solution which is on this post but no luck. How can I solve this?
I had this problem, select SDK folder (NOT SDK->sources or SDK-platforms)
I resolved with the instructions here,
http://www.blog.teamguru.in/2018/04/06/selected-directory-is-not-a-valid-home-for-sdk/
Just close current error window and let run the android studio
Open the SDK manager as shown below
Click on Edit SDK location as shown below
Simply press next button if there is correct location for SDK you want to install there
Let it be downloaded
Install platform and SDK tools and
Enjoy
Try restarting the application. Close all related studio processes, then right click "run as administrator".
You should be fine after this.
I got the same issue. You must enable the Android Support Plugin
Configuration > Plugin > Android Support Plugin. Check it.
Close error window
Go to gradle tab
select "Gradle settings", wrench icon
Search for SDK setup
Select appropriate sdk for your device.
Next, two times
Wait for install
There is all..
None of the other answers work. After the installation, immediately close Android Studio, then start it as administrator. A message might popup asking for the sdk manager location. Ignore it (Close the popup). Go to Tools > SDK Manager and click on the edit button on the right of Android SDK Location. Then click Next, next and you're good to go. Android Studio will let you install the sdk manager.
I had the same problem but what I found is that it requires the parent folder of the following things AVD manager,SDK manager,tools,platform-tools,build-tools etc.So what you need is to find the parent directory of these things, which you might find with a name such as android-sdk or android-sdk-windows(in case you are using windows OS).Make sure the above said contents are in that folder and select it.I hope you will find this useful.
Download the SDK from http://developer.android.com/sdk/index.html
Start SDK manager and make everything up to date
Also, make sure you have set the language level to
7.0 Diamonds, ARM, Multi-catch, etc
I had this problem on Linux. Apparently you need write access to some place in that directory, so I just took ownership of the entire thing:
sudo chown -R thomas:thomas /opt/android-sdk
Could be that something similar is going on on Windows as well.
If like me, a MacOs user which has installed Android Studio on my Mac and if you've tried everything you can think of but was still unable to set the Android SDK directory in Android Studio, follow the next steps (I know the site where I got the bundle is a freeware site but the package is the right one):
1. Download adt-bundle-mac (Android Developer Tools) from [here][1].
2. Unzip the file and browse into the unzipped folder.
3. Copy only the sdk dir to /Users/username/Library/Android
4. Open Android Studio, the error about the SDK folder which is not set will pop up, set the path to the SDK to "/Users/username/Library/Android/sdk".
5. Now Android Studio will accept the path and you're good to go.
I wasted about 2 hours until I fixed it so I hope that by writing this answer I'll save you some 2 hours.
The sdk folder contains the platform-tools folder.
I copied this folder and named it platforms, then it worked for me.
Just delete(preferably permanently) all the android directories in whatever location they are present(e.g. C:\Program Files\Android, C:\users\respective user\respective android folders). Remove the installer as well(if possible). Make sure to save all your Android Studio files in some external storage (preferably).
The main thing is to get Android studio with SDK.
Now go to the android studio website and install android studio leaving all settings default. There you will also get to install the SDK and it's linking.
It will take some time to load and will load nearly 1.5 GB files.
This worked for my case.
In my case I wasn't giving him admin permission
Steps to follow:
Close Android Studio.
Restart Android Studio and Give the path of Empty Folder .
Install Sdk in that folder(Sdk will automatically install and will get configure automatically.)
With Android Studio 4.1.2 the easiest thing is to close the project (file / close project). That's how you get to the wizard that automatically sets up the SDK for you.
The default location that it suggests is /Users/stan/Library/Android/sdk (exactly the same that I was trying to set up manually but AS kept saying it's invalid)
I just downloaded the Android Developer Tools Bundle. I started following the setup instructions and gotten as far as extracting the files to new location ("Development") as it says. I tried running the Eclipse app as instructed, yet a window popped up saying;
A Java Runtime Environment (JRT) or Java Development Kit (JDK) must be available in order to run Eclipse. No Java virtual machine was found after searching the following location:
C:.........\Development\adt-bundle-windows\eclipse\jre\bin\javaw.exe
javaw.exe in your current PATH"
I tried compatibility trouble-shooter which can not detect a thing, whether it was the right action to take. I looked across stackoverflow and tried a few of the suggestions with no change. I looked at windows site and android site and nothing seems to make any difference, good or bad (well, I hope no bad).
I literally got this laptop 10 days ago and all programs are brand new, no updates or reinstalls etc.
I am running a Windows 8 with 64bit, which is what I selected at download of ADT Bundle.
I had downloaded the wrong java file.
To fix I went to;
http://www.oracle.com/technetwork/java/javase/downloads/jdk7u7-downloads-1836413.html
and accepted terms then downloaded the appropriate file which I had to signup for registration;
Windows x64 90 MB jdk-7u7-windows-x64.exe
It worked without changing any PATH.
Thank you..
At first download jdk(java development kit) and install it. the jdk includes the jre(java runtime environment). You can also install the jre alone.
Thank It worked. Just add C:\Program Files\Java\jdk1.7.0\bin in your PATH
Control Panel
1. System
2. Advance Setting
3. Advance
4. Environment Variables
5. System variable Group
6. look For PATH in the list
7. Edit
8. Add path of your C:\Program Files\Java\jdk1.7.0\bin jdk installation and save
Remember to separate value with ;
You must download a JDK or JRE first from java.oracle.com, and add your installation folder in the PATH system avaiable.(Control Panel --System--Advance Settings --advance -- enviroment)
Go to the following page and download the executable on java.com
The executable installs the latest JAVA virtual machine.
NOTE: for Windows only
The installer knows your current version of windows.