[英]Cordova build fails due to facebook plugin after updating Ionic2 CLI to Ionic3
Recently I have updated the Ionic2 CLI to Ionic3 CLI but I am facing issue to make a build. 最近我将Ionic2 CLI更新为Ionic3 CLI,但我面临着构建问题的问题。
This is happed due to cordova-plugin-facebook4 not putting proper entries resources values file. 这是因为cordova-plugin-facebook4没有放入正确的条目资源值文件。
Error as like on console as follows: 控制台上的错误如下:
:app:processDebugResources
AndroidManifest.xml:68: AAPT: error: resource string/fb_app_id (aka com.myapp.ionic3:string/fb_app_id) not found.
AndroidManifest.xml:71: AAPT: error: resource string/fb_app_name (aka com.myapp.ionic3:string/fb_app_name) not found.
error: failed processing manifest.
System Information as like as follows: 系统信息如下:
ionic --version
3.19.1
cordova --version
8.0.0
node --version
v9.4.0
npm --version
5.6.0
gradle --version
------------------------------------------------------------
Gradle 4.4.1
------------------------------------------------------------
Build time: 2017-12-20 15:45:23 UTC
Revision: 10ed9dc355dc39f6307cc98fbd8cea314bdd381c
Groovy: 2.4.12
Ant: Apache Ant(TM) version 1.9.9 compiled on February 2 2017
JVM: 1.8.0_111 (Oracle Corporation 25.111-b14)
OS: Mac OS X 10.13.2 x86_64
Please help me to resolve this issue. 请帮我解决这个问题。
Add this to the config.xml file 将其添加到config.xml文件中
<platform name="android">
<config-file parent="/resources" target="./res/values/strings.xml">
<string name="fb_app_id">1234</string>
<string name="fb_app_name">foobar</string>
</config-file>
...
I was having the same problem and it helped me 我有同样的问题,它帮助了我
Add string resources into strings.xml file : 将字符串资源添加到strings.xml文件中:
ie /path/IonicProject/platforms/android/app/src/main/res/values/strings.xml 即/path/IonicProject/platforms/android/app/src/main/res/values/strings.xml
<string name="fb_app_id">232342323</string>
<string name="fb_app_name">TESTAPP</string>
where 232342323 is facebook app id and TESTAPP is appname on faceboook 其中232342323是facebook应用程序ID,TESTAPP是faceboook上的appname
add yourapp_id in "ionic.config.json" 在“ionic.config.json”中添加yourapp_id
enter image description here 在此输入图像描述
update varable config.xml 更新varable config.xml
<variable name="fb_app_id" value="18914XXXXXX683" />
<variable name="fb_app_name" value="JXXi" />
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.