科尔多瓦3.4连接Facebook,添加库 [英] Cordova 3.4 Facebook connect, add Library
问题描述
我更新的科尔多瓦3.4 的,并希望使用最新版本的的 Facebook的连接的(的 https://github.com/phonegap/phonegap-facebook-plugin )插件。我跟着步骤那里。
但我不使用Eclipse来开发。所以,我需要通过命令行添加Facebook的库。
我遵循的步骤<一个href=\"https://stackoverflow.com/questions/21244444/import-facebook-sdk-to-cordova-phonegab-project/22912926#22912926\">of阿卜杜拉在这个岗位。
我的文件夹结构:
+平台
+安卓
...
+插件
+ ...
+ Facebook的Android的SDK-3.8.0
Facebook的+
...
我跑了平台/安卓/
此命令:
Android的更新项目--target 3 --path。 --library ../../facebook-android-sdk-3.8.0/facebook/
但现在我卡具有以下错误:
Facebook的Android的SDK-3.8.0 /的Facebook / build.xml文件:46:sdk.dir丢失。确保使用产生对Android更新项目local.properties或通过的环境变量注入它
构建与在科尔多瓦构建Android
你有一个想法如何,我可以解决这一问题?
我的平台/安卓/ project.properties
是这样的:
...
#项目的目标。
目标=机器人-18
android.library.reference.1 = CordovaLib
android.library.reference.2 = .. / .. / Facebook的Android的SDK-3.8.0 / Facebook的/
我的平台/安卓/ local.properties
是这样的:
...
#标题注释。
sdk.dir = /用户/&lt;用户名&GT; /开发/ ADT束-MAC-x86_64的/ SDK
这是正确的为好。
的完整输出科尔多瓦构建Android
:
科尔多瓦构建Android
[的ReferenceError:没有定义]
运行命令:/用户/&lt;用户名&GT; / App_Entwicklung / 20 /&lt;应用&GT; /平台/安卓/科尔多瓦/建造ARGS = []
构建文件:/用户/&lt;用户名&GT; / App_Entwicklung / 20 /&lt;应用&GT; /platforms/android/build.xml-set模式检查:-set-调试文件:-check-ENV:
[checkenv] Android SDK工具版本22.6.2
[checkenv]安装在/用户/&lt;用户名&GT; /开发/ ADT束-MAC-x86_64的/ SDK-建立:
[回应]项目名称:&lt;应用→20
[将gettype]项目类型:应用程序-set调试模式:-debug-混淆检查: - pre-编译:-build-设置:
[getbuildtools]使用最新版本的工具:19.0.3
[回应]解决构建目标为&lt;应用→20 ...
[getTarget方法]项目目标:Android 4.3的
[getTarget方法] API等级:18
[回应] ----------
[回应]如果需要创建输出目录...
[回应] ----------
[回应]解决依存关系&lt;应用→20 ...
[依赖性]库的依赖关系:
[依赖性]
[依赖性] ------------------
[依赖性]有序库:
[依赖性]
[依赖性] ------------------
[回应] ----------
[回应]与调试生成库...构建失败
在执行这条线出现以下错误:/Users/<username>/Development/adt-bundle-mac-x86_64/sdk/tools/ant/build.xml:601:
/Users/<username>/App_Entwicklung/20/<application>/facebook-android-sdk-3.8.0/facebook/build.xml:46: sdk.dir丢失。确保使用产生对Android更新项目local.properties或通过的环境变量注入它总时间:0秒
错误code 1命令:ant与ARGS: debug,-f,/Users/<username>/App_Entwicklung/20/<application>/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
错误:/用户/&lt;用户名&GT; / App_Entwicklung / 20 /&lt;应用&GT; /平台/安卓/科尔多瓦/编译:命令失败,退出code 2
在ChildProcess.whenDone(/usr/local/lib/node_modules/cordova/src/superspawn.js:112:23)
在ChildProcess.EventEmitter.emit(events.js:98:17)
在maybeClose(child_process.js:743:16)
在Process.ChildProcess._handle.onexit(child_process.js:810:5)
我写了一个指导如何建立Facebook的插件,而不蚀。这已经是对资源库中的安装指南的一部分。瞧瞧吧:的https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/README.md
I updated to Cordova 3.4 and want to use the newest version of the facebook connect (https://github.com/phonegap/phonegap-facebook-plugin) plugin. I followed the steps there.
But I do not use eclipse to develop. So I need to add the Facebook library by command line.
I followed the steps of Abdullah in this post.
My folder structure:
+ platforms
+ android
...
+ plugins
+ ...
+ facebook-android-sdk-3.8.0
+ facebook
...
I ran in platforms/android/
this command:
android update project --target 3 --path . --library ../../facebook-android-sdk-3.8.0/facebook/
But now I'm stuck with the following error:
facebook-android-sdk-3.8.0/facebook/build.xml:46: sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var
during the build with cordova build android
do you have an idea how I could fix this?
My platforms/android/project.properties
looks like this:
...
# Project target.
target=android-18
android.library.reference.1=CordovaLib
android.library.reference.2=../../facebook-android-sdk-3.8.0/facebook/
My platforms/android/local.properties
looks like this:
...
# header note.
sdk.dir=/Users/<username>/Development/adt-bundle-mac-x86_64/sdk
which is correct as well.
The complete output of cordova build android
:
cordova build android
[ReferenceError: a is not defined]
Running command: /Users/<username>/App_Entwicklung/20/<application>/platforms/android/cordova/build args=[]
Buildfile:/Users/<username>/App_Entwicklung/20/<application>/platforms/android/build.xml
-set-mode-check:
-set-debug-files:
-check-env:
[checkenv] Android SDK Tools Revision 22.6.2
[checkenv] Installed at /Users/<username>/Development/adt-bundle-mac-x86_64/sdk
-setup:
[echo] Project Name: <application>20
[gettype] Project Type: Application
-set-debug-mode:
-debug-obfuscation-check:
-pre-build:
-build-setup:
[getbuildtools] Using latest Build Tools: 19.0.3
[echo] Resolving Build Target for <application>20...
[gettarget] Project Target: Android 4.3
[gettarget] API level: 18
[echo] ----------
[echo] Creating output directories if needed...
[echo] ----------
[echo] Resolving Dependencies for <application>20...
[dependency] Library dependencies:
[dependency]
[dependency] ------------------
[dependency] Ordered libraries:
[dependency]
[dependency] ------------------
[echo] ----------
[echo] Building Libraries with 'debug'...
BUILD FAILED
/Users/<username>/Development/adt-bundle-mac-x86_64/sdk/tools/ant/build.xml:601: The following error occurred while executing this line:
/Users/<username>/App_Entwicklung/20/<application>/facebook-android-sdk-3.8.0/facebook/build.xml:46: sdk.dir is missing. Make sure to generate local.properties using 'android update project' or to inject it through an env var
Total time: 0 seconds
Error code 1 for command: ant with args: debug,-f,/Users/<username>/App_Entwicklung/20/<application>/platforms/android/build.xml,-Dout.dir=ant-build,-Dgen.absolute.dir=ant-gen
Error: /Users/<username>/App_Entwicklung/20/<application>/platforms/android/cordova/build: Command failed with exit code 2
at ChildProcess.whenDone (/usr/local/lib/node_modules/cordova/src/superspawn.js:112:23)
at ChildProcess.EventEmitter.emit (events.js:98:17)
at maybeClose (child_process.js:743:16)
at Process.ChildProcess._handle.onexit (child_process.js:810:5)
I wrote a guide how to setup the Facebook Plugin without eclipse. It is already part of the installation guidelines on the repository. Check it out at: https://github.com/Wizcorp/phonegap-facebook-plugin/blob/master/platforms/android/README.md
这篇关于科尔多瓦3.4连接Facebook,添加库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!