Phonegap 3.0 IOS plugins not found

前端 未结 14 1720
天命终不由人
天命终不由人 2020-12-01 03:14

I´m getting this error in XCode:

2013-08-23 14:36:18.284 Tell The DJ[14955:c07] ERROR: Plugin \'Device\' not found, or is not a CDVPlugin. Check your plugin          


        
相关标签:
14条回答
  • 2020-12-01 03:32

    This seems to be a known issue for 3.* versions

    https://issues.apache.org/jira/browse/CB-4971

    you can solve this by upgrading Phonegap to release 3.4.

    0 讨论(0)
  • 2020-12-01 03:34

    Try reinstalling the plugin:

    phonegap local plugin add https://git-wip-us.apache.org/repos/asf/cordova-plugin-device.git

    0 讨论(0)
  • 2020-12-01 03:34

    When this happens, it seems the xcode npm package responsible for making changes to the pbxproj file sometimes leaves references to plugin files that have been removed. I have not tracked down under what exact circumstances this occurs, but it appears to happen from frequent plugin remove/add operations (to update a plugin for example).

    I suspect that when a plugin is removed and the xcode npm package fails at its job, it is only able to remove the plugin file references from the PBXBuildFile section but no other sections, leaving the pbxproj in a broken state.

    When the xcode npm package attempts to add the plugin file references again, it first checks if the references are already in pbxproj. It looks in the PBXFileReference section, and since it finds references to the plugin in there, aborts further processing, getting us nowhere.

    My solution, albeit a hack when it comes down to it, is to force the xcode npm package to check the PBXBuildFile section instead. That section will be missing the references and in turn the plugin will be re-installed correctly.

    Change pbxFileReferenceSection to pbxBuildFileSection on this line: https://github.com/alunny/node-xcode/blob/master/lib/pbxProject.js#L620

    Re-install your plugins, and you should be good to go.

    0 讨论(0)
  • 2020-12-01 03:40

    I encountered the same issue. I have followed the solution given by Jeffrey Van Alstine. This is my script for building and testing an iOS app developed using Phonegap 3.0/3.1.

    #!/bin/bash
    echo "Killing xcode..."
    kill $(ps aux | grep 'Xcode' | awk '{print $2}')
    rm -r platforms/ios
    rm plugins/ios.json
    phonegap build ios
    open platforms/ios/*.xcodeproj
    

    Save it as a bash file, for example, ios.sh into your working directory (directory that contains www folder) and run ./ios.sh

    0 讨论(0)
  • 2020-12-01 03:40

    I solved this issue with complete reinstall of Node.js and Phonegap through the CLI Tool

    0 讨论(0)
  • 2020-12-01 03:41

    I was using PhoneGap 3.0/3.1 and was removing the local build folder before rebuilding (since I had to copy icons and stuff in a secondary build script). This broke my plugins and produced this same error message.

    In the end I found I had to remove ./plugins/ios.json when removing ./platforms/ios to make sure the plugins were rebuilt.

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