Cordova iOS Plugins fail after building, unless I remove platform and plugin JSON first

后端 未结 3 1956
情话喂你
情话喂你 2021-01-04 16:34

I have a Cordova 3.2.0 project, and I\'m testing using the XCode emulator and an iPhone 4S over USB.

When I execute the following, the app runs without error:

<
相关标签:
3条回答
  • 2021-01-04 17:03

    In XCode, goto Build Phases -> open the Compiled Sources dropdown. Click + and add the missing plugin .m file that should be in your Plugins directory (but is missing from the compiled sources).

    This solution came from another stack overflow answer, here: https://stackoverflow.com/a/21148428/80254

    0 讨论(0)
  • 2021-01-04 17:05

    I seem to have resolved this by modifying the config.xml file that exists in the "www" subdirectory of the project.

    With a clean build from scratch, Cordova seems to generate the config.xml file under "platforms/ios" with the plugin feature tags (perhaps inferring their use from the presence of the plugin files themselves), but on rebuilding then those get lost.

    By having them explicitly defined in the www/config.xml path, the rebuilds work fine.

    0 讨论(0)
  • 2021-01-04 17:25

    Very straightforward solution that worked for me: downgrade Cordova CLI version to earliest one that doesn't erase ios.json during build.

    My case: CLI version was 5.4.1, upgraded to 6.3.1 - fail. Downgraded to 6.2.0 - OK

    One downside is that you need to test CLI versions manually.

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