Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

This is happed due to cordova-plugin-facebook4 not putting proper entries resources values file.

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

enter image description here

Please help me to resolve this issue.

like image 914
Santosh Shinde Avatar asked Jan 19 '18 17:01

Santosh Shinde


2 Answers

Add this to the config.xml file

<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

like image 95
Sašo Kovačič Avatar answered Nov 20 '22 18:11

Sašo Kovačič


Add string resources into strings.xml file :

ie /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

like image 30
Felix Runye Avatar answered Nov 20 '22 18:11

Felix Runye