Cordova iOS plugins not found

后端 未结 13 1207
抹茶落季
抹茶落季 2020-12-05 11:04

I recently upgraded to Cordova 2.9.0 from 2.3.0. After following all the upgrade instructions, I was able to get the app to launch in the simulator. However, in Xcode I see

相关标签:
13条回答
  • 2020-12-05 11:40

    For new cordova versions

    Mass Saving of Plugins on an Existing Project

    If you have a pre-existing project and you want to save all currently added plugins in the project, you can use:

    cordova plugin save
    
    0 讨论(0)
  • 2020-12-05 11:44

    In my case...the solution was add this line of code for all plugin that i use.. in my config.xml

        <feature name="Device">
        <param name="ios-package" value="CDVDevice" />
        <param name="onload" value="true" />
    </feature>
    
    <feature name="FCMPlugin">
        <param name="ios-package" value="FCMPlugin" />
        <param name="onload" value="true" />
    </feature>
    
    <feature name="StatusBar">
        <param name="ios-package" value="CDVStatusBar" />
        <param name="onload" value="true" />
    </feature>
    
    <feature name="CDVLocation">
        <param name="ios-package" value="CDVLocation" />
        <param name="onload" value="true" />
    </feature>
    
    <feature name="cordova.logger">
        <param name="ios-package" value="CDVLogger" />
        <param name="onload" value="true" />
    </feature>
    
    <feature name="Logger">
        <param name="ios-package" value="CDVLogger" />
        <param name="onload" value="true" />
    </feature>
    
    <feature name="Console">
        <param name="ios-package" value="CDVLogger" />
        <param name="onload" value="true" />
    </feature>
    
    
    <feature name="SQLitePlugin">
        <param name="ios-package" value="SQLitePlugin" />
        <param name="onload" value="true" />
    </feature>
    
      <feature name="Keyboard">
        <param name="ios-package" value="IonicKeyboard" />
        <param name="onload" value="true" />
    </feature>
    
    0 讨论(0)
  • 2020-12-05 11:47

    I had the same issue. I just downloaded the cordova 3.0 command line tool using node's package manager. I then used the tool from Terminal to create my project, add platforms to it, and build it like this.

    cordova create myApp com.project.RobertW myApp
    cd myApp
    cordova platform add ios
    cordova platform add android
    cordova build
    

    After this I saw those same errors in Xcode when I tried to run it in the simulator. It seems by default now PhoneGap does not include any plugins in the project so even if there in your config file they probably won't be in the plugins folder. You have to add them manually or via the command line tool. I used the command line tool because I thought it was easier like so.

    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git
    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-network-information.git
    cordova plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-console.git
    cordova build
    

    After doing this I ran myApp in the simulator again and everything worked fine. There are some good instructions on the command line tool here:

    http://docs.phonegap.com/en/3.0.0/guide_cli_index.md.html#The%20Command-line%20Interface

    I would like to think if PhoneGap 3.0 needs Logger, Device, and Network Status that it would include those plugins automatically but in my case it did not. Hope this helps.

    Edit: In the config.xml for iOS version in Xcode, you'll also need to make this change to get the Logger plugin to work correctly. The following is the default.

    <feature name="Console">
        <param name="ios-package" value="CDVLogger" />
    </feature>
    

    Change above to this

    <feature name="Logger">
        <param name="ios-package" value="CDVLogger" />
    </feature>
    

    Now all your console functions should work without throwing errors.

    0 讨论(0)
  • 2020-12-05 11:50

    We opened the project in Xcode, and looked in the Project navigator sidebar.

    Under the virtual "Plugins" folder we noticed that the files for some plugins were missing from this folder.

    The solution was to right-click on Plugins and select Add Files to "ProjectName"...

    Then we navigated into the plugin's folder and added all the .swift and .m and .h files there.

    Doing this created new references in the file platforms/ios/[ProjectName].xcodeproj/project.pbxproj so we kept those changes.

    0 讨论(0)
  • 2020-12-05 11:51

    happened to me on phonegap 3.5 with Xcode 6

    steps:

    phonegap plugin remove org.apache.cordova.camera 
    phongap plugin add org.apache.cordova.camera 
    phongap platform remove ios
    phongap build ios
    

    Probably not the best solution - because you lose your xcode settings - But it fixed the problem.

    0 讨论(0)
  • 2020-12-05 11:54

    For future searchers (like me!), I had a similar problem trying to add the console plugin to my project. The missing step for me after installing the plugin was to make sure the source files of the plugin (CDVlogger.m) 'target membership' settings included my application names.

    0 讨论(0)
提交回复
热议问题