Expo - React Native: How do I upgrade the Android Gradle. I am receicing an error mentioning: - react-native

Expo - React Native: How do I upgrade the Android Gradle. I am receicing an error mentioning: requires libraries and applications that [stderr] depend on it to compile against version 32 or later of the [stderr] Android APIs.
I have tried
removing node modules
removing package.json
reinstalling all dependencies
ran depcheck
ran expo doctor debugger
I have linked my build logs here

Related

Error with CocoaPods dependencies (Multiple Podfiles were found) while setting up react react native CLI environment on MacOS M1

After I create a new project using the below code in terminal
niteshrastogi#Niteshs-MacBook-Air ~ % npx react-native init AwesomeProject1
Takes a lot of time on Installing Cocoapods dependencies step and returns an error. See this Error
✔ Downloading template
✔ Copying template
✔ Processing template
✔ Installing Bundler
✖ Installing CocoaPods dependencies (this may take a few minutes)
error warn Multiple Podfiles were found: ios/Podfile,vendor/bundle/ruby/2.7.0/gems/cocoapods-core-1.11.3/lib/cocoapods-core/Podfile. Choosing ios/Podfile automatically. If you would like to select a different one, you can configure it via "project.ios.sourceDir". You can learn more about it here: https://github.com/react-native-community/cli/blob/master/docs/configuration.md
✖ Installing CocoaPods dependencies (this may take a few minutes)
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
at createFromTemplate (/Users/niteshrastogi/.npm/_npx/7930a8670f922cdb/node_modules/#react-native-community/cli/build/commands/init/init.js:129:11)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async Object.initialize [as func] (/Users/niteshrastogi/.npm/_npx/7930a8670f922cdb/node_modules/#react-native-community/cli/build/commands/init/init.js:181:3)
at async Command.handleAction (/Users/niteshrastogi/.npm/_npx/7930a8670f922cdb/node_modules/#react-native-community/cli/build/index.js:106:9)
I am new to development and trying to setup a development environment for the first time. Any help with this would be helpful.
Followed all the steps mentioned here to set up react native CLI and create my first project.
System config: M1 Ventura 13.2 macos watchman version: 2023.02.06.00 homebrew version: Homebrew 3.6.21 node: v19.6.0
Also installed Xcode with the latest version and selected the latest command line tool location.
enter image description here

I got a problem installing bundler when trying create my new react native project am using Mac OS high sierra

and this was my terminal output
✔ Downloading template
✔ Copying template
✔ Processing template
✖ Installing Bundler
error
✖ Installing Bundler
error Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
Error: Error: Looks like your iOS environment is not properly set. Please go to https://reactnative.dev/docs/next/environment-setup and follow the React Native CLI QuickStart guide for macOS and iOS.
at createFromTemplate (/Users/techero/.npm/_npx/1164/lib/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/init/init.js:169:11)
at runMicrotasks (<anonymous>)
at processTicksAndRejections (internal/process/task_queues.js:95:5)
at async Object.initialize [as func] (/Users/techero/.npm/_npx/1164/lib/node_modules/react-native/node_modules/#react-native-community/cli/build/commands/init/init.js:222:3)
at async Command.handleAction (/Users/techero/.npm/_npx/1164/lib/node_modules/react-native/node_modules/#react-native-community/cli/build/index.js:140:9).
please help me fixing this bug ..I have walking around trying different option but no result
I run npx react-native init myapp and also I have run react native doctor and this was the result..please I need help fixing this bug....
Techeros-MacBook-Pro:myapp techero$ npx react-native doctor
Common
✓ Node.js
✓ npm
● Watchman - Used for watching changes in the filesystem when in development mode
Android
✓ JDK
✓ Android Studio - Required for building and installing your app on Android
✓ Android SDK - Required for building and installing your app on Android
✓ ANDROID_HOME
iOS
✖ Xcode - Required for building and installing your app on iOS
- Version found: N/A
- Version supported: >= 12.x
✓ CocoaPods - Required for installing iOS dependencies
● ios-deploy - Required for installing your app on a physical device with the CLI
✓ .xcode.env - File to customize Xcode environment
Errors: 1
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.
type here
From your error:
✖ Xcode - Required for building and installing your app on iOS
- Version found: N/A
- Version supported: >= 12.x
You need to install Xcode 12 or higher and build-tools for this version.

Can't install expo modules on react-native-cli project

I have a react native project made with react-native-cli. To add expo modules, I did npx install-expo-modules which makes changes to MainActivity.java, MainApplication.java, and settings.gradle according to their official document. After that, I kept getting
Execution failed for task ':app:compileDebugJavaWithJavac'
specifically
package expo.modules does not exist
and
error: cannot find symbol.

gradle upgrade on react native

Ever since I upgraded my Gradle component in Android Studio I cannot compile my React Native app.
Here is the error message:
error React Native CLI uses autolinking for native dependencies, but the following modules are
linked manually:
- react-native-gesture-handler (to unlink run: "react-native unlink react-native-gesture-handler")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going
forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be
included in your app automatically. If a library isn't compatible with autolinking, disregard this
message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-
community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier"
flag.
Jetifier found 919 file(s) to forward-jetify. Using 4 workers...
info JS server already running.
info Installing the app...
> Task :app:mergeDebugResources FAILED
[integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error: Duplicate
resources
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error:
Duplicate resources
Deprecated Gradle features were used in this build, making it incompatible with Gradle 6.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/5.4.1/userguide/command_line_interface.html#sec:command_line_warnings
18 actionable tasks: 1 executed, 17 up-to-date
FAILURE: Build failed with an exception.
* What went wrong:
Execution failed for task ':app:mergeDebugResources'.
> [integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_dev_server_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error: Duplicate
resources
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\generated.xml
[integer/react_native_inspector_proxy_port] C:\projects\react-native-sample-with-
redux\android\app\build\generated\res\resValues\debug\values\gradleResValues.xml: Error: Duplicate
resources
How do you upgrade the Gradle setting in your app so it will fit the new Gradle features?
Thanks in advance
Kobi
React-native version > 0.6, some dependencies will autolinking, we do not need to use react-native link dependenices, but some are not compatible with autolinking, like this:
error React Native CLI uses autolinking for native dependencies, but the following modules are linked manually:
- react-native-vector-icons (to unlink run: "react-native unlink react-native-vector-icons")
This is likely happening when upgrading React Native from below 0.60 to 0.60 or above. Going forward, you can unlink this dependency via "react-native unlink <dependency>" and it will be included in your app automatically. If a library isn't compatible with autolinking, disregard this message and notify the library maintainers.
Read more about autolinking: https://github.com/react-native-community/cli/blob/master/docs/autolinking.md
info Running jetifier to migrate libraries to AndroidX. You can disable it using "--no-jetifier" flag.
Until now, the best way to resolve this is back you react-native version below 0.6 and reinstall.

react native fbsdk MODULE_NOT_FOUND after link commend

I searched for this error on the git repo and online but I didn't find anything what brings me to here. React native is totally new for me so if I missed something stupid, my apologize.
I'm trying to install & link react-native-fbsdk in my react-native project: https://github.com/facebook/react-native-fbsdk
I went through these steps:
react-native init [YourApp]
Result: done, project created
react-native install react-native-fbsdk
Output: Scanning 712 folders for symlinks in C:\wamp\www\chatapp\node_modules (26ms)
rnpm-install info Module react-native-fbsdk has been successfully installed & linked
react-native link react-native-fbsdk
Output: Scanning 712 folders for symlinks in C:\wamp\www\chatapp\node_modules (29ms)
{ [Error: Cannot find module 'C:\wamp\www\chatapp\node_modules\react-native-fbsdk\package.json'] code: 'MODULE_NOT_FOUND' }
Print screen:
Of course when I try to build my app with react-native run-android I got this:
...
:app:processDebugResources
:app:generateDebugSources
:app:processDebugJavaRes UP-TO-DATE
:app:compileDebugJavaWithJavac
C:\wamp\www\chatapp\android\app\src\main\java\com\chatapp\MainApplication.java:16: error: cannot find symbol
import com.facebook.FacebookSdk;
...
More Info:
React native version: 0.42.3
npm -version 4.2.0
I didn't find "react-native-fbsdk" folder under
my node_modules folder.
Windows 8.1
I'm working with Android Studio
Android SDK Platform-Tools 25.0.4
Android SDK Tools 25.2.3
Thank you in advance.
Leo.
EDIT + UPDATE: Added react-native tag. Facebook team investigated this and it looks like an issue with React Native itself.
https://developers.facebook.com/bugs/1889723254644374
After few days with the community I found the problem!
This line is not valid commend for react native!
react-native install react-native-fbsdk
Instead we need to write:
npm i -S react-native-fbsdk
and then
react-native link react-native-fbsdk