安装Facebook登录插件后

安装Facebook登录插件后

本文介绍了安装Facebook登录插件后,ionic 2应用程序构建失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用ubantu中的ionic-2开发Hybrid应用.我想在我的应用程序中添加Facebook登录名,但安装后如果我删除Facebook插件应用程序将成功构建,则Facebook插件应用程序构建失败.谢谢.

i am developing Hybrid app using ionic-2 in ubantu. i want to add Facebook login in my app but after install Facebook plugin app build fail if i remove Facebook plugin app will build successfully please help me. thank you.

ionic cordova plugin add cordova-plugin-facebook4 --variable APP_ID="123456789" --variable APP_NAME="myApplication"
FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:processDebugResources'.
> Failed to execute aapt

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

* Get more help at https://help.gradle.org

BUILD FAILED in 17s
 FAILED
25 actionable tasks: 1 executed, 24 up-to-date
(node:30083) UnhandledPromiseRejectionWarning: Unhandled promise rejection (rejection id: 1): Error: /mnt/Workspace/work/project/ionic 2/DrinkOrdering/platforms/android/gradlew: Command failed with exit code 1 Error output:
/mnt/Workspace/work/project/ionic 2/DrinkOrdering/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:42: AAPT: error: resource string/fb_app_id (aka drinkordering.com:string/fb_app_id) not found.

/mnt/Workspace/work/project/ionic 2/DrinkOrdering/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:45: AAPT: error: resource string/fb_app_name (aka drinkordering.com:string/fb_app_name) not found.

/mnt/Workspace/work/project/ionic 2/DrinkOrdering/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:49: AAPT: error: resource string/fb_app_name (aka drinkordering.com:string/fb_app_name) not found.

/mnt/Workspace/work/project/ionic 2/DrinkOrdering/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:42: error: resource string/fb_app_id (aka drinkordering.com:string/fb_app_id) not found.
/mnt/Workspace/work/project/ionic 2/DrinkOrdering/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:45: error: resource string/fb_app_name (aka drinkordering.com:string/fb_app_name) not found.
/mnt/Workspace/work/project/ionic 2/DrinkOrdering/platforms/android/app/build/intermediates/manifests/full/debug/AndroidManifest.xml:49: error: resource string/fb_app_name (aka drinkordering.com:string/fb_app_name) not found.
error: failed processing manifest.

Failed to execute aapt

推荐答案

当我将这些行添加到platforms/android/app/src/main/res/values/strings.xml中的<resource>时,我得到了一个更成功的构建:

I got a more successful build when I added these lines to the <resource> in platforms/android/app/src/main/res/values/strings.xml:

    <string name="fb_app_id">APPID</string>
    <string name="fb_app_name">APPNAME</string>

该文件已经具有这些值,但是字符串名称不同.

The file had these values already, but the string names were different.

我本想将这段代码放入我的主config.xml中,但是我无法以这种方式工作.将它们添加到res/values/facebookconnect.xmlres/config.xml也不起作用.

I would have liked to put this code in my main config.xml but I couldn't get it to work that way. Adding these to res/values/facebookconnect.xml or res/config.xml also did not work.

这篇关于安装Facebook登录插件后,ionic 2应用程序构建失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-24 13:10