问题
I'm working on this plugin: com.ios.libgoogleadmobads, which is a helper plugin for https://github.com/appfeel/admob-google-cordova (com.admob.google cordova admob plugin)
As you can see here: https://github.com/appfeel/google-iosadmobads/tree/master/src/ios/GoogleMobileAds.framework
there are two symbolic lynks. When I try to install the plugin:
cordova plugin add com.ios.libgoogleadmobads
The links are skipped. Any workaround/solution please?
UPDATE
As a workaround I've added a hook to create the links via bash and I've deleted the predefined symbolic links. It is working in MAC, not in other systems. So I'm curious to know why plugman doesn't support symbolik links when installing remote plugins (it works for local plugins).
Idea: Could it be due to tar.gz? Could it be fixed in any way?
回答1:
Modify plugins/com.ios.libgoogleadmobads/hooks/after_plugin_add/000-create-links.sh. ln in there has an illegal option "-r". I suspect they meant to use the force option "-f"?
Update From:
#!/usr/bin/env bash
ln -s -r plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/A/Headers/ plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Headers
ln -s -r plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/A/GoogleMobileAds plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/GoogleMobileAds
ln -s -r plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/A/ plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/Current
To:
#!/usr/bin/env bash
ln -s -f plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/A/Headers/ plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Headers
ln -s -f plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/A/GoogleMobileAds plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/GoogleMobileAds
ln -s -f plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/A/ plugins/com.ios.libgoogleadmobads/src/ios/GoogleMobileAds.framework/Versions/Current
回答2:
At the end I managed to solve it by changing the dependency tag in https://github.com/appfeel/admob-google-cordova in plugin.xml:
<dependency id="com.ios.libgoogleadmobads" url="https://github.com/appfeel/google-iosadmobads"/>
For anyone who can be helpful, my conclusion is that any .framework library needed in a cordova or phonegap plugin needs to be placed in a separate repo and refferenced with the url attribute.
See related issue here: https://issues.apache.org/jira/browse/CB-6092
来源:https://stackoverflow.com/questions/28974791/plugman-framework-skips-mac-os-x-symbolic-links