Ok, I can set sdk.dir in local.properties and this works, but I don't want to do this in every single project I have to work with. Define location with an ANDROID_SDK_ROOT environment variable or by setting the sdk.dir path in your project's local properties file at '/xxx/android/local.properties'. If yours is not shown, get more details on the installing snapd documentation. Now, Here is what I get when running react-native run-android: FAILURE: Build failed with an exception.Ĭould not determine the dependencies of task ':app:installDebug'. Install Android SDK Manager on your Linux distribution Choose your Linux distribution to get detailed installation instructions. The first command will direct you to where the Android SDK and AVD Manager is located, and the second will execute said program. To do so, enter the following commands in a terminal. Yes | $ANDROID_HOME/tools/bin/sdkmanager -sdk_root=$ -licenses Now, in order to obtain the SDK platform tools, we'll need to initialize the Android SDK and AVD Manager that I mentioned earlier. Mv cmdline-tools/tools/* $ANDROID_HOME/tools/ Mv cmdline-tools/tools/bin/* $ANDROID_HOME/tools/bin/ # Merge bin with bin and tools with tools Unzip commandlinetools-linux-6609375_latest.zip -d cmdline-tools We now need to install the missing sdkManager: source ~/.bashrc This is snap version of console sdk manager for Android. This will add the environment variables: echo 'export ANDROID_HOME="/usr/lib/android-sdk"Įxport ANDROID_SDK_ROOT="/usr/lib/android-sdk" Go to File -> Settings -> Build, Execution, Deployment -> Build Tools -> Gradle. Here is how I installed my android sdk to run React Native on my Android phone:Ĭonsidering that Java and adb is already installed: sudo apt update & sudo apt install android-sdk The sdkmanager tool is provided in the Android SDK Command-Line Tools package.
0 Comments
Leave a Reply. |