The Android SDK may be missing the directory 'add-ons' [duplicate] - java

I am new to android software development. When I try to write the first android program, a pop up window shows up after I finish choosing all the basic settings, said that it fail to parse SDK, and the directory 'add-ons' might be missing. I check the SDK folder I just install, and the SDK folder exist, also with plenty of stuff inside. Can anyone tell me how to solve this problem?

The SDK is bundled with Android Studio, you don't have to download it separately.
I've seen this issue on both machines I've installed Android Studio on - the "add-ons" directory doesn't get created at install.
Assuming you're on 64 bit Windows and installed to default location, look here:
*C:\Program Files (x86)\Android\android-studio\sdk*
If you don't have a "Program Files (x86)" folder, look in "Program Files"
I'd bet there's no "add-ons" folder in there. If not, create one and than start Android Studio. You should see no problems.

I ran Android Studio as Administrator and it worked.

First of all, please check if you've actually downloaded the SDK with the SDK Manager.
Then:
Close your current open project in order to get the welcome screen of the Android Studio (it's small window where you have your projects listed on the left side)
Click on Configure > Project Defaults > Project Structure
Click on SDKs under Platform Settings: in the middle column you should see the list of the SDKs currently installed on your machine
Click on Android SDK under Platform Settings and check/set the SDK location
Apply any change and restart Android Studio

I have faced the same problem and yes the add-ons folder was not installed in sdk folder.
Create the folder add-ons in C:\Program Files (x86)\Android\android-studio\sdk folder.
Then create the project again. Your problem will be solved.

On my ubuntu linux distribution, a "missing add-ons directory" problem was caused by folder permissions. The owner of the installed android-studio was root. And I encountered the problem when running android studio (version 0.3.2) as a regular user and creating for the very first time a new project. So, it seems that as part of creating the project, the add-ons directory is created. Although not desirable, I solved the problem by making this regular user the owner of the android-studio installation (using a chown -R command).

Same problem but solved :
I have installed package "Android studio for linux" in /usr/local/android-studio in it you will find /usr/local/android-studio/sdk/tools/android executable tool too download or update Android SDK.
Once done, retry to launch studio.

I had the same problem and it was because my user is not an administrator in win7 and I installed Android Studios for everyone and not just for me. Therefore the SDK stuff was installed under Program Files(x86) which I don't have any write access to, instead of under your user in C:\Users\
To solve I had to either:
Change write/modify permissions for C:\Program Files (x86)\Android\android-studio\sdk for your user. Then you don't have to run the Android studio as admin every time.
Reinstall Android studio and choose to install it just for you (your user)
Run the Android studio as Administrator which is bit annoying if you have a separate admin account.

I have problem like you and i have resolve that! You must take owner ship this folder SDK in folder's you setup android studio. You can download file Takeownership on link. install it just the way click on file TakeOwnerShip-install.reg and go to folder SKD, right click and select TakeOwnerShip. Done this problem will be resolve.
TakeOwnerShip

ok, you can edit this Code and save with format .reg and run it.
Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\*\shell\runas]
#="Take ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\*\shell\runas\command]
#="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" && icacls \"%1\" /grant administrators:F"
[HKEY_CLASSES_ROOT\Directory\shell\runas]
#="Take ownership"
"HasLUAShield"=""
"NoWorkingDirectory"=""
[HKEY_CLASSES_ROOT\Directory\shell\runas\command]
#="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"
"IsolatedCommand"="cmd.exe /c takeown /f \"%1\" /r /d y && icacls \"%1\" /grant administrators:F /t"

update program to latest, android studio will active icon SDK Manager.
if you use old version icon SDK not active you must find SDK support it.

Related

Started failed Android Studio

When I start Android Studio I see the following:
Internal error. Please report to https://code.google.com/p/android/issues
java.lang.IllegalStateException: Couldn't create Engine
at com.google.android.filament.Engine.create(Engine.java:46)
at com.google.ar.sceneform.plugin.viewer.Filamentor$3.run(Filamentor.java:103)
How I can solve this problem?
Make sure you have folders .cache and .local owned by your user (not root).
To change owner you need to run this:
sudo chown -R your_user_name:your_user_group .cache
sudo chown -R your_user_name:your_user_group .local
Make sure you download the Application from the official android studio website. Install it again and give you laptop full access to the internet because apart from the Studio software it downloads many other plugins and sdk tools etc, so install it again giving it full access to the internet. I hope it helps.

Android studio 3 - java.lang.RuntimeException: No server to serve request [duplicate]

After clean install of Android Studio I always get the error
Error:java.util.concurrent.ExecutionException:
java.lang.RuntimeException: No server to serve request. Check logs for
details.
and
Error:Execution failed for task ':Application:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: java.lang.RuntimeException: No server to serve request. Check logs for details.
Java is up to date and the path is set.
I am new to Android Studio, what should I try?
We ran into the same issue, and have been able to find the root cause: The error message means that Gradle cannot connect to some worker processes. In our case, the process was for 'aapt2'. Running 'ldd aapt2' indicated that some shared libraries were missing (mainly GLIBC). Since we're using Docker based on Alpine Linux, it comes with a reduced GLIBC (glibc-musl). The solution was to simply install glibc in the Docker container.
I suggest you run ldd build-tools/{version}/aapt2
to see which libraries are missing from the OS. You did not mention your OS, are you also using Docker and AlpineLinux ?
In my case, I did not need to re-download the sdk. I closed Android Studio and ran the following command in the Terminal:
sudo chmod 777 -R ~/Desktop/AndroidStudio
...where, ~/Desktop/AndroidStudio was the folder structure after Root which I needed to mention in order to provide permission to read all the SDK packages and perform required operation as and when necessary by the Android Studio, because my Sdk folder was inside "~/Desktop/AndroidStudio".
I am running Android Studio 3.0.1 on Ubuntu 16.04 LTS. This worked for me perfectly :-)
This error occurred because you might have accidentally remove the executable flag from aapt2 which is located in $ANDROID_HOME/build-tools/27.0.2.
Try this:
Re-download the sdk (recommended)
followed by-
sudo chmod 777 -R $ANDROID_HOME
Note:
$ANDROID_HOME is the location where I put android sdk
Hope this helps !!
Had to uninstall Android studio and delete the following
SDK folder in AppData folder
Delete .gradle folder
delete .AndroidStudio Projects folder
and did a fresh install which solved .
I had this problem on lubuntu-16 32bit (and also some other problems too). all of the problems were solved when I updated my system to lubuntu-16 64-bit.
Here how I fixed this Issue:
1.Deleted .gradle folder.
2.Closed android studio and run as administrator.
On Start android studio will rebuild the folder you deleted.
sudo chmod 777 -R $ANDROID_HOME
Note: $ANDROID_HOME is the location where you put android sdk
Hope this helps !!
If it is possible for you, please delete the build folder of project and test building android project with any other version of build-tools.
in my case, build-tools version: 26.0.2 had problem, I tested with 27.0.3 and it solved my problem unbelievably :)
I ran into the same problem, and it turned out I had messed up the file permissions inside the android-sdk folder (more specifically android-sdk/build-tools/{version}), and some binaries were missing execution permissions.
In my case, I simply gave x permissions to the relevant files in that directory, but if you're not sure, I suggest you uninstall the android sdk, completely remove its directory and then reinstall it again.
So after investigating the issue for long , I have a concrete solution .
Let`s look into it.
Go to Android Studio -> Help -> Show Log In Files
In the subsequent folder that opens, open idea.log
This would present you with a log file which contains logs of processes right from when the studio started. Now in this file, you have to search for the possible issue. For some the issue might be due to
java.io.IOException: Cannot run program "/home/mmt/Android-Sdk/android-sdk-linux_x86/emulator/emulator-check": error=13, Permission denied
For some others, it may be some other. The point is that this file contains lot of irrelevant logs and you have to identify the one that is causing this issue. For me , after discovering the above issue, I granted permission to that particular folder using the below commands
cd $ANDROID_HOME/sudo chmod -R 777 emulator/
After this, rebuild your project and tadaaa.. problem resolved.
for me it was a virus that corrupted my files from the "build tools" folder. so I uninstalled everything and made a new installation of android studio, SDK and build tools.
For me, this is the side effect of another issue that I haven't root caused yet. Every once in a while, I get aapt2 failures because some file /tmp/ld-linux-x86-64.so.2 is "busy", with the following error message.
AAPT err(Facade for 1745790725): cp: cannot create regular file '/tmp/ld-linux-x86-64.so.2': Text file busy
Slave 1745790725 failed to start java.lang.RuntimeException: AAPT slave failed to start. Please make sure the current build tools (located at ~/.../android-sdk-linux/build-tools/27.0.3/aapt2) are not corrupted.
When this happens I just rm that file and everything starts working again. I suspect this might be caused by me actually having two installs of adb (one through ubuntu via apt and one from Android studio) but I haven't had time to dive deeper.
I already had latest version of build-tool installed, so I just had to give permission to Android_home:
chmod 777 -R $ANDROID_HOME
and build again. This worked for me.
If you are on Windows 10 (sigh), close android studio and then right click on android studio icon and select 'Run as Administrator' from 'more' menu.
Build again.
You can run Android Studio as Admin.
I hope it will help you.
To Do So :
Right click
choose Run as Administrator
Best regards,

Can I do a silent install of the Java JRE without installing the Ask toolbar?

I'm trying to automate the install of a Java 7 runtime on my Windows Server. I can make the install run silently, but the Ask toolbar seems to get installed as well. This enrages me even more than when it prompts during the desktop install.
How can I make it stop? And while I'm at it, is there a way to not prompt for third-party products when doing the regular updates on the desktop?
It's easy! After downloading the executable installer (for example, http://download.oracle.com/otn-pub/java/jdk/7/jre-7-windows-x64.exe), open a command line with administrative privileges, go to your downloads directory, and run the executable with /s SPONSORS=0
For example:
jre-7-windows-x64.exe /s SPONSORS=0
This will not only run a silent installation, but it will bypass any sponsor offers.

studio.sh open permission denied for android studio in ubuntu

I downloaded an Android Studio for linux and then tried to run the studio.sh file inside the 'bin' directory as per the instruction said. The terminal showed an error saying something like this:
bash: ./studio.sh: permission denied
The whole Studio bundle was in .tdz format and I extracted the files before accessing via the terminal. What is the main cause for such error?
Thank you so much!
Got the same problem.
But solved it by following steps:-
Right click on studio.sh and select Properties.
There go to Permissions.
Check "Allow Executing file as program"
And you are done.
Type
sudo ./studio.sh
This should launch android studio with admin privileges. You will need to type your password, assuming you have admin privileges. If you do not have them, you need to contact whoever manages the computer.
When it launches for the first time, it will ask yo to add a shortcut so it is reachable from the GUI app menu. After that, launching android studio should not require sudo permissions.
https://askubuntu.com/questions/421389/where-to-unpack-the-android-studio-file has good recommendations of where to extract android studio to.
You've probably extracted it as root. Change the owner of the file to you with chown command and extract it again, or change the owner of the whole extracted content to you. Example (sudo may be required):
sudo chown yourUserName studio.sh
The other way to do it: change privileges with chmod
sudo chmod a+x studio.sh
Beware, the above one gives every registered user privileges to execute studio script.
--make this--
1°
sudo chown root:YOURUSERHERE /dev/kvm
2°
sudo chmod -R 770 /dev/kvm
so you will be allowed to install and run android studio
Hope this helps :)
I have the same problem, then i used
sudo sh studio.sh
then it`s worked.

Mac Java Path Issues with trying to run Android SDK

I'm trying to run the android tool from command line and I keep getting
sdkmanager.jar not found
I've seen a few other questions with this, but none had a clear answer on how to fix it. I believe it's a path problem. It seems obviously a path problem. But how do you change the path in Mac?
I'm an experienced windows user and have always had to install java instead of it coming with the software updates. I even downloaded the 1.7jdk preview port they have for mac that's still in beta.
I just don't know how to change the path so it works. The other person who posted this issue added a EXPORT PATH=/somedir/android-sdk/:$PATH to her .bash_profile but there was no response as to whether it worked. I've tried it. It doesn't, and I wouldn't expect it to because there's no sdkmanager.jar anywhere in the android-sdk-macosx they give you.
Every tutorial on android I've found using Mac has come with ALOT more files than the current sdk you download from android does. I have two empty addon/platform directories and a tools directory with scripts in them. No jar files or anything else.
Please help!
today I fixed this :-) on Mac Lion (server):
1- open Terminal
2- Type cd ~ to go to your home directory ( you will be there by default)
3- Type touch .profile to create a hidden file named profile
4- Type open -e .profile this will open the file you created in TextEdit
5- In the file, type export PATH=${PATH}:FULL_PATH_WHERE_ANDROID_SDK/android-sdk-mac_86/platform-tools
FULL_PATH_WHERE_ANDROID_SDK: where is sdk, don't forget / before, so it will be i.e.
/users/mmm/sdk
6- save file
7- exit TextEdit
8- quit Terminal, and Relaunch Terminal
9- Now type again : adb devices if you get
>List of devices attached
So you did it successfully ..
Good luck
It should be Export PATH=/somedir/android-sdk/:$PATH. This will append the android-sdk dir to the beginning of path. The example you posted is not exporting any variable.

Categories

Resources