Ionic IOS - requireCordovaModule error during app build - ios

I have an Ionic app that runs fine using ionic serve and builds fine in android.
When attempting the generate the platform in iOS, I'm hitting this error that I cant quite figure out.
Error is to do with the package
cordova.plugins.diagnostic
So far I've tried
Uninstalling package and reinstalling
Removing from Cordova plugins and re-adding
Global npm install
Updating the package versions
Clearing out the node_modules folder
npm outdated and npm update to get possible list of outdated packages
I had similar issues with cordova-sqlite-storage and ionic-plugin-keyboard but using the above steps of updating and re-adding did the trick but for this instance its just not working. Any help here would be appreciated.
My ionic info is as follows:

Related

react-native init does not create ios folder using last version 69.5

I'm new at react-native and I can easily create a react-native app using Expo, but there is no way using react-native init with Mac OS.
I have checked all the recommendations on internet, but the ios folder is never created.
Versions I have:
-Node v18.8.0
-Watchman v2022.08.22.00
-cocoapods v1.11.3
-xcode Version 13.4.1
I have tried all the recommendations I found: react-native upgrade, react-native-eject, reinstalling react-native-cli...,but no way.
I think that the template is not correct.
Can someone tell me how to solve this issue?
Expo updated today, just download the latest version of react-native. After creating the project, type in your terminal yarn add react-native#latest / npm install react-native#latest
Perhaps you mistyped, but rather than reinstalling react-native-cli try uninstalling:
npm uninstall -g react-native-cli
As suggested in the docs, globally installed react-native-cli can cause issues, and missing the iOS folder/incomplete init is indeed one of them.
Once global react-native-cli is installed re-run react-native init

vips/vips8 file not found #include <vips/vips8> in Ionic cordova in IOS

I found an error in sharp.
After that, I found a blog in which they ask to delete sharp from the node module and run sudo npm i.
I have gone through GitHub and write minipass - 2.7.0
After that, I got a new error in
vips/vips8 file not found #include <vips/vips8>
I'm using Ionic with Angular on Macbook
I use commands which is
1.sudo npm install
2.sudo npm i gulp-sass -ES --unsafe-perm=true
3.sudo ionic cordova platform add ios
I very recently ran into a similar issue after making some changes to a project's package.json on my Mac (not an Angular or Cordova project).
I came across this GitHub issue for the sharp package which mentioned you may need to update the globally-installed version of libvips: https://github.com/lovell/sharp/issues/1148
In my case, since I use Homebrew but had not directly installed this package previously, I was able to resolve by running brew install vips and then re-running npm install. Note that it has a lot of dependencies so installation may take some time.
Edit: if that doesn't work, you may need to try a fresh install by removing node_modules, then re-running npm i.
This might be not applicable to everyone, but remove package-lock.json and node_modules directory first and then try npm install again. (I also added the minipass in my package.json, by the way)
In my case, I had encountered the same error, but I could solve it by doing the above.

Unable to resolve module react/lib/ReactUpdates

I'm cloning a proyect:
The steps are:
npm i
react-native link
When i run it react-native run-ios i have a problem with RCTWebSocket library. This problem is easy to resolve if you search a little just need remove 2 compiler flags, in Custom Compiler Flags.
Later just i run again react-native run-ios and works fine, but when the app is open, show the next error:
Searching i found that is related to upgrade, source here
but i'm using that command and not works.
When this command is executed, it starts showing me some overrides to some files and at the end of this process, the problem persists.
My react info:
react-native-cli: 1.0.0
react-native: 0.32.1
I'm running in Xcode 8 and ios 10.0
PDTA: When I start a new project works perfect
UPDATES:
When clone on another mac works, I am ensuring to have the same versions of both xcode and node.
Could it be some mac configuration problem?
The only difference between the 2 macs is the cli version:
`react-native-cli: 1.1.0` --> my mac
`react-native-cli: 1.2.0` --> the other mac
Will this be enough to cause all this problem?
With React 0.32~0.37: The problem is most likely that you are using React 15.4.x instead of 15.3.x. One of the changes between 15.3 and 15.4 was that many of the modules under react/lib were moved to react-dom/lib, which is why the packager can't find react/lib/ReactUpdates.
Ensure that your package.json file locks React to 15.3.x:
"dependencies": {
"react": "~15.3.2"
}
Then delete your node_modules folder and run yarn or npm install again. Verify that you installed React 15.3.x:
$ npm ls react
app#1.0.0 /code/app
└── react#15.3.2
Last, restart the React Native server and load your bundle again.
This has been fixed!
Update your dependencies and use react-native ^0.38.0 or newer.
Run react-native upgrade after all react-native version upgrades.

Cordova - 'Cordova/CDVURLRequestFilter.h' file not found

I have a problem with building iOS app with Cordova. I'm using Crosswalk with Cordova plugin. After running cordova build in terminal, I'm getting error message:
Plugins/cordova-plugin-whitelist/CDVNavigationWhitelistPlugin.h:23:9: fatal error:
'Cordova/CDVURLRequestFilter.h' file not found
#import <Cordova/CDVURLRequestFilter
Does anybody know how to fix that?
The reason was older version one of the plugins, that I've installed with Cordova-Crosswalk.
So it can be fixed in two ways - by updating everything (plugins etc.) or by simple installing again Cordova-Crosswalk via npm in different folder.

Nothing at all happens when running cordova prepare ios

I am in a ionic app at its root folder. I have a config.xml file and am having trouble getting it to build. I had no issues a few weeks ago, but I've screwed something up on my system I think. I have reinstalled both cordova and ionic and re-pulled the repo.
However, when I run ionic prepare ios --verbose literally nothing happens.
This is the only output:
ConfigXml.setConfigXml /Users/ben/code/project/app resetContent=true, errorWhenNotFound=false
ANY guidance as to what I should try next is very much appreciated.
cordova version is 5.2.0
npm version is 3.3.12
node version is v5.4.1
ionic version is 1.7.14
cordova platform ls outputs:
Installed platforms: ios 3.9.1
Available platforms: amazon-fireos, android, blackberry10, browser, firefoxos, webos
As mentioned in this thread on Github, there is an issue in Node v5 that makes ionic prepare fail.
In order to solve it you can try a couple of things.
One would be to update your cordova installation to version 5.4 or later, since it includes a fix for the Node v5 problem. You can do that using following code:
npm install -g cordova
The other suggested solution in the link is to reset the state of your ionic installation. Be aware that issuing this command will do following (as specified in Ionic-cli github page):
The ionic state reset method will first remove your platforms and
plugins folders. Then it will look at your package.json file to
re-install the platforms and plugins as specified there.
This command can be helpful for you to reinstall your plugins and
platforms to get a fresh start.
If you are willing to try, you can do it with following command:
ionic state reset
Personally I would try first to upgrade Cordova.
Try:
sudo ionic prepare ios --verbose
Whenever you install new plugins or platforms you must also change the read/write permissions on root folder for your project.

Resources