cli icon indicating copy to clipboard operation
cli copied to clipboard

React Native Doctor is unable to detect the Android SDK in Windows 10

Open bogdanbaghiu opened this issue 1 year ago • 8 comments

Hello I tried to exec the npx react-native doctor and obtain that: image

I have installed the android-sk 33 and 34, but supported .b33.0.0. I need help please!!

The npx react-native info get that: image image

And I installed the latest version (11) from Android SDK Command-line Tools

React native project to test: https://github.com/bogdanbaghiu/test_image_colors

But the check of Android Sdk not pass :(

bogdanbaghiu avatar Dec 20 '23 12:12 bogdanbaghiu

Hey @bogdanbaghiu, that's because you're using expo in your project. So you should use Expo CLI to manage your Expo project, I also see react-native-windows inside your package.json, if you want to use out of tree platforms you should use prebuild, and use React Native Community CLI.

szymonrybczak avatar Dec 20 '23 15:12 szymonrybczak

@szymonrybczak Thanks for your answer! You were right that I had the added library in my package.json and after that I have made several changes to my package.json that I invite you to look at and try. I have made some progress but I will tell you what I have been discovering.

I Delete the node_modules, android folder and package-lock. I did an install npx expo install react-native-image-colors library, I already had it installed but I did it so that the yarn.lock file updates all the dependencies. Then I did an npm install that installed all the dependencies in my project. Next I launched the npx expo run:android command and it created an android build again. It launched successfully on my device. Finally I told myself that I am going to check if the npx react-native doctor command has solved my problem and apparently it still looked the same.

Then I realized that if I delete the android folder from my project I get the following: image

I have noticed that the npx expo run:android command generates the android build but for some reason it says that the Android SDK supported has to be .b33.0.0 and the ones I have installed are 33.0.0

Could you check if the same thing happens to you with my project but on your computer? If it doesn't happen to you, could you please try to guide me to know why it tells me that it needs an sdk with .b in front of 33.0.0?

bogdanbaghiu avatar Dec 22 '23 18:12 bogdanbaghiu

I'm having the same issue on Apple Silicon and I am NOT using expo. SDK is there but same doctor results.. Thoughts?

`npx react-native info

WARNING: You should run npx react-native@latest to ensure you're always using the most current version of the CLI. NPX has cached version (0.73.1) != current release (0.73.3)

info Fetching system and libraries information... System: OS: macOS 14.3 CPU: (10) arm64 Apple M1 Pro Memory: 2.34 GB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 19.4.0 path: ~/.nvm/versions/node/v19.4.0/bin/node Yarn: version: 1.22.19 path: /opt/homebrew/bin/yarn npm: version: 9.2.0 path: ~/.nvm/versions/node/v19.4.0/bin/npm Watchman: version: 2023.06.12.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: version: 1.14.3 path: /Users/km2t7x72tn/.rbenv/shims/pod SDKs: iOS SDK: Platforms: - DriverKit 23.2 - iOS 17.2 - macOS 14.2 - tvOS 17.2 - visionOS 1.0 - watchOS 10.2 Android SDK: Not Found IDEs: Android Studio: 2022.1 AI-221.6008.13.2211.9619390 Xcode: version: 15.2/15C500b path: /usr/bin/xcodebuild Languages: Java: version: 21.0.1 path: /usr/bin/javac Ruby: version: 2.7.6 path: /Users/km2t7x72tn/.rbenv/shims/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.73.1 wanted: 0.73.1 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: true newArchEnabled: false

info React Native v0.73.3 is now available (your project is running on v0.73.1). `

justdan0227 avatar Feb 01 '24 22:02 justdan0227

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 May 02 '24 03:05 github-actions[bot]

ign) $ npx react-native info info Fetching system and libraries information... System: OS: Windows 11 10.0.22631 CPU: (8) x64 Intel(R) Core(TM) i7-8650U CPU @ 1.90GHz Memory: 8.00 GB / 15.85 GB Binaries: Node: version: 20.10.0 path: C:\Program Files\nodejs\node.EXE Yarn: version: 1.22.19 path: ~\AppData\Roaming\npm\yarn.CMD npm: version: 10.4.0 path: C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: - "31" - "33" - "34" Build Tools: - 30.0.3 - 31.0.0 - 34.0.0 System Images: - android-30 | Google Play Intel x86 Atom - android-34 | Intel x86_64 Atom - android-34 | Google APIs Intel x86_64 Atom Android NDK: Not Found Windows SDK: Not Found IDEs: Android Studio: AI-232.10300.40.2321.11668458 Visual Studio: Not Found Languages: Java: javac 20 Ruby: Not Found npmPackages: "@react-native-community/cli": Not Found react: installed: 18.1.0 wanted: 18.1.0 react-native: installed: 0.74.1 wanted: ^0.74.1 react-native-windows: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: Not found newArchEnabled: Not found

RichyTech01 avatar May 02 '24 23:05 RichyTech01

Hi @bogdanbaghiu, did you ever figure out why you are seeing the .b in front of the version number? I'm using Expo, and upon running npx react-native doctor I also see that the version supported has a .b prefixed in front of the version number, but I don't know what it's meant to mean.

stuttskl avatar May 21 '24 17:05 stuttskl

+1

ertan95 avatar May 27 '24 19:05 ertan95

+1, on win11 wsl2 ubuntu latest PixPin_2024-05-29_22-16-16

MJRT avatar May 29 '24 14:05 MJRT

Any thoughts about this issue? are we the only ones with this problem? What is the other method that most of the other people follow?

coffey-dev avatar Jun 01 '24 14:06 coffey-dev

I'm having the same issue as OP

guayom avatar Jun 03 '24 17:06 guayom

Same issue

mpanac avatar Jun 05 '24 12:06 mpanac

Same issue

mcallegari1 avatar Jun 05 '24 18:06 mcallegari1

same issue :)

tedba742 avatar Jun 10 '24 14:06 tedba742

same issue

jruegoes avatar Jun 11 '24 15:06 jruegoes

same issue on macOS 14.5

mojjominion avatar Jun 12 '24 07:06 mojjominion

Looks like this code is looking for a digit or a . This has problems when build.gradle has content like this

buildscript {
    ext {
        buildToolsVersion = findProperty('android.buildToolsVersion') ?: '33.0.0'
    }
}

mojjominion avatar Jun 12 '24 17:06 mojjominion

Same issue.

image

joesingtecs avatar Jun 13 '24 06:06 joesingtecs

Same issue here

anonymze avatar Jun 14 '24 07:06 anonymze

Same issue for me too!!!!

if anybody knows how to fix this please help me

Android ✓ Adb - Required to verify if the android device is attached correctly ✓ JDK - Required to compile Java code ✓ Android Studio - Required for building and installing your app on Android ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation ✓ Gradlew - Build tool required for Android builds ✖ Android SDK - Required for building and installing your app on Android

  • Versions found: 34.0.0
  • Version supported: .b34.0.0

Environment:

System: OS: Windows 10 10.0.19043 CPU: (8) x64 Intel(R) Core(TM) i5-10210U CPU @ 1.60GHz Memory: 2.97 GB / 7.88 GB Binaries: Node: version: 20.12.2 path: C:\Program Files\nodejs\node.EXE Yarn: Not Found npm: version: 10.5.2 path: C:\Program Files\nodejs\npm.CMD Watchman: Not Found SDKs: Android SDK: API Levels: - "34" Build Tools: - 34.0.0 Android NDK: Not Found Windows SDK: AllowAllTrustedApps: Disabled Versions: - 10.0.16299.0 IDEs: Android Studio: AI-233.14808.21.2331.11709847 Visual Studio: - 16.10.31424.327 (Visual Studio Community 2019) Languages: Java: 17.0.11 Ruby: Not Found npmPackages: "@react-native-community/cli": Not Found react: installed: 18.2.0 wanted: 18.2.0 react-native: installed: 0.74.2 wanted: 0.74.2 react-native-windows: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: false iOS: hermesEnabled: Not found newArchEnabled: Not found

Anand14001 avatar Jun 14 '24 09:06 Anand14001

image

AchimDoe avatar Jun 22 '24 11:06 AchimDoe

hey all! if you're using expo inside your project e.g. Expo is generating android/ folder, you shouldn't use npx react-native doctor to check environment of your project, then you should use Expo tools to check project-related conditions.

If the issue is presented and you're using project bootstrapped with React Native Community CLI and not levering Expo tools please feel free to open new issue.

szymonrybczak avatar Jun 24 '24 19:06 szymonrybczak

If you have any issues like version supported .b34.0.0

Make sure you have Android NDK of 27.0.11902837 and also set that in your project; Like below:

buildscript { ext { ... kotlinVersion = findProperty('android.kotlinVersion') ?: '1.9.23'

    ndkVersion = "27.0.11902837"
}
...

}

iambigmarn avatar Jul 13 '24 08:07 iambigmarn

Same issue here :(

meysam7631 avatar Jul 22 '24 08:07 meysam7631

Mesmo problema aqui no macOS Sonoma 14.5

Update: Consegui resolver dessa forma:

buildscript {
    ext {
        // buildToolsVersion = findProperty('android.buildToolsVersion') ?: '34.0.0' (estava assim, e lia como .b34.0.0)
        buildToolsVersion = '34.0.0' (deixei dessa forma e funcionou)
           }
}

Provavelmente não é a maneira mais adequada. Mas foi a única forma que consegui resolver essa issue.

MariliseMorona avatar Jul 29 '24 01:07 MariliseMorona

same issus:

info Fetching system and libraries information... System: OS: macOS 13.4.1 CPU: (10) arm64 Apple M2 Pro Memory: 62.97 MB / 16.00 GB Shell: version: "5.9" path: /bin/zsh Binaries: Node: version: 20.10.0 path: ~/.nvm/versions/node/v20.10.0/bin/node Yarn: version: 1.23.0-20220130.1630 path: ~/.yarn/bin/yarn npm: version: 10.2.3 path: ~/.nvm/versions/node/v20.10.0/bin/npm Watchman: version: 2024.08.26.00 path: /opt/homebrew/bin/watchman Managers: CocoaPods: Not Found SDKs: iOS SDK: Not Found Android SDK: API Levels: - "27" - "28" - "29" - "30" - "31" - "32" - "33" - "34" - "35" Build Tools: - 27.0.3 - 28.0.3 - 29.0.2 - 29.0.3 - 30.0.0 - 30.0.2 - 30.0.3 - 33.0.0 - 33.0.1 - 33.0.2 - 34.0.0 System Images: - android-30 | Google APIs ARM 64 v8a - android-35 | Google Play ARM 64 v8a Android NDK: 22.1.7171670 IDEs: Android Studio: 2024.1 AI-241.18034.62.2412.12266719 Xcode: version: /undefined path: /usr/bin/xcodebuild Languages: Java: version: 17.0.12 path: /opt/homebrew/opt/openjdk@17/bin/javac Ruby: version: 2.6.10 path: /usr/bin/ruby npmPackages: "@react-native-community/cli": Not Found react: installed: 19.0.0-rc-fb9a90fa48-20240614 wanted: ^19.0.0-rc-fb9a90fa48-20240614 react-native: installed: 0.75.2 wanted: ^0.75.2 react-native-macos: Not Found npmGlobalPackages: "react-native": Not Found Android: hermesEnabled: true newArchEnabled: true iOS: hermesEnabled: Not found newArchEnabled: Not found

so when I run doctor:

npx react-native doctor ⠸ Running diagnostics...warn Command failed with exit code 1: ruby -e require "Bundler"; gemfile = Bundler::Definition.build("Gemfile", nil, {}); version = gemfile.ruby_version.engine_versions.join(", "); begin; gemfile.validate_runtime!; rescue Bundler::GemfileNotFound; puts "No Gemfile"; exit 1; rescue Bundler::RubyVersionMismatch; puts "Bundle invalid Ruby"; STDERR.puts version; exit 2; rescue => e; STDERR e.message; exit 3; else; puts "Ok"; STDERR.puts version; end /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/universal-darwin22/rbconfig.rb:21: warning: Insecure world writable dir /Users/blackjack/Desktop in PATH, mode 040777 /System/Library/Frameworks/Ruby.framework/Versions/2.6/usr/lib/ruby/2.6.0/bundler/definition.rb:32:in build': /Users/blackjack/Desktop/react_native/hybrid_demo/Gemfile not found (Bundler::GemfileNotFound) from -e:1:in

' Common ✓ Node.js - Required to execute JavaScript code ✓ yarn - Required to install NPM dependencies ✓ Watchman - Used for watching changes in the filesystem when in development mode ● Metro - Metro Bundler is not running

Android ✖ Adb - No devices and/or emulators connected. Please create emulator with Android Studio or connect Android device. ✓ JDK - Required to compile Java code ✓ Android Studio - Required for building and installing your app on Android ✓ ANDROID_HOME - Environment variable that points to your Android SDK installation ✓ Gradlew - Build tool required for Android builds ✖ Android SDK - Required for building and installing your app on Android

  • Versions found: 27.0.3, 28.0.3, 29.0.2, 29.0.3, 30.0.0, 30.0.2, 30.0.3, 33.0.0, 33.0.1, 33.0.2, 34.0.0
  • Version supported: Not Found

iOS ✖ Xcode - Required for building and installing your app on iOS

  • Version found: N/A
  • Version supported: >= 12.x ✓ Ruby ✖ CocoaPods - Required for installing iOS dependencies
  • Version found: N/A
  • Version supported: >= 1.10.0 ● ios-deploy - Required for installing your app on a physical device with the CLI ✓ .xcode.env - File to customize Xcode environment

Errors: 4 Warnings: 2

Usage › Press f to try to fix issues. › Press e to try to fix errors. › Press w to try to fix warnings. › Press Enter to exit.

BlackJackChenn avatar Sep 03 '24 11:09 BlackJackChenn

Running npx expo-doctor and fixing some of the warnings seems to have helped, for me :)

neoncube2 avatar Sep 13 '24 17:09 neoncube2