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

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

Related

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.

couldn't initiate a new react-native app because iOS environment is not properly set

first time Mac user trying to start a new react-native application. After doing this:
npx react-native init project_adji --template react-native-template-typescript
it fails with the following message:
✔ 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.
I updated the ruby via rbenv to the required version to reach this point (ruby 2.7.5). I couldn't find the exact issue with my setup.
Any tips?
I had exact the same issue here. After some research, I solved by following these steps:
gem uninstall cocoapods
sudo xcodebuild -license accept
Then created a test project to see where if everything works fine by following:
npx react-native init tempProject --skip-install
cd tempProject
yarn install
cd ios
bundle install
bundle exec pod install

Why is Expo iOS build failing? ...something with ExpoModulesCore

Hey guys so I have an expo managed app and I want to use a notification library called Notifee which has an expo plugin. This plugin adds native code not supported by Expo Go, so I'm forced to enter bare workflow and build native iOS and Android folders.
I'm building the iOS package by running expo run:ios. And build fails due to something with ExpoModulesCore:
The following build commands failed:
CompileSwiftSources normal arm64 com.apple.xcode.tools.swift.compiler (in target 'ExpoModulesCore' from project
'Pods')
So I did some research and found that others had the same issue here on Stackoverflow. I tried altering the pod file and updating ExpoModulesCore
pod update ExpoModulesCore as this answer suggests
https://stackoverflow.com/a/71104305/8561357
After updating ExpoModulesCore and re-building, I get an additional error:
The following build commands failed:
PhaseScriptExecution [CP-User]\ Generate\ Specs /Users/kevin/Library/Developer/Xcode/DerivedData/Addressbook-gmgtddiltntfosevknuexadcwkpt/Build/Intermediates.noindex/Pods.build/Debug-iphonesimulator/FBReactNativeSpec.build/Script-BC35D93E0A296DC41D8D893483CBC12F.sh (in target 'FBReactNativeSpec' from project 'Pods')
CompileSwiftSources normal x86_64 com.apple.xcode.tools.swift.compiler (in target 'ExpoModulesCore' from project 'Pods')
(2 failures)
So why does this happen?
I saw something about Xcode version 13 not working, only 12??
Is Expo version incompatible?
Really trying to figure out what's going on here
maybe its was to late.
if you using react native 0.64.4, add or change expo-module-core version to ^0.6.5 on your package.json.
delete node_modules folder and yarn.lock (if you using yarn)
reinstall node_modules using yarn yarn install
sync node_modules with pod using pod deintegrate and then pod install on ios folder.
install expo modules using npx install-expo-modules from root project.
then build ios using yarn run ios
maybe you need to see similar issue on here:
http://bataxdev.com/blogs/detail/unable-to-find-a-spesification-for-expomodulescore

react-native-camera: sdk manager plateforms-tools 28.0.1 can't be installed

I'm trying to install react-native-camera. I'm on Ubuntu 18, Webstorm for IDE. Targeting Android.
For the Android SDK, I don't have a full Android Studio install. I've instead install only android-sdk and I'm using the sdkmanager. That works fine with my stub app, it compile and runs on Android with
react-native run-android
I've installed react-native-camera as a module with npm as per the indications:
npm install react-native-camera --save
react-native link react-native-camera
So far so good. It links. If I try to launch the app however (even before trying to actually use the camera), I get some warnings:
> Configure project :react-native-camera
Checking the license for package Android SDK Platform-Tools in /usr/lib/android-sdk/licenses
License for package Android SDK Platform-Tools accepted.
Preparing "Install Android SDK Platform-Tools (revision: 28.0.1)".
Warning: Failed to read or create install properties file.
WARNING: platform-tools package is not installed, and automatic installation failed.
So I've tried to install the platforms tools using the sdk manager & instructions provided here:
sdkmanager "platform-tools" "platforms;android-28"
Which yields:
Warning: Failed to read or create install properties file.
So I am guessing it really has to do with the sdkmanager...
Do I absolutely need 28.0.1 for react-native-camera? If so, how can I get around this issue with the SDK manager? I've tried various similar syntax for the install of the platform and it didn't work. I checked with sdkmanager --list that it's the proper name (seems to be). And if I go under android-sdk/platforms-tools all I see there is the adb file (or perhaps the install is supposed to just update that file?)
Silly me.
I needed to run the SDK manager as sudo. To do that:
sudo bash sdkmanager [installations args as per post above].
I will leave the post - I lost a ridiculous amount of time for that, hopefully it can help others....
And yes - if the platform-tools install has worked then under /platform-tools you should see a bunch of files, not just the adb one.

Getting error while creating a new Project

I'm new to reactnative. I have followed steps to install reactnative properly but, while creating a new project, I'm getting an error. I'm using Windows 7 64 bit with i3 processor.
c:\ReactNativeProjects>react-native init AwesomeProject
Command npm install --save --save-exact react-native failed.
My Folder contains only one file
Since you are starting to use React Native, consider using Expo, I've used it and it makes developing, debugging, testing and deploying to the apple store and google play easier.
According to the official docs:
Expo is the easiest way to start building a new React Native
application. It allows you to start a project without installing or
configuring any tools to build native code - no Xcode or Android
Studio installation required (see Caveats).
Assuming that you have Node installed, you can use npm to install the
Expo CLI command line utility:
npm install -g expo-cli
Then run the following commands to create a
new React Native project called "AwesomeProject":
expo init AwesomeProject
cd AwesomeProject
npm start
This will start a development server for
you.
I've answered a question in SO for the steps and what happens when you build your .apk and .ipa files using Expo, have a look at that as well.
These are my steps to get rid of this error:
Please upgrade your npm
npm install -g npm#latest
Run npm cache clean command in Command prompt ( With some element of doubt for cache presence)
3.Ran react-native init in command prompt as Administrator (on Windows OS), hoping works well with sudo react-native init on Mac OS
If still problem persist make sure that you have followed each and every step mentioned in Documentation i.e. installed JDK, PYTHON, NODE.
Refer to this link For windows