npx #react-native-community/cli doctor wrong JDK - react-native

When I run this command from my mac
npx #react-native-community/cli doctor
I get this funny unrecognized java version :
Common
✓ Node.js
✓ yarn
✓ Watchman - Used for watching changes in the filesystem when in development mode
Android
✖ JDK
Version found: 1.8.0_242-release
Version supported: >= 8
When I execute :
react-native info
I get :
info Fetching system and libraries information...
System:
OS: macOS 10.15.5
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU # 2.20GHz
Memory: 226.40 MB / 16.00 GB
Shell: 5.7.1 - /bin/zsh
Binaries:
Node: 12.18.2 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /Users/emmanuelharel/.gem/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 28, 30
Build Tools: 28.0.3, 29.0.2, 30.0.0
System Images: android-30 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242-release - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
#react-native-community/cli: Not Found
react: ~16.11.0 => 16.11.0
react-native: ~0.62.2 => 0.62.2
npmGlobalPackages:
*react-native*: Not Found
Has anyone an idea why react native cli is not able to get that java 1.8 and 8 are the "same"?

see https://github.com/react-native-community/cli/issues/1255
There is a pull request #1395 just in for this to fix it, so it might be accepted soon and make its way into a patch.

Related

> Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available

There was apparently a RN outage. This causes so much issues now as I can get a build out.
https://github.com/facebook/react-native/issues/35210
but that "FIX" says to look at https://github.com/facebook/react-native/issues/35210#:~:text=We%20have%20prepared%20releases%20for%20all%20the%20main%20versions%20of%20react%2Dnative%20with%20an%20hotfix%3A
The issue with that is there is no mention of 0.71.0-RC.0 version fix, I am on that version and when I try to run npx react-native run-android, I get the following:
> Could not find any matches for com.facebook.react:react-native:+ as no versions of com.facebook.react:react-native are available.
If someone came across this could you please mention how you solved this? I do not understand what the fix is for my situation specifically.
This is what the terminal spits out when I run react-native info:
System:
OS: macOS 13.0
CPU: (8) arm64 Apple M1
Memory: 129.47 MB / 8.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 16.14.2 - /usr/local/bin/node
Yarn: 1.22.19 - /opt/homebrew/bin/yarn
npm: 8.5.5 - /opt/homebrew/bin/npm
Watchman: 2022.09.05.00 - /opt/homebrew/bin/watchman
Managers:
CocoaPods: 1.11.3 - /opt/homebrew/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 16.0, macOS 12.3, tvOS 16.0, watchOS 9.0
Android SDK: Not Found
IDEs:
Android Studio: 2021.2 AI-212.5712.43.2112.8815526
Xcode: 14.0.1/14A400 - /usr/bin/xcodebuild
Languages:
Java: 11.0.16.1 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 18.2.0 => 18.2.0
react-native: 0.71.0-rc.0 => 0.71.0-rc.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
please let me know if I should add more information.
Just to be sure everyone gets this, yes #Grant Solomons got this right.
So if in your package.json file you have "react-native": "^0.70.0",, delete the ^ it to "react-native": "0.70.0",
Fixed by upgrading my RN version to one of the ones with the patches

React-Native Async Storage - Increasing Storage Size not working for Samsung Devices

Current behavior
I set up new storage size to 20MB using this guide. It works for Xiaomi, Oppo etc devices however not working on Samsung devices.
Row too big to fit into CursorWindow requiredPos=0, totalRows=1
I was getting this error before adding more spaces and it disappared after adding more spaces on my debug devices except Samsung.
Is there any hardware-based solutions for this?
Expected behavior
Works on Samsung devices too.
Repro steps
Use a data which contains data > 6MB
Add more spaces using the guide
Test Samsung and another device
Environment
Platforms tested:
[ x ] Android
[ ] iOS
[ ] macOS
[ ] Windows
AsyncStorage version: 1.13.2
Environment:
System:
OS: macOS 11.2.3
CPU: (12) x64 Intel(R) Core(TM) i7-8700B CPU # 3.20GHz
Memory: 77.17 MB / 8.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.0.1 - /usr/local/bin/node
Yarn: Not Found
npm: 7.0.3 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.2, DriverKit 20.0, macOS 11.0, tvOS 14.2, watchOS 7.1
Android SDK:
API Levels: 29, 30
Build Tools: 28.0.3, 29.0.2, 29.0.3, 30.0.2
System Images: android-29 | Intel x86 Atom_64, android-30 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.6858069
Xcode: 12.2/12B45b - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_272 - /usr/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
react-native: Not Found

Stock React Native app won't build on iOS (asdf?)

I'd like some help getting a stock app running following the official Getting Started.
I downloaded iOS simulator 14.3.
I run
npx react-native init nuproject
cd nuproject
npx react-native run-ios
I get
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
nvm is not compatible with the "PREFIX" environment variable: currently set to "/Users/me/.asdf/installs/nodejs/15.8.0/.npm"
Run `unset PREFIX` to unset it.
Command PhaseScriptExecution failed with a nonzero exit code
** BUILD FAILED **
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/me/Library/Developer/Xcode/DerivedData/nuproject-enujsutisqszfkeohcvaepmqnist/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-C635E97B268646534DBB9F9667109A6E.sh
(1 failure)
Here's my react-native env if it can help
$ npx react-native info
info Fetching system and libraries information...
System:
OS: macOS 11.2.3
CPU: (4) x64 Intel(R) Core(TM) i7-7660U CPU # 2.50GHz
Memory: 80.10 MB / 16.00 GB
Shell: 5.8 - /bin/zsh
Binaries:
Node: 15.8.0 - ~/.asdf/installs/nodejs/15.8.0/bin/node
Yarn: 1.22.10 - ~/.asdf/installs/nodejs/15.8.0/.npm/bin/yarn
npm: 7.5.1 - ~/.asdf/installs/nodejs/15.8.0/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.10.1 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 14.4, DriverKit 20.2, macOS 11.1, tvOS 14.3, watchOS 7.2
Android SDK:
API Levels: 29
Build Tools: 28.0.3, 29.0.2, 29.0.3
System Images: android-29 | Google APIs Intel x86 Atom, android-29 | Google Play Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.1 AI-201.8743.12.41.7199119
Xcode: 12.4/12D4e - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_242 - /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/bin/javac
npmPackages:
#react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.0 => 0.64.0
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
Turns out I hadn't fully removed nvm from my system.
rm -rf ~/.nvm
And that fixed it.
Seems kinda straightforward, that your solution might be to make sure the PREFIX variable is unset.
One alternative you have is to install Node via NVM rather than managing Node within ASDF environment. I use ASDF environment also but I dont use ASDF for python or node. For those, i manage the installs outside of ASDF.

React Native App crashes in older version Android (API 18)

My project suddenly crashing on my Android 4.4 emulator and show this error at the end of
react-native run-android command. Build was successfully build and it's installed in my emulator. But immediately it crashes and shows below error.
BUILD SUCCESSFUL in 21s
65 actionable tasks: 65 executed
info Connecting to the development server...
adb: error: closed
warn Failed to connect to development server using "adb reverse": Command failed: /Users/samsudeenfaslurajan/Library/Android/sdk/platform-tools/adb -s emulator-5554 reverse tcp:8081 tcp:8081
info Starting the app on "emulator-5554"...
Starting: Intent { cmp=com.royalvideoplayerlite/.MainActivity }
So I tried to open a new project using react-native init MYNEWPROJECT and tested again. Same crash happened again.
It's working fine with Android API Level 28
I can build APKs and install in any version of emulator. But Its working without crashing in API Level above 21 only.
I don't know what is the error.
info Fetching system and libraries information...
System:
OS: macOS 10.15.5
CPU: (4) x64 Intel(R) Core(TM) i5-7360U CPU # 2.30GHz
Memory: 76.48 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 12.18.1 - /usr/local/bin/node
Yarn: 1.22.4 - /usr/local/bin/yarn
npm: 6.14.5 - /usr/local/bin/npm
Watchman: 4.9.0 - /usr/local/bin/watchman
Managers:
CocoaPods: 1.9.3 - /usr/local/bin/pod
SDKs:
iOS SDK:
Platforms: iOS 13.5, DriverKit 19.0, macOS 10.15, tvOS 13.4, watchOS 6.2
Android SDK:
API Levels: 18, 19, 27, 28, 29, 30
Build Tools: 28.0.3, 29.0.2, 30.0.0
System Images: android-18 | Google APIs Intel x86 Atom, android-19 | Google APIs Intel x86 Atom, android-28 | Intel x86 Atom, android-28 | Google Play Intel x86 Atom, android-28 | Google Play Intel x86 Atom_64, android-29 | Google APIs Intel x86 Atom
Android NDK: Not Found
IDEs:
Android Studio: 4.0 AI-193.6911.18.40.6514223
Xcode: 11.5/11E608c - /usr/bin/xcodebuild
Languages:
Java: 1.8.0_252 - /usr/bin/javac
Python: 2.7.16 - /usr/bin/python
npmPackages:
#react-native-community/cli: Not Found
react: 16.13.1 => 16.13.1
react-native: 0.63.0 => 0.63.0
npmGlobalPackages:
*react-native*: Not Found

Print: Entry, ":CFBundleIdentifier", Does Not Exist Eero

Enviroment
React Native Environment Info:
System:
OS: macOS High Sierra 10.13.6
CPU: x64 Intel(R) Core(TM) i5-8259U CPU # 2.30GHz
Memory: 40.32 MB / 8.00 GB
Shell: 3.2.57 - /bin/sh
Binaries:
Node: 10.10.0
Yarn: 1.9.4
npm: 6.4.1
Watchman: 4.9.0
SDKs:
iOS SDK:
Platforms:
iOS 12.0, macOS 10.14, tvOS 12.0, watchOS 5.0
IDEs:
Android Studio: 3.1 AI-173.4907809
Xcode: 10.0/10A255 - /usr/bin/xcodebuild
npmPackages:
react: ^16.3.0 => 16.3.0
react-native: ^0.57.1 => 0.57.1
npmGlobalPackages:
create-react-native-app: 1.0.0
react-native-cli: 2.0.1
If i write:
sudo react-native run-ios
it says
03:43:31: Starting packager... 03:43:41: Starting simulator...
and its stucks here
and if i write firstly
Talha-MacBook-Pro:TusTTS talhasalt$ sudo react-native eject
then
sudo react-native run-ios
I think your xcode are running background on a project that can't be build successfully. Make sure you have opened error free project on xcode(the project can be anything). After doing that see the magic.I don't know why its happening but work for me.