iOS无法找到插件,Android很好 [英] iOS unable to find plugins, Android fine

查看:140
本文介绍了iOS无法找到插件,Android很好的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在Phonegap / Cordova建立了一个应用程式。应用程序目前相当简单,但确实需要网络状态和地理位置插件才能工作。

I am building an app in Phonegap/Cordova. App is fairly simple at the moment, but does require the network status and geolocation plugins to work.

我开发的应用程序到目前为止(它是由一个

I've developed the app so far (it's made up of just a few basic HTML pages and a bit of JS at the moment) on Android and it has been working fine.

今天早上,我决定确保所有的iOS都很好。绝对没有什么惊喜,它是不是。

This morning I decided to make sure all was well with iOS. To absolutely no surprise at all, it isn't.

所以...似乎是插件的问题。 XCode输出以下内容:

So... it appears to be a problem with the plugins. XCode spits out the following:

CDVPlugin class CDVLocation (pluginName: Geolocation) does not exist.
2013-10-18 11:24:29.437 Eye Cab[589:907] ERROR: Plugin 'Geolocation' not found, or is not a CDVPlugin. Check your plugin mapping in config.xml.
2013-10-18 11:24:29.438 Eye Cab[589:907] -[CDVCommandQueue executePending] [Line 117] FAILED pluginJSON = [
  "Geolocation1841912763",
  "Geolocation",
  "getLocation",
  [
    false,
    0
  ]
]

我想这意味着它不能加载Geolocation插件。我得到了类似的网络连接插件。

I guess this means it can't load the Geolocation plugin. I get a similar thing for the network connection plugin.

下面是我从Phonegap项目截断的config.xml:

Below is my truncated config.xml from the Phonegap project:

<feature name="http://api.phonegap.com/1.0/device" />
<feature name="Geolocation">
    <param name="ios-package" value="CDVLocation" />
</feature>
<feature name="NetworkStatus">
    <param name="ios-package" value="CDVConnection" />
</feature>

我也尝试使用ID作为功能名称(例如org.apache.cordova.geolocation ),但得到同样的问题。事实上完全相同的错误。

I have also tried using the IDs as the feature name (eg. org.apache.cordova.geolocation), but get the same problem. The exact same error in fact.

一切都在Android中正常工作;

Everything works perfectly in Android; in the simulator, in Chrome on my mac and on a device.

我使用的是以下版本:


  • Phonegap 3.1.0-0.15.0

  • XCode 5.0

  • OSX 10.8.5

  • iOS 6.1.3(iPod Touch)

  • iOS模拟器iOS 7

  • Phonegap 3.1.0-0.15.0
  • XCode 5.0
  • OSX 10.8.5
  • iOS 6.1.3 (iPod Touch)
  • iOS Simulator for iOS 7

正确的文件在项目的/ www / plugins /文件夹中:

The correct files are in the /www/plugins/ folder in the project:


  • org.apache.cordova.geolocation

    • www

      • Coordinates.js

      • Position.js

      • PositionError.js

      • geolocation.js

      • org.apache.cordova.geolocation
        • www
          • Coordinates.js
          • Position.js
          • PositionError.js
          • geolocation.js

          • www

            • Connection.js

            • network.js

            对于任何可以帮助这个的人来说,拥抱一个拥抱。我已经拖过其他问题,但没有运气。

            An elated hug for anyone who can help with this. I've trawled through the other questions but with no luck.

            推荐答案

            iOS缺少插件文件本身h文件),必须通过调用 cordova prepare phonegap prepare 进行复制。似乎没有很好的文件。

            iOS was missing the plugin files themselves (.m and .h files), which must be copied by calling cordova prepare or phonegap prepare. Not very well documented it seems.

            这篇关于iOS无法找到插件,Android很好的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆