问题
cordova plugin add cordova-plugin-screen-orientation
After I fetched the plugin cordova-plugin-screen-orientation with the line above I looked inside the config.xml and I couldn't find a similar line like below for the plugin.
<gap:plugin name="org.apache.cordova.media-capture" />
I already tried
- guessing the plugin id/name (PhoneGap Build kept saying the plugin is unsupported):
<gap:plugin name="org.apache.cordova.screen-orientation" />
<gap:plugin name="cordova-plugin-screen-orientation" />
The last line is the plugin id/name from the plugins plugin.xml.
to find the plugin id/name on the sites below:
- build.phonegap.com/plugins
- plugins.telerik.com/cordova
- cordova.apache.org/plugins
- to get help by making an issue at the repository of the plugin (the issue has been deleted so I removed the link to the issue)
- searching on stackoverflow and google with:
- configure plugin phonegap
- adding plugin to phonegap
- adding src="npm":
<gap:plugin name="cordova-plugin-screen-orientation" src="npm" />`
Can someone tell me the plugin id/name or how to configure the plugin in the config.xml?
回答1:
The solution is replacing src="npm"
with source="npm"
.
<gap:plugin name="cordova-plugin-screen-orientation" source="npm" version="1.4.0" />
Credits go to https://github.com/bau720123 for giving me the solution in the issue I created on GitHub. The issue is deleted so I can't post a link to it.
For more info on how to configure a plugin in the config.xml go here: http://docs.phonegap.com/phonegap-build/configuring/plugins/
来源:https://stackoverflow.com/questions/33563975/how-to-configure-plugin-cordova-plugin-screen-orientation-in-config-xml