Xcode Cordova插件';s JS文件未复制到平台/文件夹

Xcode Cordova插件';s JS文件未复制到平台/文件夹,xcode,cordova,cordova-plugins,cordova-ios,Xcode,Cordova,Cordova Plugins,Cordova Ios,我们有一个项目,其中有一些自定义插件。问题是当我这么做的时候 cordova build ios 然后插件的JS文件不会被复制到platforms/ios/www/plugins/,即使构建成功而没有任何错误,但是当我尝试安装/运行应用程序时,如果我访问window.plugins,就会出现未定义的错误 此外,platforms/ios/中的ios.json文件没有任何插件条目,它就像是空的: { "prepare_queue": { "installed": [],

我们有一个项目,其中有一些自定义插件。问题是当我这么做的时候

cordova build ios
然后插件的JS文件不会被复制到platforms/ios/www/plugins/,即使构建成功而没有任何错误,但是当我尝试安装/运行应用程序时,如果我访问
window.plugins
,就会出现未定义的错误

此外,platforms/ios/中的ios.json文件没有任何插件条目,它就像是空的:

{
    "prepare_queue": {
        "installed": [],
        "uninstalled": []
    },
    "config_munge": {
        "files": {}
    },
    "installed_plugins": {},
    "dependent_plugins": {}
}
如果我做了
cordova插件列表
,我可以看到其中所有插件的列表。此外,plugins.h和.m文件也会被复制并显示在platforms/ios//plugins/

这些是我的config.xml文件的内容

<?xml version='1.1' encoding='utf-8'?>
    <widget id="com.myapp.enterprise.prod" version="0.0.50" xmlns="http://www.w3.org/ns/widgets" xmlns:gap="http://phonegap.com/ns/1.0" xmlns:cdv="http://cordova.apache.org/ns/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
        <name>MyApp</name>
        <description>
            A sample Apache Cordova application that responds to the deviceready event.
        </description>
        <author email="dev@cordova.apache.org" href="http://cordova.io">
            Apache Cordova Team
        </author>
        <!--
        If you do not want any permissions to be added to your app, add the
        following tag to your config.xml; you will still have the INTERNET
        permission on your app, which PhoneGap requires.
        -->
        <preference name="permissions" value="none" />
        <!-- Customize your app and platform with the preference element. -->
        <!-- <preference name="phonegap-version" value="3.4.0" /> -->
        <!-- all: current version of PhoneGap -->
        <preference name="orientation" value="portrait" />
        <!-- all: default means both landscape and portrait are enabled -->
        <preference name="target-device" value="universal" />
        <!-- all: possible values handset, tablet, or universal -->
        <preference name="fullscreen" value="false" />
        <!-- all: hides the status bar at the top of the screen -->
        <preference name="UIWebViewBounce" value="false" />
        <preference name="DisallowOverscroll" value="true" />
        <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
        <preference name="webviewbounce" value="false" />
        <!-- ios: control whether the screen 'bounces' when scrolled beyond the top -->
        <preference name="prerendered-icon" value="true" />
        <!-- ios: if icon is prerendered, iOS will not apply it's gloss to the app's icon on the user's home screen -->
        <preference name="stay-in-webview" value="false" />
        <!-- ios: external links should open in the default browser, 'true' would use the webview the app lives in -->
        <preference name="ios-statusbarstyle" value="black-opaque" />
        <!-- ios: black-translucent will appear black because the PhoneGap webview doesn't go beneath the status bar -->
        <preference name="detect-data-types" value="true" />
        <!-- ios: controls whether data types (such as phone no. and dates) are automatically turned into links by the system -->
        <preference name="exit-on-suspend" value="false" />
        <!-- ios: if set to true, app will terminate when home button is pressed -->
        <preference name="show-splash-screen-spinner" value="true" />
        <!-- ios: if set to false, the spinner won't appear on the splash screen during app loading -->
        <preference name="auto-hide-splash-screen" value="true" />
        <!-- ios: if set to false, the splash screen must be hidden using a JavaScript API -->
        <preference name="disable-cursor" value="false" />
        <!-- blackberry: prevents a mouse-icon/cursor from being displayed on the app -->
        <preference name="android-minSdkVersion" value="7" />
        <!-- android: MIN SDK version supported on the target device. MAX version is blank by default. -->
        <preference name="KeyboardShrinksView" value="true" />
        <preference name="android-installLocation" value="auto" />
        <!-- android: app install location. 'auto' will choose. 'internalOnly' is device memory. 'preferExternal' is SDCard. -->
        <preference name="KeyboardDisplayRequiresUserAction" value="false" />
        <preference name="AndroidPersistentFileLocation" value="Compatibility" />
        <preference name="AndroidLaunchMode" value="singleTask" />
        <preference name="AutoHideSplashScreen" value="false" />
        <preference name="TopActivityIndicator" value="gray" />
        <preference name="fadeSplashScreenDuration" value="1" />
        <preference name="ShowSplashScreenSpinner" value="false" />
        <preference name="SplashScreen" value="splash_je" />
        <preference name="SplashScreenDelay" value="10000" />
        <content src="index.html" />
        <access origin="*" />
    </widget>

MyApp
响应deviceready事件的Apache Cordova应用程序示例。
阿帕奇科尔多瓦团队
此外,platforms/ios/文件夹中没有cordova_plugins.js文件


我使用的是Mac OS X(El Capitan)、Cordova v5.4.0、Xcode v7.1。

Cordova 5.4.0中有一个iOS插件。尝试降级Cordova
npm安装-gcordova@5.3.3
或删除插件并将其重新安装到项目中。

非常好,谢谢。成功了。由于没有代表,我无法对你的答案投赞成票。无论如何,我真的很感激。我和它斗争了两天。我相信这已经在Cordova 5.4.1中修复。另外,请确保您的插件已保存到config.xml,您可以使用
cordova plugin save
执行此操作。