如何安装facebookconnect cordova插件? [英] How can I install the facebookconnect cordova plugin?

查看:319
本文介绍了如何安装facebookconnect cordova插件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想使用 com.phonegap.plugins.facebookconnect 插件。要安装它,我必须提供两个变量,如下所示:

  cordova插件add com.phonegap.plugins.facebookconnect --variable APP_ID =< app_id> --variable APP_NAME =< app_name> 

这样可以工作,但是由于此问题

  BUILD FAILED 
/ Applications / Android Studio.app/sdk/tools/ant/build.xml:720:执行此行时发生以下错误:
/ Applications / Android Studio.app/sdk/tools/ ant / build.xml:734:编译失败;有关详细信息,请参阅编译器错误输出。

总时间:6秒

... / platforms / android / cordova / node_modules / q / q.js:126
throw e;
^
命令的错误代码1:ant with args:debug,-f,... / platforms / android / build.xml,-Dout.dir = ant-build,-Dgen.absolute。 dir = ant-gen
错误:... / platforms / android / cordova / run:命令失败,退出代码8
在ChildProcess.whenDone(/ usr / local / lib / node_modules / cordova / node_modules /cordova-lib/src/cordova/superspawn.js:135:23)
在ChildProcess.emit(events.js:98:17)
at maybeClose(child_process.js:755:16)
at Process.ChildProcess._handle.onexit(child_process.js:822:5)

传统方式解决上述问题是删除所有平台并再次添加。问题是,当添加平台时,他们尝试为自己安装插件,但不传递插件需要正确安装的变量,导致:

 无法安装com.phonegap.plugins.facebookconnect:错误:缺少变量:APP_ID,APP_NAME 
在/ usr / local / lib / node_modules / cordova /node_modules/cordova-lib/src/plugman/install.js:301:23
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)
错误:变量缺少:APP_ID,APP_NAME
at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:301:23
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)
在/ 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)
在进程。 _tickCallback(node.js:419:13)

所以我得到一个正确安装的插件,失败的构建,或者安装不正确的插件和传递构建。



这使得不能使用facebookconnect插件,因为当然,插件需要正确安装



更多信息



  $ cordova -v 
3.5.0-0.2.7



相关问题




解决方案

为避免cordova问题,请勿尝试使用cordova构建。只需使用cordova来创建项目,添加平台和添加插件(按顺序)。然后,使用xcode或android studio或visual studio来构建和运行。这是为我解决了问题。



此外,不要添加注册表插件。下载zip文件,将其解压缩,然后在本地添加。感谢@tapmonkey为以下链接解释:



http:/ /stackoverflow.com/a/25327341/585580


I am trying to use the com.phonegap.plugins.facebookconnect plugin. To install it, I must provide two variables, like this:

cordova plugin add com.phonegap.plugins.facebookconnect --variable APP_ID="<app_id>" --variable APP_NAME="<app_name>"

This works, but then the build fails because of this issue.

BUILD FAILED
/Applications/Android Studio.app/sdk/tools/ant/build.xml:720: The following error occurred while executing this line:
/Applications/Android Studio.app/sdk/tools/ant/build.xml:734: Compile failed; see the compiler error output for details.

Total time: 6 seconds

.../platforms/android/cordova/node_modules/q/q.js:126
                    throw e;
                          ^
Error code 1 for command: ant with args: debug,-f,.../platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: .../platforms/android/cordova/run: Command failed with exit code 8
    at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/cordova/superspawn.js:135:23)
    at ChildProcess.emit (events.js:98:17)
    at maybeClose (child_process.js:755:16)
    at Process.ChildProcess._handle.onexit (child_process.js:822:5)

The traditional way to solve the aforementioned issue is to remove all platforms and add them again. The problem is that when the platforms are added, they try to install the plugin for themselves, but don't pass in the variables the plugin needs to correctly install, resulting in:

Failed to install 'com.phonegap.plugins.facebookconnect':Error: Variable(s) missing: APP_ID, APP_NAME
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:301:23
    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: Variable(s) missing: APP_ID, APP_NAME
    at /usr/local/lib/node_modules/cordova/node_modules/cordova-lib/src/plugman/install.js:301:23
    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)

So I get either a correctly installed plugin, but a failing build, or an incorrectly installed plugin and a passing build.

This makes it impossible to use the facebookconnect plugin, because, of course, the plugin needs to be installed correctly AND the build needs to pass.

Any quick solution for this?

more info

$ cordova -v
3.5.0-0.2.7

related questions

解决方案

To avoid the cordova issue, don't try building with cordova. Just use cordova to create the project, add platforms, and add plugins (in that order). Then, use xcode or android studio or visual studio to build and run. This is what solved the problem for me.

Also, don't add the plugin with the registry. Download the zip file, uncompress it, and then add it locally. Thanks to @tapmonkey for the following link which explains this:

http://stackoverflow.com/a/25327341/585580

这篇关于如何安装facebookconnect cordova插件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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