7

I'm planning to develop Cordova app, so i was finishing my development environment. I successfully installed android-sdk and evrything finally i need install platform tools and build tools for start developing my app. I'm doing everything in my CLI. I tried to install build-tools like this :

sdkmanager "build-tools;29.0.3"

I'm getting the error like :

Warning: Failed to read or create install properties file.                      

When i researched for 2 hours and everyone saying the permission of android-sdk directory. When i run this command :

ls -l mkdir /usr/lib/

I can see my android-sdk directory permission is :

drwxrwxrwx  12 root root   4096 أكت 21 17:03 android-sdk

My configurationn (~/.bashrc)

export ANDROID_SDK_ROOT="/usr/lib/android-sdk"
export JAVA_HOME="/usr/lib/jvm/java-8-openjdk-amd64/jre"
export PATH="$JAVA_HOME/bin:$ANDROID_SDK_ROOT/cmdline-tools/tools/bin:$ANDROID_SDK_ROOT/platform-tools:$PATH"

I'm using Ubuntu OS 20.04 version. I tried to install platform-tools with the command sdkmanager but that's got worked success but i'm unable to install build-tools. Anybody have any idea to resolve this issue ?

Thanks

Sarath C
  • 187
  • 2
  • 10
  • I think you need to set an environment variable `ANDROID_SDK_ROOT` that points to a location in the user's home directory. See [this](https://stackoverflow.com/questions/23042638/how-do-i-set-android-sdk-home-environment-variable). – ashu Oct 21 '20 at 13:44
  • yes. i already updated it in my ~/.bashrc file. i updated question with that file. i can see when i run sdkmanager --version it outputs my version 4.0.1 – Sarath C Oct 21 '20 at 14:02
  • Try `export ANDROID_SDK_ROOT="$HOME/android-sdk"` instead of what you have now. – ashu Oct 21 '20 at 18:14
  • Yes i moved to $HOME and also tried but still sam problem. – Sarath C Oct 22 '20 at 04:19

1 Answers1

7

According this

drwxrwxrwx 12 root root 4096 أكت 21 17:03 android-sdk

your Android SDK was installed under the root user, so you have to install platform tools like

sudo /opt/android-sdk/cmdline-tools/tools/bin/sdkmanager "system-images;android-29;google_apis;x86_64"