You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I struggled getting my app running on an android device (from macOS). Steps 1 und 2 worked well but when I ran the app I got the following problems:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
The .gitignore created by RN even contains local.properties.
The SDK package licenses have not been accepted.
I think both things should be at least mentioned1 in the docs as people running a (RN) app on android for the very first time will run into these problems - even if these problems aren't directly caused be RN.
1 I provided some links in the script below.
Here is my final (homebrew-based) script for preparing everything for running my app on android. If such details are welcome in the docs (I've read the guidelines but am not sure if this is a bit to much/specific), some parts of the script could be written down more human-friendly I guess.
#!/usr/bin/env bash
which brew > /dev/null
# install Homebrew if not yet installedif [[ "$?"=="1" ]];thenecho"Installing homebrew."
/usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"fiecho"Installing android-platform-tools."
brew cask install android-platform-tools
echo"Installing android-sdk."
brew cask install android-sdk
which java > /dev/null
# install java 8 (required for android-sdk)if [[ "$?"=="1" ]];thenecho"Installing Java 8."
brew cask install caskroom/versions/java8
else
is_java8=$(java -version 2>&1| grep 'java version "1.8')if [[ "$is_java8"!="" ]];thenecho"Yeah, you have the right Java version installed!"elseecho"You seem to have Java installed but you need version 8 for the android SDK."echo"Check out https://stackoverflow.com/a/29195815/6928824 for more information on managing multiple Java versions."fifi# See https://stackoverflow.com/questions/35141951/
props_file=./android/local.properties
touch "$props_file"if grep --quiet 'sdk.dir'"$props_file";thenecho"'$props_file' already contains a property 'sdk.dir'."echo"You should set the following its value as shown below: sdk.dir=/usr/local/share/android-sdk"elseecho"Setting SDK path."echo"sdk.dir=/usr/local/share/android-sdk">>"$props_file"fi# This file should exist to avoid a warning. See https://stackoverflow.com/a/38641430/6928824
repo_file=~/.android/repositories.cfg
if [ !-f"$repo_file" ];thenecho"Creating '$repo_file'."echo"### User Sources for Android SDK Manager count=0">"$repo_file"elseecho"No need to create $repo_file. It already exists."fi# Accept all licenses. See https://stackoverflow.com/q/38096225/6928824echo"Accepting licenses."
yes | sdkmanager --licenses #--sdk_root=$ANDROID_SDK_PATH
👋 Hey there, it looks like there has been no activity on this issue recently. Has the issue been fixed, or does it still require the community's attention? This issue may be closed if no further activity occurs. Thank you for your contributions.
stalebot
added
the
Stale
Issues/PR that are not getting much activity and are closer to be closed
label
Aug 16, 2020
Closing this issue after a prolonged period of inactivity. If this issue is still present in the latest release, please feel free to create a new issue with up-to-date information.
Hi,
I struggled getting my app running on an android device (from macOS). Steps 1 und 2 worked well but when I ran the app I got the following problems:
SDK location not found. Define location with sdk.dir in the local.properties file or with an ANDROID_HOME environment variable.
The
.gitignore
created by RN even containslocal.properties
.I think both things should be at least mentioned1 in the docs as people running a (RN) app on android for the very first time will run into these problems - even if these problems aren't directly caused be RN.
1 I provided some links in the script below.
Here is my final (homebrew-based) script for preparing everything for running my app on android. If such details are welcome in the docs (I've read the guidelines but am not sure if this is a bit to much/specific), some parts of the script could be written down more human-friendly I guess.
I find this issue is somewhat related to #370.
The text was updated successfully, but these errors were encountered: