CLI fails to initialize a new project
What's going on?
The CLI fails to initialize a new project, it stops while installing pods and throws the following error
[!] Invalid `Podfile` file: cannot load such file -- /Users/darkystel/Desktop/projects/PokemonApp/node_modules/react-native/scripts/react_native_pods
CocoaPodsError: The command `pod install` failed
└─ Cause: Error: pod exited with non-zero code: 1
at CocoaPodsPackageManager._installAsync (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:85286)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async CocoaPodsPackageManager.installAsync (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84649)
at async runAsync (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:109680)
at async /Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:109766 {
code: 'COMMAND_FAILED',
cause: Error: pod exited with non-zero code: 1
at ChildProcess.h (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:1073)
at Object.onceWrapper (node:events:476:26)
at ChildProcess.emit (node:events:369:20)
at maybeClose (node:internal/child_process:1067:16)
at Process.ChildProcess._handle.onexit (node:internal/child_process:301:5)
...
at Object.spawnAsync [as default] (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:558)
at CocoaPodsPackageManager._runAsync (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:86068)
at CocoaPodsPackageManager._installAsync (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84933)
at CocoaPodsPackageManager.installAsync (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:84660)
at runAsync (/Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:109688)
at processTicksAndRejections (node:internal/process/task_queues:94:5)
at async /Users/darkystel/.npm/_npx/7cf525d1e16b4e35/node_modules/pod-install/build/index.js:2:109766 {
pid: 12514,
output: [ '', '' ],
stdout: '',
stderr: '',
status: 1,
signal: null
},
isPackageManagerError: true
}
Steps to reproduce
- Running
npx ignite-cli new AppName
ignite doctor results:
System
platform darwin
arch x64
cpu 8 cores Intel(R) Core(TM) i5-1038NG7 CPU @ 2.00GHz
directory projects /Users/darkystel/Desktop/projects
JavaScript (and globally-installed packages)
node 15.12.0 /Users/darkystel/.nvm/versions/node/v15.12.0/bin/node
npm 7.6.3 /Users/darkystel/.nvm/versions/node/v15.12.0/bin/npm
npm 7.6.3
yarn - not installed
Ignite
ignite-cli 6.6.0 /Users/darkystel/.npm/_npx/e31027f3785124a8/node_modules/.bin/ignite
ignite src build /Users/darkystel/.npm/_npx/e31027f3785124a8/node_modules/ignite-cli/build
Android
java 1.8.0_282 /usr/bin/java
android home - /Users/darkystel/Library/Android/sdk
iOS
xcode 12.4
cocoapods 1.10.1 /usr/local/bin/pod
Hi.
Try react native doctor:
npx @react-native-community/cli doctor
This worked for me https://github.com/infinitered/ignite/issues/1639#issuecomment-810618577
Hi. Try react native doctor:
npx @react-native-community/cli doctor
I did, found some missing dependencies and fixed almost all errors, I still get this one error with Android SDK tho
✖ Android SDK - Required for building and installing your app on Android
- Versions found: 29.0.2
- Version supported: Not Found
This is the version I found on the guide that is supported by react native Nonetheless, I ran the initialization again and it gave the same error
This worked for me #1639 (comment)
This worked for initialization, running the app on either android or iOS does not work though? On android:
* Where:
Settings file '/Users/darkystel/Desktop/projects/PokemonApp/android/settings.gradle'
* What went wrong:
Could not compile settings file '/Users/darkystel/Desktop/projects/PokemonApp/android/settings.gradle'.
> startup failed:
General error during semantic analysis: Unsupported class file major version 60
On iOS:
error Failed to build iOS project. We ran "xcodebuild" command but it exited with error code 65. To debug build logs further, consider building your app with Xcode.app, by opening PokemonApp.xcworkspace. Run CLI with --verbose flag for more details.
Command line invocation:
/Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -workspace PokemonApp.xcworkspace -configuration Debug -scheme PokemonApp -destination id=3FAAF10E-7771-4F53-8E1A-29D94E4D76A8
note: Using new build system
note: Building targets in parallel
note: Planning build
note: Using build description from disk
warning: The iOS Simulator deployment target 'IPHONEOS_DEPLOYMENT_TARGET' is set to 8.0, but the range of supported deployment target versions is 9.0 to 14.4.99. (in target 'Flipper' from project 'Pods')
Apparently, forcing pods to use the latest version of Flipper (0.84) solved the issue for me, as for Android all I had to do was run it from Android Studio