Android Studio SDK manager doesn't show the candidate packages(How to install CMake) - android-studio

From the post "Add C and C++ Code to Your Project",
You can install these components using the SDK Manager:
From an open project, select Tools > Android > SDK Manager
from the menu bar. Click the SDK Tools tab. Check the boxes next to LLDB,
CMake, and NDK, as shown in figure 1.
there is a image shows
But my Android Studio is not like that.
I upload a image to show my Android Studio sdk manager settings:
I googled for a while, but I didn't find anything useful. My PC is win10 64bit, I run Android Stdio 64bit, version is 2.2, I use the Android Studio bunndle version(I assume the AS and the sdk are one thing).
I also run Android Studio 2.3 on another PC, I check the sdk manager on version 2.3, it looks like behaving the same. I also try to run AS in the administrator role. it looks like behaving the same too.
The different on the AS2.2 and AS2.3 is that I can run the sdkmanager command in a win shell to install the CMake/LLDB on the PC that has AS 2.3, but I can't find the sdkmanager command in the SDK folder which is associated with the AS 2.2, so I go to download a standlone command line tools from the developer.android.com, I unzip the downloaded file and get a fold named "tool", what should I do? shold I merge the downloaded tool folder into the android_sdk/tools?
The below image is the sdk settings on another PC that has installed the AS 2.3. I installed the CMake the LLDB from the command line: "sdkmanager.bat cmake;3.6.4111459"
Why my Android Studio doesn't show the candidate not
installed packages?
Shold I merge the downloaded command line tool folder into the android_sdk/tools?

Related

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

Android Emulator won't start from Android Studio on Windows 10

Recently (after install Android Studio 2.3.x, I'm now at 2.3.1) the emulator won't start in Android Studio.
I can run the emulator from the command line if it is in the SDK\tools directory.
If I run the emulator from a directory other than the SDK\tools directory I get an error like this:
[12236]:ERROR:./android/qt/qt_setup.cpp:28:Qt library not found at ..\emulator\lib64\qt\lib
Could not launch '..\emulator/qemu/windows-x86_64/qemu-system-i386.exe': No such file or directory
The tools and platform-tools directories are in my path. Android_home is set correctly. First I tried re-installing the emulator from the SDK manager in Android (now that the standalone SDK manager is gone I can't do it there). I manually downloaded the SDK and installed it overtop of the old SDK. I then tried putting it in a new directory and changing the ANDROID_HOME and updating my paths and changed the setting in Android Studio (and all the local.properties files). Next I completely uninstalled Android Studio and SDK, rebooted and reinstalled Android Studio. Still having the same problem.
I've tried the suggestions here in the question here: Emulator on Android Studio doesn't start after SDK tools update to 25.3.1 by copying various directories (first sym-links then copy directories as sym-links work differently on windows).
I've tried all the suggestions here: https://issuetracker.google.com/issues/37137213 as well.
I've re-installed HAXM, but I don't think it is an Emulator problem as it does work when I start it from a command prompt in the tools directory.
Any suggestions?
Details:
Windows 10 (Build 1703)
Android Studio 2.3.1
I've resolved the problem in this way:
in command line, from the folder containing avd images, I've run the emulator.exe against a virtual device image using the switch -gpu swiftshader.
To be precise, in my case, in command line, from the folder C:\<Users>\.android\avd I've typed
<android sdk folder>\emulator\emulator.exe #Nexus_4_Lollipop -gpu swiftshader
where Nexus_4_Lollipop is a name of the avd image.
Changing Graphics settings from "Automatic" to "Software - GLES 2.0" in Virtual Device Configuration worked for me. I think it's the same as "-gpu" command line option, but not all modes available: https://developer.android.com/studio/run/emulator-acceleration.html

Error "Dependent package with key emulator not found" while updating Android SDK and tools

I tried to update my Android Studio and got this error. How can I fix this?
I don't have much experience with Android studio and Android app development.
I am using Android Studio 2.3 and Linux.
This worked for me as this post try: Update 2
https://stackoverflow.com/a/42735118/5133603
Update 2:
Solution to emulator package issue!
After digging in the repo's XML for a while I've spotted the issue.
It turns out that the "emulator" package is only in channel 3 (canary) while the "tools" package is in channel 0 (stable) but depends on "emulator". The solution is to force the manager to download the "emulator" package from channel 3:
./sdkmanager --channel=3 emulator
Problem solved!
This is what worked for me:
Download the command line tools, place them in the SDK folder (e.g., on mac: /Users/user/Library/Android/sdk), and then add the bin folder to the PATH.
Install the latest platform: in a terminal, execute sdkmanager "platforms;android-25"
Open Android Studio, and go to the SDK Manager (Appearance and Behavior > System Settings > Android SDK)
Click on "Edit", and then select the sdk folder. Then "Next" > "Next" > "Finish".
I hope this works for you too.
Temporarily change update channel to Canary Channel (Settings > Appearance & Behavior > System Settings > Updates). It works for me (Windows, Android Studio 2.3) I hope, this bug will be fixed in the next version of Android Studio.
My solution using Void Linux (it should fix for other distributions too):
Create a new folder named Sdk in this exact path. Bash example: $ mkdir $HOME/Android/Sdk
cd to this folder, and download the latest SDK command line version. Bash example: $ curl https://dl.google.com/dl/android/studio/ide-zips/2.3.0.8/android-studio-ide-162.3764568-linux.zip
Extract the android-studio-ide-162.3764568-linux.zip. It must be this way: $HOME/Android/Sdk/tools
Launch Android Studio, and then proceed with normal installation.
PS: If you don't have a Android folder on your $HOME, you should create it, and then make the steps 1, 2, and 3, select the $HOME/Android/Sdk Folder in Android Studio → Configure → *SDK Manager → Edit, and proceed to step 4.
Start "Android SDK Manager" from this path:
%Android_home%\SDK Manager.exe
Install all updates from this manager.
P.S. This worked for me.
This is what worked:
Download the command line tools and place them in the SDK folder (on mac:~/Library/Android/sdk).
Install Android studio 2.3 (on mac: /Application/Android Studio.app)
Add path to java in Android Studio (export PATH=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home/bin:$PATH)
Set JAVA_HOME (export JAVA_HOME=/Applications/Android Studio.app/Contents/jre/jdk/Contents/Home)
cd to ~/Library/Android/sdk/tools/bin and execute ./sdkmanager "platforms;android-25"
Accept the license - this will install the android-25 platform
Launch Android Studio, and goto the SDK Manager. The SDK Manager will now recognize the SDK path (~/Library/Android/sdk).
Now install the rest of the tools.
This fixed it for me (on a fully-patched Ubuntu 16.04 (Xenial Xerus)).
Disclaimer: I cleaned up everything beforehand:
rm -Rf ~/android-studio/ ~/.AndroidStudio2.2/ ~/.android/ ~/Android/
Then:
wget https://dl.google.com/dl/android/studio/ide-zips/2.3.0.8/android-studio-ide-162.3764568-linux.zip
wget https://dl.google.com/android/repository/tools_r25.2.3-linux.zip
unzip android-studio-ide-162.3764568-linux.zip -d ~/
mkdir -p ~/Android/sdk
unzip tools_r25.2.3-linux.zip -d ~/Android/sdk
~/Android/sdk/tools/bin/sdkmanager "platforms;android-25"
~/Android/sdk/tools/bin/sdkmanager --channel=3 emulator
~/android-studio/bin/studio.sh
Click "Configure" in the launch window
Select "SDK Manager" in the menu
The list on the right shows "partially installed" for API level 25
Click "Edit" on the right of "Android SDK Location"
You get the warning "an existing Android SDK was detected wizard will only download missing or outdated SDK components"
Click "Next"
Click "Next"
[wait while it installs]
Click "Finish"
I got this problem since hours on my Apple M1 processor.
After a clean delete of Android SDK, this workaround worked for me: https://stackoverflow.com/a/69868954/6809733
Just download the IDE - Intellij IDEA and create a new project, select
Android Project and there download Android SDK, now you can install
android studio again and the sdk is installed. Worked for me!
Just delete the directory C:/Users/%user%/AppData/Local/Android/sdk and rename the other directory in that location from sdk1 to sdk.
Restart Android Studio (close projects) and an assistant will pop-up asking you to update the sdk which will be detected during that process, so a re-download won't be necessary.

How to update SDK in Android Studio in the background

Today I'm trying to update the SDK in Android Studio on my Ubuntu, and looking for the menu that make the download process running in the background. So I want to download the SDK and continue to work in Android Studio.
As far as I can remember Eclipse has menu that can download in the background task so I can continue work while downloading.
I've tried to find the option in settings but I could not find it, and on the downloading GUI has no option to download it in the background, here is my screenshot:
Is anyone having the same issue here? How can I resolve this?
You can go to tools -> android -> sdk manager and click on Launch stand alone sdk manager hyperlink. This will open sdk manager outside android studio, select the packages and download. You can continue to work on android studio this way.
The "Launch standalone SDK Manager" option seems to be gone in Android Studio 2.3.3 for Windows. However, there is sdkmanager.bat in \tools\bin
It is possible to do it all by code using the sdkmanager tool.
The sdkmanager is a command line tool that allows you to view,
install, update, and uninstall packages for the Android SDK.
This is an example using the sdkmanager with the command line:
First at all, the sdkmanager is located in android_sdk/tools/bin/.
Go where the sdkmanager is located
List installed and available packages using this command:
sdkmanager --list
The result willl be something similar to this
In my case I want to Download a System Image with Release Name "P" with ABI x86 ( I saw this information from Android Studio)
The next step is to search that system image in your list
Finally install this package in this way:
./sdkmanager "system-images;android-P;google_apis;x86"
This will begin the process of downloading the package
After finish you can check that the image is available to use
For more info: https://developer.android.com/studio/command-line/sdkmanager.html#usage
Upgrade to latest version of Android Studio (Currently in 2.3.1).
It now support download (both SDK and plugins) in background.

Android Studio Beta v0.8.14 not showing in start menu

I have downloaded Android Studio Beta v0.8.14 and followed the steps to install it on Windows 7 from the link:
https://developer.android.com/sdk/installing/index.html?pkg=studio
The link says to launch studio.exe and follow the installation wizard. But the zip file contains studio.exe file in bin folder and directly launches Android Studio(after resolving all issues). There is no installation wizard and so it is not showing up in start menu. I don't have any others problems though but just want to make sure that everything is all right.
Am I missing something?
Android studio doesn't have an installer. you just unzip the file and its ready to go. You are not missing anything.
However, if you want to you can adda start menu shortcut for the .exe file if you want, that doesn't have an installer.

Resources