blakgeek / cordova-plugin-cocoapods-support

A Cordova/PhoneGap plugin to add support for CocoaPods dependencies.
MIT License
72 stars 72 forks source link

Plugin with cocoapod dependency build error #44

Closed alexkiri closed 6 years ago

alexkiri commented 6 years ago

This is the plugin source

<?xml version='1.0' encoding='utf-8'?>
<plugin id="dummy-plugin" version="0.34.0" xmlns="http://apache.org/cordova/ns/plugins/1.0" xmlns:android="http://schemas.android.com/apk/res/android">
  <name>DummyPlugin</name>
  <dependency id="cordova-plugin-cocoapod-support" version="1.6.0"/>
  <dependency id="cordova-plugin-add-swift-support" version="1.7.2"/>

  <js-module name="DummyPlugin" src="www/DummyPlugin.js">
    <clobbers target="cordova.plugins.DummyPlugin" />
  </js-module>

  <platform name="ios">
    <source-file src="src/ios/DummyPlugin.swift" />
    <pods-config ios-min-version="10.0" use-frameworks="true" />
    <framework src="Zip" type="podspec" spec="1.1.0" />
  </platform>
</plugin>

In also added the <preference name="UseSwiftLanguageVersion" value="4.1" /> line in config.xml

The plugin installs correctly, the project builds correctly using xcode (after adding an additional param in the Pods project SWIFT_VERSION = 4.1)

But the project does not build using cordova build ios --device, I am receiving the following error:

ld: warning: directory not found for option '-F/Users/alexchirila/Library/Developer/Xcode/DerivedData/HelloWorld-gfigdqjpsastrsdveoablncumimx/Build/Intermediates.noindex/ArchiveIntermediates/HelloWorld/BuildProductsPath/Debug-iphoneos/Zip'
ld: framework not found Zip
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Is there anything I am doing wrong? Are there any workarounds?

alexkiri commented 6 years ago

I've found a solution for this. The problem was not the plugin, but the cordova-ios platfrom. I used the nightly platform and it worked.

cordova platform add ios@5.0.0-nightly.2018.9.10.004b8300