No resource found that matches the given name (at 'cardBackgroundColor' with value '?android:attr/colorBackgroundFloating')

风流意气都作罢 提交于 2019-11-30 17:01:54

compile 'com.facebook.android:facebook-android-sdk:4.+' needs V-23

Change the facebook version SDK to 4.8.0 then it won't use that resource file. Then your code will be up & running/

I also had this issue. I solved by forcing an older version of the card view library as the issue is with that.

compile('com.android.support:cardview-v7:23.2.0') {
    force = true
}

The issue was with 23.2.1 of card view, the Facebook SDK uses this library.

infinitysky

If you are using the "cordova-plugin-facebook4" plugin, please remove the plugin from your project and pull it again (the latest version), then add it back to your project.

At the same time, please check the xml file, which is locate at yourCordovaProject/plugin/cordova-plugin-facebook4/plugin.xml around line No. 64, it must be 4.8.+ :

<framework src="com.facebook.android:facebook-android-sdk:4.8.+"/>

  1. For a temporary fix I solved my issue changing the project.properties:

vi platforms/android/project.properties

and changed from target=android-22 to target=android-23

  1. For a permanent fix you just need to update the android platform:

cordova platform update android --save

For Phonegap Build users, try this. It worked for me.

<plugin spec="https://github.com/jeduan/cordova-plugin-facebook4#aff9a08a86cc6c6a18019f7adc2896ddf97c11cd" source="git" >

my system already had 23 installed. from project panel, Application -> Open module setting (F4) -> application -> Properties tab. I had Compile Sdk Version Android 5.50 (lollipop). So I changed to API 23+ and it worked. So I checked Application build.gradle changed
from compileSdkVersion 21
buildToolsVersion "23.0.3"
to
compileSdkVersion 'android-N'
buildToolsVersion "23.0.3"

so I"m guessing you can simply change compoileSdkVersion to your buildTollVersion.

I've fixed it removing the plugin:

 cordova plugin remove cordova-plugin-facebook4

And installing it again from this commit:

cordova plugin add https://github.com/jeduan/cordova-plugin-facebook4\#aff9a08a86cc6c6a18019f7adc2896ddf97c11cd --save --variable APP_ID="YOUR_FB_APP_ID" --variable APP_NAME="YOUR_FB_APP_NAME"

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!