This is a screenshot of my DDMS. As you can see there is nothing and I cant find any way to get the devices list or any other functional parts.
I try to reinstall android studio and new sdk but still its not solved. Is there any way to solve this problem?
Thanks
I encountered this problem this afternoon, after half day of annoying work, I solved it at last.
The solution is, just delete *.cfg and monitor-workspace in $HOME/.android/.
Below is how I solved the problem.
There's little information about this problem. I guess it is a rare one.
I have tried several ways. First, reinstall the build tools, simply download and replace the tools directory. But it didn't work. And then I reinstalled the Android Studio, still not work either.
But during the procedure I have found that the ddms must have saved some cache in the computer. So I find the place $HOME/.android/ in this website.
After delete all *.cfg(3 or 4) and monitor-workspace, my ddms works well again.
I guess delete all *.cfg is not necessary, just ddms.cfg. But I'm not sure.
Go to DDMS perspective -> Devices -> View menu(on right corner) -> Reset adb
If still not working, run this commands in command prompt/terminal
adb kill-server
adb start-server
It was broken after latest Android SDK sync using Android Studio. To fix it, launched SDK manager using Eclipse, and installed SDK tools versions 24.01 and 19.1, and removed intermediate results.
I had to right click on "DDMS" (perspective button) and click on reset to make it work.
I am not sure, but you can try Window menu => show preview (select your necessary window view ).
and another try minimum /Maximum window button press
Thanks
Delete the .android directory in user home
Related
Installed android studio latest update and
started a project. But when I press run, emulator is not showing up.
And it say delete *.lock files. But I have already tried. Still couldn't see
the emulator. Please help me.enter image description here
You don't have to completely delete the emulator when this happens. The files to delete should have a ".lock" extension:
You don't need to touch the configuration files.
You can easily find the files location by clicking on the arrow under the Actions tab (in the ADB manager), and selecting "Show on Disk".
On the AVD (Android Virtual Device), edit the device graphic setting from Automatic or Hardware to Software
Go to the down arrow and click on the "Show on Disk" link like the attached image. You will get the list of all files, remove the file "hardware-qemu.ini.lock" and start again.
Try to delete All the .lock files under .android/AVD/emulator_name/.lock,
And right click the emulator wipe data,restart/rerun the emulator.
It's restart the Avd and rebuild the gradle projects.
You can open the task manager and see if there are "qemu-system-x86-64.exe", "adb.exe" and "emulator64-crash-service.exe" processes among the processes, and then you can kill these processes. so you can restart your emulator.
Thank you all for the answers. After trying many ways of your suggestion, I finally decided to uninstall this version and reinstalled the previous archive and it now working fine. I still don't know the reason why. Thanks
Follow this https://stackoverflow.com/a/73287406/11139649 and then delete the Virtual device and create a new device.
When I launch emulator in Android Studio through AVD, it keeps on having this annoying popup "unable to locate avd".
I'ved removed platform tools and reinstall it under SDK Manager->SDK Tools->Android SDK platform-tools so that its a new avd.exe but it doesnt help.
I am really clueless now how, I would like adb prints coming from the emulator to debug. How can I solve this ?
FYI, I am developing flutter on Android Studio 4.0
I had the same issue as you were facing, I have Researched the Whole Internet but found nothing useful. So, I somehow figured out the problem and fixed it, The problem is at
app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Whenever we create a new project due to some reason the Module SDK is not set up automatically. Thus the ADB manager was throwing an error 'Unable to locate AVD', which is not that fatal as the error/warning is not stopping us from launching /starting the emulator, but it is so annoying to see that pop-up box. So here is my simple and quick fix.
Solution:
Click on the project folder, tap the dropdown icon just beside it.
Now Navigate to the path below.
> android/app/src/main/java/io/flutter/plugins/GeneratedPluginRegistrant.java
Now Click on the file GeneratedPluginRegistrant.java to open it.
Once it is open, At the Top you will notice a bar that says 'Module SDK is not defined',
Now right against it, you will also see a hyper-text named 'Setup SDK', Just Click on it.
That will open a Pop-up Box with the title 'Select project SDK'.
Now select the Android Platform API and then click OK. After that being done Restart your IDE.
Your Problem will be Solved. And you will also notice that Emulator Opens up way faster than before.
NOTE:
The Above Steps has to be performed with every new flutter project.
I have attached some screenshots just follow them.
The Problem
The Below image represents the annoying Popup-box that you encounter while launching the AVD which we are going to fix.
Step 1 : Close the AVD window
Step 2: Navigate to GeneratedPluginRegistrant.java
Step 3: Look for Module SDK not Defined
Step 4: Against to Module SDK click on Setup SDK hyper-text.
Step 5: Select any Android SDK version
Step 6: Click OK
Step 7: Restart Android Studio IDE.
After Restart you wont see the Annoying popup box anymore.
I have also Uploaded a Youtube Video for you. Check that out as well.
https://www.youtube.com/watch?v=19ESTnrmYJY&feature=youtu.be
This may seem very basic but start with a full system restart,
Where did you install the SDK's & AVD(Default Directories).
Do you have the same issue when you plug in your own Physical Device.
Ensure you have enabled USB Debugging for step 2.
If possible walk us through the installation steps so we can identify any possible errors you may have made
I've had the same issue and it took a while to figure out what's wrong, but in the end, it was a storage problem, just check if you have couple of gigs (at least 5gb) of free space left where you have your avd installed. That fixed it for me.
Try this.
Copy platform-tools address and paste it in environment variable in path.
C:\Users\viram\AppData\Local\Android\Sdk\platform-tools
hope this works.
I will answer this myself as this was how it was solved.
open a native android project, and then adb works.
This looks like a bug in flutter.
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.
Trying to install app on real device following instructions:- http://developer.android.com/tools/device.html. At end Android Studio giving error:
Session 'app': Error Installing APK
I guess the problem probably can be in my android device(it is chinese Doogee X5). It does not have a given USB Vendor ID in developer docs so I decided to follow instructions with random vendor ID from HTC.
I'm sure there is a way to run application on any android device, but yet I didn't find an answer on how to do that.
I'm running through Linux Ubuntu 14.04 LTS
Edit:
In newer Android Studio versions you can re-sync the project using this button:
For older versions:
Open Gradle window (on the right side in Android Studio) and click on the refresh button.
However it is not a 100% sure fix.
Solutions for other cases:
Open terminal window and type "adb kill-server", then type "adb start-server". Usually after a few hours of inactivity, adb used to disconnect the device. (If you don't have the sdk/platform-tools in the PATH environment variable, then you should open a terminal in that folder)
One tip if these solutions don't help you:
If you open the Event Log window in the right bottom corner of Android Studio, you can see a detailed error message.
Other edge case
If you see this error: INSTALL_FAILED_INVALID_APK:... signatures are inconsistent.
Then unfortunately a gradle refresh isn't enough, you have to go to Build -> Clean Project and then Run again.
Issue with Android emulator
If you want to deploy the APK to an Android Emulator and you see the "Error installing APK" message, your emulator may be frozen and need restart.
Turning off the Instant run removed my error for Androdi Studio 2017.03.03 v2.3
You have to enable Developer options and enable USB Debugging:
Go to the settings menu, and scroll down to "About phone." Tap it.
Scroll down to the bottom again, where you see "Build number." (Your build number may vary from ours here.)
Tap it seven (7) times. After the third tap, you'll see a playful dialog that says you're four taps away from being a developer. (If only it were that simple, eh?) Keep on tapping, and poof, you've got the developer settings back.
http://www.androidcentral.com/how-enable-developer-settings-android-42
Inside Developer Options, enable USB Debugging
Try using a different version of Gradle(stable version).
To summarize:
Check your gradle file for debuggable false/true
Invalidate caches & restart
Check your install location
Restart adb
I fix this by delete the build folder then run project again
Make sure that your device is not out of Memory!
I changed my USB port and that fixed it for me.
Make sure that project name doesn't contain special character.
Another possibility may be the USB driver on your PC. In my case, switching from my 3.0 USB port to my 2.0 port fixed the problem.
Ensure you android device has enough memory to install the app. Sometimes it so happens working with multimedia app where the device storage keeps on increasing and you keep wondering about the error.
Therefore, free up some memory and try installing again!
A bit late to the party, but be sure that you are trying to build a proper build variant. It sometimes happens to me that when I update AS, the build variants are totally messed up, so instead of building the "debug" variant I am actually building the "release" variant, which outputs apk to a different location (not to app/build directory, but to app directly) and I get the following error:
The APK file /path/to/file/app.apk does not exist on disk.
Error while Installing APK
To fix this just open the menu in left bottom corner, click on "Build Variants" and select the debug variant (it might have a different name, depending on how many modules/flavors or custom gradle build types you have).
Try to remove the .idea folder and .gradle folder, then click Sync Project with Gradle Files, when the process finished, try to run app again.
Hope it works.
just press Build button from menu bar and then press build app wait for it finished then press build APK and then run your emulator, it will work
Usage of easily changing variable value will often happen in build.gradle(like the Date)
In my case with Android 8.0(Oreo), no one of this solutions worked!
If you have more than 1 user, then you should go to Settings->Applications->All Applications->Find the application and uninstall for all users!
After this steps, it worked!
Just rebuild and clean project, then run project.
This happens because the gradle is not synced with the app. Go to : Tools -> Android -> Sync Project with Gradle files. Re-run and you should be good to go.
Nothing above helped me. The fingerprint dialog did not appear. I checked another android device and the dialog appeared and debug was possible.
So the problem was on device side not on computer side I made reset "to factory settings" on device and this helped me.
I fixed my issue, simply by using :
Build->Clean Project
then
Build->Rebuild Project
I had this same issue and none of the other solutions worked for me.
Although no errors were shown nor expanded upon in my IDE GUI, I opened up a second Android Studio window window with a different project and noticed in the bottom that the "Event Log" showed an error in a different window, but not in the project I had opened. The issue stated was:
Error: INSTALL_FAILED_CONFLICTING_PROVIDER
Which lead me here - Install shows error in console: INSTALL FAILED CONFLICTING PROVIDER :
I had this FileProvider labeled in the manifest:
<provider
android:name="androidx.core.content.FileProvider"
android:authorities="myapp.sameonehere.android.fileprovider"
android:exported="false"
android:grantUriPermissions="true">
<meta-data
android:name="android.support.FILE_PROVIDER_PATHS"
android:resource="#xml/file_paths" />
</provider>
Which I had copied from another project and forgotten to rename the 'authorities' String in. After changing it to something unique, it ran without issue.
Make sure you don't have any conflicting authority Strings like in my example.
Also, if no errors are showing up, try opening a second project and see if the "Event Log" shows errors in that location instead.
Uninstall the app, and re-install and it should work!
Go to avd manager and click on Wipe Data of the device you want to run. Worked for me. The size of device on disk will reduce after wiping the data. I hope it helps someone.
You have to enable Developer options and enable USB Debugging:
1:Go to the settings menu, and scroll down to "About phone." Tap it.
2:Scroll down to the bottom again, where you see "Build number." (Your build number may vary from ours here.)
Tap it seven (7) times.
After the third tap, you'll see a playful dialog that says you're four taps away from being a developer.
Keep on tapping, and poof, you've got the developer settings back.
My issue was solved by
Clean --> ReBuild --> Run
and in my case it was because i accidentally deleted the project folder and when i clicked ctrl+z to restore something wrong happened.
My problem was that I didn't accept the connection from the computer after turning on remote debugging. Once I accept the mac address, it went away. Silly mistake, but I didn't see the dialog box the first time. Worth a quick check if the others don't resolve the issue. But likely only a problem the first time you set up a phone.
What worked for me is deleting the app from the emulator (which was an app built from an older commit) and re-running from Android Studio.
It was written above: in my case it was just out of memory on device storage. Add more empty space - and error will disappear
I tried invalidating cache, deleting build folder and gradle sync. Also, I couldn't uninstall because the app is not visible on device. So I tried uninstalling through ADB and it worked.
adb uninstall <package_name>
If you are using android emulator, try changing a device.
First my emulator is too slow to work properly. I'm already frustrated because of it. So I closed that emulator and stated another(by running the application). But now my emulator is not showing in DDMS and every-time I run the application it creates new emulator rather than using existing. So I'm not able to run the application on emulator. If I connect a device then the device is showing in DDMS and working properly, but not my emulator.
And please don't tell me to restart emulator, eclipse etc. Because, already a lot of times I have tried it(even restarting PC), but its useless.
Try running the emulator via the command line with the parameter -verbose, might give you some information on the issue.
I solved this issue by going to wards DDMS-> reset adb..
I understand that the emulator speed is too slow. If You want to start the same emulator, You may choose it explicitly.
If you are using eclipse Right click your project -> Properties-> Run Debug Settings -> Click on your project name -> Edit -> and choose 'Always prompt to pick device' .
So now everytime you build your project, you can choose the same emulator.
Hope this helps!!!
I solved this issue by removing the path to platform-tools from my bashrc file.
In Mac OSx, you need to go Run-> Edit Configuration and you need to tick use the same devices for future