cli icon indicating copy to clipboard operation
cli copied to clipboard

Doctor doesn't identify Android SDK from local.properties

Open jonasb opened this issue 4 years ago • 3 comments

Environment

System:
    OS: macOS Mojave 10.14.6
    CPU: (4) x64 Intel(R) Core(TM) i7-5557U CPU @ 3.10GHz
    Memory: 47.30 MB / 16.00 GB
    Shell: 5.3 - /bin/zsh
  Binaries:
    Node: 10.16.3 - ~/.nvm/versions/node/v10.16.3/bin/node
    Yarn: 1.17.0 - /usr/local/bin/yarn
    npm: 6.9.0 - ~/.nvm/versions/node/v10.16.3/bin/npm
    Watchman: 4.9.0 - /usr/local/bin/watchman
  SDKs:
    iOS SDK:
      Platforms: iOS 13.1, DriverKit 19.0, macOS 10.15, tvOS 13.0, watchOS 6.0
  IDEs:
    Android Studio: 3.5 AI-191.8026.42.35.5900203
    Xcode: 11.1/11A1027 - /usr/bin/xcodebuild
  npmPackages:
    react: 16.9.0 => 16.9.0
    react-native: 0.61.4 => 0.61.4

Description

When running npx @react-native-community/cli doctor it doesn't identify my Android SDK. I'm not setting ANDROID_HOME, instead I have a file (android/local.properties) which includes the path to the sdk (sdk.dir=/Users/jonasb/Library/Android/sdk). In my experience ANDROID_HOME and local.properties work equally well to point out the SDK for various Android tools (including React Native).

Reproducible Demo

Unset ANDROID_HOME, create an android/local.properties file.

jonasb avatar Nov 20 '19 08:11 jonasb

Sounds like we should extend the built-in check to go and check this file (if present) as well, because of the precedence?

grabbou avatar Nov 24 '19 19:11 grabbou

I opened the issue tabrindle/envinfo#137 as this problem can be solved there, if all goes well I'll open a PR there to get this issue fixed.

We are currently not using envinfo for the Android SDK check for the reason indicated here but we can easily switch to it.

lucasbento avatar Nov 27 '19 14:11 lucasbento

Update: using the plugins manager of the Android Studio I made sure I had the correct version of the Android SDK Build tool installed at Appearance & Behavior -> System Settings -> Android SDK: SDK Tools tab (make sure the Show Package Details box is checked).

Then on the same screen I also installed the latest version of the Android SDK Command-line Tools

Then on the same screen I installed the Android SDK Platform-Tools.

After that the doctor and "react-native info" saw my Android SDK install

pthornhi avatar Jul 19 '22 07:07 pthornhi

There hasn't been any activity on this issue in the past 3 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 7 days.

github-actions[bot] avatar Nov 29 '22 03:11 github-actions[bot]