gpt4 book ai didi

android - Cordova - 在 Android 上安装 AdMob 插件失败 (Mac)

转载 作者:太空狗 更新时间:2023-10-29 15:52:51 26 4
gpt4 key购买 nike

我在 android 上安装 AdMob cordova 插件时遇到错误 https://github.com/floatinghotpot/cordova-plugin-admob ,, 该插件已安装并在 iOS 平台上运行良好,但在 android 上却出现此错误。

我的环境:

Fetching plugin "https://github.com/floatinghotpot/cordova-plugin-admob.git" via git clone Installing "com.rjfun.cordova.plugin.admob" for android Fetching plugin "com.google.admobsdk" via plugin registry Installing "com.google.admobsdk" for android Fetching plugin "com.google.playservices@19.0.0" via plugin registry Failed to install 'com.google.admobsdk':Error: Expected fetched plugin to have ID "com.google.playservices@19.0.0" but got "com.google.playservices". at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:99:24 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at process._tickCallback (node.js:419:13) Failed to install 'com.rjfun.cordova.plugin.admob':Error: Expected fetched plugin to have ID "com.google.playservices@19.0.0" but got "com.google.playservices". at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:99:24 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at process._tickCallback (node.js:419:13) Error: Expected fetched plugin to have ID "com.google.playservices@19.0.0" but got "com.google.playservices". at checkID (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:116:19) at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/fetch.js:99:24 at _fulfilled (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:798:54) at self.promiseDispatch.done (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:827:30) at Promise.promise.promiseDispatch (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:760:13) at /usr/local/lib/node_modules/cordova/node_modules/q/q.js:574:44 at flush (/usr/local/lib/node_modules/cordova/node_modules/q/q.js:108:17) at process._tickCallback (node.js:419:13)

有什么想法吗?!提前致谢

最佳答案

简单的答案是:

您需要升级到 cordova CLI v4.0,只需运行:

sudo npm install cordova -g

详细答案是:

此失败的根本原因是,cordova CLI v3.5 无法正确识别插件 com.google.admobsdk 中的以下依赖项。

<dependency id="com.google.playservices@19.0.0"/>

你可能会问,为什么要加@19.0.0

它用于指定一个确切的版本,并保持它与 cordova CLI 和 Intel XDK 兼容。

因为默认的 com.google.playservices (@21.0.0) 不能被 Intel XDK 处理(至少到目前为止,当这个答案被发布时),而版本 com .google.playservices@19.0.0 可以被 Intel XDK 正确处理。

cordova v3.5 中的一些错误导致了此问题,并已在 cordova v4.0 中修复,在发行说明中称为“固定依赖项”。

请参阅发行说明:http://cordova.apache.org/announcements/2014/10/16/cordova-4.html

所以,请升级到 cordova CLI v4.0,它会更容易。

如有任何问题,请在项目问题跟踪器页面中提问,我们将及时为您提供支持。

关于android - Cordova - 在 Android 上安装 AdMob 插件失败 (Mac),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/27258399/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com