Today I ran into Cordova plugin mapping issue.
Spent around 2 hours time to find out the root cause of the missing plugin,
it happens every time we rebuild iOS before any plugin is cloned.
To replicate the problem:
- In the cordova app project directory, remove "plugins" & "platforms" folders
- run `cordova platform add ios` to add platform directly (this step will fetch required plugins stated in config.xml and generate the iOS platform)
- Once iOS platform is ready, run `cordova run ios`.
The three steps above will lead you to problems like screenshot below.
In case I proceed by ignoring those "plugin not found" issues,
and run the buggy app on my device.
I'll end up getting errors like below in my debugging tool's console:
and run the buggy app on my device.
I'll end up getting errors like below in my debugging tool's console:
deviceready has not fired after 5 seconds
Channel not fired: onPluginReady
Channel not fired: onCordovaReady
To workaround this issue,
you'll need to rebuild the cordova iOS platform again with all the plugins fetched at first.
Now, since I have all the required plugins ready (from previous added iOS platform),
I'll keep the fetched plugins (inside plugins folder) and follow the steps below.
Remove and add back the iOS platform:
- cordova platform rm ios
- cordova platform add ios
No comments:
Post a Comment
Hey, thank you for spending time leaving some thoughts, that would be really helpful as encouragement for us to write more quality articles! Thank you!