Duplicated [string/fb_app_name] and [string/fb_app_id]

hello all i’m getting this message when ionic cordova run android i’m currently user cordova-plugin-facebook4 with cordova-plugin-accountkit the project was working well before adding the facebook4 application , but after i have added it the project stop and give me this error

[string/fb_app_name] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/accountkit.xml	[string/fb_app_name] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/facebookconnect.xml	[string/fb_app_name] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/strings.xml: Error: Duplicate resources
[string/fb_app_name] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/accountkit.xml	[string/fb_app_name] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/facebookconnect.xml	[string/fb_app_name] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/strings.xml: Error: Duplicate resources
[string/fb_app_id] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/accountkit.xml	[string/fb_app_id] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/facebookconnect.xml	[string/fb_app_id] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/strings.xml: Error: Duplicate resources
[string/fb_app_id] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/accountkit.xml	[string/fb_app_id] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/facebookconnect.xml	[string/fb_app_id] /Volumes/Partion/App/Projects/TucTop Application/TucTop/platforms/android/res/values/strings.xml: Error: Duplicate resources
:mergeDebugResources FAILED

it seem that the two plugin use the fb_app_name and fb_app_id as preference , my questions in can i remove the duplicated preference ? , or if there is any way to user facebook account kit feature without using this plugin cordova-plugin-accountkit ?
thanks in advance

1 Like

I am getting the same error. I have to manually delete the facebookconnect.xml file. Then it builds properly. Did you find any other solution for this?

3 Likes

when i update my android platform to 7.0.0 , and open the the facebookconnect.xml file i didn’t found the fb_app_name or fb_app_id , so it’s kind did the trick and i don’t knowif this is an error from plugin creator or from 7.0.0 android platform

Do mean that you have cordova-android": "7.0.0" in your package.json file and <engine name="android" spec="7.0.0" in config.xml file ? I have cordova-android: "6.3.0" and <engine name="android" spec="6.3.0".

yes currently i have android 7.0.0 , try update your global ionic cli and global cordova , and remove your android platform from your project and readd it again it will setup android@7.0.0 which did the trick

He solucionado este error romoviendo del config.xml el siguiente código

<config-file parent="/resources" target="./res/values/strings.xml">
   <string name="fb_app_id">App ID</string>
   <string name="fb_app_name">App Name</string>
</config-file>

y solo he dejando este fragmento

<plugin name="cordova-plugin-facebook4" spec="^4.0.0">
        <variable name="APP_ID" value="App ID" />
        <variable name="APP_NAME" value="App Name" />
        <variable name="FACEBOOK_ANDROID_SDK_VERSION" value="4.38.1" />
</plugin>

posteriormente he agregado la plataforma de android

cordova platform add android@6.3.0

I have the same problem updating the plugin to be able to use SDK 5.0.0. Downgrading the android platform from 7 to 6 is not a solution for me. If any other has had this problem, let me know. I am still trying to figure this out. Thank you

The comment in this github issue works for me.