I spent like 3-4 days trying to figure this out and I cant a solution to it. i googled around and can't find answer.
What happened was everytime I create a new file I get this error.
I used react-native init ProjectName. npm install. cd ios. pod install. cd ..
then react-native run-ios and this is what I get.
asdf#Asdf-MacBook-Pro ProjectName % react-native run-ios
info Found Xcode workspace "ProjectName.xcworkspace"
info Building (using "xcodebuild -workspace ProjectName.xcworkspace -configuration Debug -scheme ProjectName -destination id=3A1A98EB-1D97-4DC2-967F-565F3971D608")
(node:16102) Warning: Accessing non-existent property 'padLevels' of module exports inside circular dependency
(Use `node --trace-warnings ...` to show where the warning was created)
node --trace-warnings ...
node:internal/modules/cjs/loader:959
throw err;
^
Error: Cannot find module '/Users/asdf/Desktop/starter/ProjectName/...'
at Function.Module._resolveFilename (node:internal/modules/cjs/loader:956:15)
at Function.Module._load (node:internal/modules/cjs/loader:804:27)
at Function.executeUserEntryPoint [as runMain] (node:internal/modules/run_main:81:12)
at node:internal/main/run_main_module:17:47 {
code: 'MODULE_NOT_FOUND',
requireStack: []
}
Things I already did
I deleted node_modules and package-lock.json and npm install again.
npm install -g react-native-cli && npm install -g react-native before npm install
upgrade node, nvm, npm
downgrade node, nvm, npm
current version
node v16.17.0
nvm 0.39.1
npm 7.24.2
first apply what you see in the picture via xcode ,you need try this and try yarn ios, and u can try in terminal on your project/ios. arch -arm64 pod install
Related
I am setting up IOS dev for React Native (0.61) app which has the working android version. What I did was to copy src of components and package.json file after react native environment is setup by following online post (installed xcode command line tool 10.2). But launching run-ios failed:
$ react-native run-ios
error Could not find "Podfile.lock" at /Users/mine/Documents/code/js/emps_fe6/ios/Podfile.lock. Did you run "pod install" in iOS directory?
error Could not find the following native modules: RNCAsyncStorage, RNDeviceInfo, RNGestureHandler, RNKeychain, BVLinearGradient, RNLocalize, RNReanimated, RNVectorIcons, react-native-video. Did you forget to run "pod install" ?
info Found Xcode project "emps_fe6.xcodeproj"
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
error Could not parse the simulator list output. Run CLI with --verbose flag for more details.
Error: Command failed: xcrun simctl list --json devices
xcrun: error: unable to find utility "simctl", not a developer tool or in PATH
at checkExecSyncError (child_process.js:629:11)
at Object.execFileSync (child_process.js:647:13)
at runOnSimulator (/Usersamine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:130:54)
at Object.runIOS [as func] (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:100:12)
at Command.handleAction (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:164:23)
at Command.listener (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:315:8)
at Command.emit (events.js:198:13)
at Command.parseArgs (/Users/amine/Documents/code/js/emps_fe6/node_modules/commander/index.js:651:12)
at Command.parse (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:474:21)
at setupAndRun (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:237:24)
Here is the output of react native info:
$ react-native info
info Fetching system and libraries information...
System:
OS: macOS High Sierra 10.13.6
CPU: (8) x64 Intel(R) Core(TM) i7-2675QM CPU # 2.20GHz
Memory: 194.93 MB / 8.00 GB
Shell: 3.2.57 - /bin/bash
Binaries:
Node: 10.17.0 - /usr/local/bin/node
Yarn: 1.19.1 - /usr/local/bin/yarn
npm: 6.11.3 - /usr/local/bin/npm
IDEs:
Xcode: /undefined - /usr/bin/xcodebuild
npmPackages:
react: 16.11.0 => 16.11.0
react-native: 0.61.2 => 0.61.2
npmGlobalPackages:
react-native-cli: 2.0.1
Here is the package.json:
"dependencies": {
"#react-native-community/async-storage": "^1.6.2",
"moment": "^2.24.0",
"react": "16.11.0",
"react-native": "0.61.2",
"react-native-cli": "^2.0.1",
"react-native-confirmation-code-field": "^4.1.0",
"react-native-device-info": "^4.0.1",
"react-native-elements": "^1.2.6",
"react-native-gesture-handler": "^1.4.1",
"react-native-gifted-chat": "^0.11.3",
"react-native-keychain": "^4.0.1",
"react-native-linear-gradient": "^2.5.6",
"react-native-localize": "^1.3.1",
"react-native-modal": "^11.4.0",
"react-native-modal-datetime-picker": "^7.6.0",
"react-native-reanimated": "^1.3.0",
"react-native-segmented-control-tab": "^3.4.1",
"react-native-vector-icons": "^6.6.0",
"react-native-video": "^5.0.2",
"react-navigation": "^4.0.10",
"react-navigation-stack": "^1.10.2",
"react-navigation-tabs": "^2.5.6",
"simctl": "^2.0.0",
"socket.io-client": "2.1.1",
"xcode": "^2.0.0"
},
In the error message, there mentioned quite a few modules which are missing. But those modules have been installed as it shows in the package.json. I am not sure about what the error message means. Also I installed the simctl but scrum simctl still can not find it. I am using VS Code as IDE.
UPDATE:
created an empty Podfile.lock under /ios, the error becomes when run-ios:
error Cannot read property 'SPEC CHECKSUMS' of undefined. Run CLI with --verbose flag for more details.
TypeError: Cannot read property 'SPEC CHECKSUMS' of undefined
at getDependenciesFromPodfileLock (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/link-pods/getDependenciesFromPodfileLock.js:63:58)
at warnAboutPodInstall (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/link/warnAboutPodInstall.js:43:67)
at Object.runIOS [as func] (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli-platform-ios/build/commands/runIOS/index.js:80:36)
at Command.handleAction (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:164:23)
at Command.listener (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:315:8)
at Command.emit (events.js:198:13)
at Command.parseArgs (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:651:12)
at Command.parse (/Users/mine/Documents/code/js/emps_fe6/node_modules/commander/index.js:474:21)
at setupAndRun (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:237:24)
at Object.run (/Users/mine/Documents/code/js/emps_fe6/node_modules/#react-native-community/cli/build/index.js:184:11)
First install the cocoapods
sudo gem install cocoapods
Then run the below command on root folder
cd ios && pod install && cd ../ && react-native run-ios
Step 1:
sudo gem install cocoapods
Step 2:
cd ios && pod install && cd ../ && react-native run-ios
If you still get error while installing pods continue the below steps.
Step 3: Put this in console ->
xcrun -k --sdk iphoneos --show-sdk-path
if the answer is
xcrun:_ error: SDK "iphoneos" cannot be located
xcrun: error: SDK "iphoneos" cannot be located
xcrun: error: unable to lookup item 'Path' in SDK 'iphoneos'
then put this:
sudo xcode-select --switch /Applications/Xcode.app
Then install pod again
I had the same issue and I solve the problem using bellow approach.
Navigate to iOS folder and then run bellow command:
pod update
pod update command will update all dependency and generate a "Podfile.lock" file.
I had a similar issue and resolved it by jumping into the ios folder and running:
pod update
Doing this directly in the ios folder resulted in the generation of Podsfile.lock
Changing out of ios into the main directory I was able to then launch the app on an IOS simulator using:
npx react-native run-ios
I have tried many solutions. But finally tried something logical. I don't know why i didn't tried first :)
pod install doesn't work.It changes nothing. The problem is "Podfile" is there but not "Podfile.lock". Thats the problem. When we try install again, it is doing nothing because Podfile is there.
Solution is removing "Podfile" then pod install again. Then you will see both files "Podfile" and "Podfile.lock". After many hours of struggling, this was the solution for me and i have tried many thing :) Good luck to you all.
For anybody with Mac M1 that nothing worked and still having the problem.
They actually say at the docs you need to run those commands
sudo arch -x86_64 gem install ffi
arch -x86_64 pod install
when it ends will tell
[!] Please close any current Xcode sessions and use `MyApp.xcworkspace` for this project from now on.
Pod installation complete! There are 55 dependencies from the Podfile and 46 total pods installed.
if you go and now run pod install you will notice the deference
This solution would work when you are trying to START a project, I don't know if it would help while you are in one and come across this issue.
Here is what I did:
install node.js (unless you already have it downloaded)
TO CHECK: go into terminal and type: node -v
install homeBrew (unless you already have it downloaded)
To download: go into terminal and type: /bin/bash -c "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/HEAD/install.sh)"
remember to read what it says on the terminal to fully download it (there should be like two other commands you put in)
install watchman, on terminal type: brew install watchman
on terminal uninstall all your cocoapod stuff. Check how to with this link: https://superuser.com/questions/686317/how-to-fully-uninstall-the-cocoapods-from-the-mac-machine
open up VScode
type npx react-native init TestProject
choose the method to install Cocoapods through Homebrew
This worked for me.
I'm using npm install -g yo gulp to install yeoman and this is the error I'm getting
npm WARN deprecated cross-spawn-async#2.2.5: cross-spawn no longer requires a build toolchain, use it instead
C:\Usr\local\gulp -> C:\Usr\local\node_modules\gulp\bin\gulp.js
C:\Usr\local\yo -> C:\Usr\local\node_modules\yo\lib\cli.js
C:\Usr\local\yo-complete -> C:\Usr\local\node_modules\yo\lib\completion\index.js
> yo#3.1.0 postinstall C:\Usr\local\node_modules\yo
> yodoctor
Yeoman Doctor
Running sanity checks on your system
√ No .bowerrc file in home directory
√ Global configuration file is valid
√ NODE_PATH matches the npm root
√ No .yo-rc.json file in home directory
√ Node.js version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
× yo version
{ Error: Couldn't find the 'yo' binary. Make sure it's installed and in your $PATH
at notFoundError (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:8:11)
at verifyENOENT (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:43:16)
at ChildProcess.cp.emit (C:\Usr\local\node_modules\yo\node_modules\cross-spawn-async\lib\enoent.js:30:19)
at Process.ChildProcess._handle.onexit (internal/child_process.js:198:12)
errno: 'ENOENT',
code: 'ENOENT',
syscall: 'spawn yo',
cmd: 'C:\\WINDOWS\\system32\\cmd.exe /s /c "yo "--version""' }
√ npm version
Found potential issues on your machine :(
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: fsevents#1.2.9 (node_modules\gulp\node_modules\fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for fsevents#1.2.9: wanted {"os":"darwin","arch":"any"} (current: {"os":"win32","arch":"x64"})
+ gulp#4.0.2
+ yo#3.1.0
updated 2 packages in 23.31s
Run the following command to see where npm puts global packages
npm config get prefix
You'll get output similar to this
/usr/local/Cellar/node/10.5.0_1
Copy the output or path and then using any code editor open your .bashrc or .zshrc file depending on the terminal you use and paste like so
export PATH="$PATH:"/usr/local/Cellar/node/10.5.0_1/bin/""
Then after saving run
source ~/.zshrc
Like Xander Cage said.
I have uninstalled node.js -> procedure here
I have restarted my PC.
Then I installed again node.js
It work.
The above didn't work for me at all.
The following solved my problem:
clean installed nodejs and followed steps by dv-here in thread: https://github.com/zkat/npx/issues/100
Note that my npm kept pointing to C:\usr...
I think I set the npm config set prefix= to something mistakenly due to which I was >getting the error. Here's how I fixed it:
Open CMD in "Administrator" mode.
npm cache clear --force
npm install
npm config set cache C:\Users\myname\AppData\Roaming\npm-cache
npm config set prefix C:\Users\myname\AppData\Roaming\npm
I just ran into this issue on MacOS, and saw that all of my global npm binaries were symlinked into the /usr/local/bin directory, except for yo. I created a symlink using this command:
ln -s /usr/local/Cellar/node/12.10.0/bin/yo /usr/local/bin/yo
(Yours may vary)
And yo is now callable.
I had same issue and I really didn't want uninstall nodejs as I have a lot of package installed.
Tried also with the second answer and did not worked.
Then I found this ticked, that is been closed:
https://github.com/yeoman/yeoman/issues/1716
install with yarn command for me worked.
yarn global add yo
Seem then the installation went through with also binary installed.
Nevermind try to install it with npm getting same error, so looking for provide more infos
Before I install Pods and add a workspace to my react native project I build my project successfully using this command:
xcodebuild -scheme [SchemeName] archive -archivePath ./build/[AppName].xcarchive -allowProvisioningUpdates
I installed RN Firebase using CocoaPods and it need a xcworkspace to manage packages. According this I added the workspace option to allow the xcodebuild to find Pods:
-workspace [AppName].xcworkspace
After adding this option, the build failed because it don't find main.jsbundle.
Loading dependency graph, done.
SHA-1 for file /Users/nicolas/development/git/availpro.mobile/index.js is not computed
ReferenceError: SHA-1 for file /Users/nicolas/development/git/availpro.mobile/index.js is not computed
at DependencyGraph.getSha1 (/Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/node-haste/DependencyGraph.js:201:13)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:164:26
at Generator.next (<anonymous>)
at step (/Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:31:30)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:50:14
at new Promise (<anonymous>)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:28:12
at Transformer.transformFile (/Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/DeltaBundler/Transformer.js:188:7)
at /Users/nicolas/development/git/availpro.mobile/node_modules/metro/src/Bundler.js:78:34
at Generator.next (<anonymous>)
+ [[ false != true ]]
+ [[ ! -f /Users/nicolas/Library/Developer/Xcode/DerivedData/AvailproMobile-gewuoxculvshvhehwwobcbkhdzba/Build/Intermediates.noindex/ArchiveIntermediates/AvailproMobile-staging/BuildProductsPath/Release-iphoneos/AvailproMobile.app/main.jsbundle ]]
+ echo 'error: File /Users/nicolas/Library/Developer/Xcode/DerivedData/AvailproMobile-gewuoxculvshvhehwwobcbkhdzba/Build/Intermediates.noindex/ArchiveIntermediates/AvailproMobile-staging/BuildProductsPath/Release-iphoneos/AvailproMobile.app/main.jsbundle does not exist. This must be a bug with'
error: File /Users/nicolas/Library/Developer/Xcode/DerivedData/AvailproMobile-gewuoxculvshvhehwwobcbkhdzba/Build/Intermediates.noindex/ArchiveIntermediates/AvailproMobile-staging/BuildProductsPath/Release-iphoneos/AvailproMobile.app/main.jsbundle does not exist. This must be a bug with
+ echo 'React Native, please report it here: https://github.com/facebook/react-native/issues'
React Native, please report it here: https://github.com/facebook/react-native/issues
+ exit 2
To quick fix the issue I generate the main.jsbundle manually before the xcodebuild:
react-native bundle --entry-file='index.js' --bundle-output='./ios/[AppName]/main.jsbundle' --dev=false --platform='ios' --assets-dest='./ios'
This fix seems to me a hack than a real solution.
Anyone can tell me why building the project using a .xcworkspace don't generate the main.jsbundle while building a .xcodeproj generate it ?
Thanks!
My ionic app is hanging on the splash screen - it was working fine and then I added some code, and went to test, and it's getting stuck.
It gets to this point:
------ Debug phase ------
Starting debug of 2e5ac6066864be48322a757c4d0ccdfde52cf356 (N51AP, iPhone 5s (GSM), iphoneos, arm64) a.k.a. 'Eamon White’s iPhone' connected through USB...
[ 0%] Looking up developer disk image
[ 90%] Mounting developer disk image
[ 95%] Developer disk image already mounted
[100%] Connecting to remote debug server
-------------------------
(lldb) command source -s 0 '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'
Executing commands in '/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap-lldb-prep-cmds-2e5ac6066864be48322a757c4d0ccdfde52cf356'.
(lldb) platform select remote-ios --sysroot '/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols'
Platform: remote-ios
Connected: no
SDK Path: "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols"
(lldb) target create "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app"
Current executable set to '/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device/myApp.app' (arm64).
(lldb) script fruitstrap_device_app="/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0/myApp.app"
(lldb) script fruitstrap_connect_url="connect://127.0.0.1:50188"
(lldb) target modules search-paths add /usr "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/usr" /System "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/System" "/private/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" "/var/containers/Bundle/Application/5EBCC0EF-FDB9-4DE7-A961-D91B6139AEA0" "/Users/eamonwhite/ionicmane/myapp/platforms/ios/build/device" /Developer "/Users/eamonwhite/Library/Developer/Xcode/iOS DeviceSupport/10.3.3 (14G60)/Symbols/Developer"
(lldb) command script import "/tmp/2F06F4BB-A7E5-4B97-87EC-A01CBEE5661A/fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.py"
(lldb) command script add -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.connect_command connect
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.run_command run
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.autoexit_command autoexit
(lldb) command script add -s asynchronous -f fruitstrap_2e5ac6066864be48322a757c4d0ccdfde52cf356.safequit_command safequit
(lldb) connect
(lldb) run
success
(lldb) safequit
Process 7681 detached
The deviceready message never comes.
One thing I did that is kind of relevant is, when I was building or something ionic asked me to upgrade ios-deploy from 1.9.1 to 1.9.2. I think this started happening after I did that. I try to revert back to 1.9.1 but it won't let me:
ld: framework not found MobileDevice
clang: error: linker command failed with exit code 1 (use -v to see invocation)
** BUILD FAILED **
The following build commands failed:
Ld build/Release/ios-deploy normal x86_64
(1 failure)
npm ERR! Darwin 17.0.0
npm ERR! argv "/usr/local/Cellar/node/7.7.3/bin/node" "/usr/local/bin/npm" "install" "-g" "ios-deploy#1.9.1"
npm ERR! node v7.7.3
npm ERR! npm v4.1.2
npm ERR! code ELIFECYCLE
npm ERR! ios-deploy#1.9.1 preinstall: `./src/scripts/check_reqs.js && xcodebuild`
npm ERR! Exit status 65
npm ERR!
npm ERR! Failed at the ios-deploy#1.9.1 preinstall script './src/scripts/check_reqs.js && xcodebuild'.
npm ERR! Make sure you have the latest version of node.js and npm installed.
npm ERR! If you do, this is most likely a problem with the ios-deploy package,
npm ERR! not with npm itself.
npm ERR! Tell the author that this fails on your system:
npm ERR! ./src/scripts/check_reqs.js && xcodebuild
npm ERR! You can get information on how to open an issue for this project with:
npm ERR! npm bugs ios-deploy
npm ERR! Or if that isn't available, you can get their info via:
npm ERR! npm owner ls ios-deploy
npm ERR! There is likely additional logging output above.
npm ERR! Please include the following file with any support request:
npm ERR! /Users/eamonwhite/Downloads/ionicmane-master/npm-debug.log
That might not be the problem. I could really use some help I'm close to a deadline.
UPDATE
When I try to run in xcode the same thing happens, but xcode gives these errors:
2017-10-10 15:49:17.417901-0400 myApp[8476:3520766] Resetting plugins due to page load.
2017-10-10 15:49:38.433127-0400 myApp[8476:3520766] Failed to load webpage with error: The request timed out.
UPDATE
I figured out what was causing this - it's livereload - if I run it without that its fine...but I kind of need it to work to develop.
I didn't have my wifi enabled on my phone so it couldn't connect to ionic.
From my experience we have the same issue deviceready is never shown in our console log, the most possible case would be inconsistency of the Cordova Plugin one thing that you could do is to reinstall the plugins and try to delete your platform folder and make a clean build with npm cache clean .
Update:
Based on your update , how are you running your ios app ?
Are you running your app using the -l -c commands like below:
ionic run ios -l -c
if that is the case you may be noticed that this command changes a line in the config.xml file:
// from
<content src="index.html"/>
// to
<content src="localhost//192.1.168.0:8000" original-src="index.html"/>
So Changing it back to <content src="index.html"/> might fixes the issue.
Solution 2:
You probably need to whitelist the localhost in the following way:
<allow-navigation href="http://localhost:8100/*"/>
My best guess is that your iPhone did not yet prepare the debugger for iOS11. It does so when running your app the first time on an new iOS version. You have to open and run your project once using XCode then you should be fine. Please also make sure you have the most recent version of cordova-ios which is 4.5.1 (check the <engine name=ios"> tag in your config.xml).
Check whether you have the following tag in your config.xml
<allow-navigation href="*"/>
Also can you check whether this is observed only in iOS or also in Android.
Ran into this with Ionic 4. After adding iOS platform, running the following worked:
ionic cordova prepare ios
When I run "ionic cordova platform add ios", that got the following error. How to fix it?
Exception: Using cordova-fetch for cordova-ios#0.0.1
Error: Failed to fetch platform cordova-ios#0.0.1
Probably this is either a connection problem, or platform spec is incorrect.
Check your connection and platform name/version/URL.
Error: npm: Command failed with exit code 1 Error output:
npm ERR! code ETARGET
npm ERR! notarget No matching version found for cordova-ios#0.0.1
npm ERR! notarget In most cases you or one of your dependencies are requesting
npm ERR! notarget a package version that doesn't exist.
npm ERR! A complete log of this run can be found in:
npm ERR! /Users/thanhnguyen/.npm/_logs/2017-08-25T10_34_19_961Z-debug.log
The following command should resolve the issue:
cordova platform add ios#latest
Inside my package.json there was a ios:0.0.1 which I removed and got resolved.