Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
789 views
in Technique[技术] by (71.8m points)

react native - Facebook Sdk Android Error Building

I am trying to build my react-native project and using react-native fbsdk.

However, I get these errors:

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:3: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:4: AAPT: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:3: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Borderless.Colored'.

/home/luiz/MYP/app/node_modules/react-native-fbsdk/android/build/intermediates/res/merged/release/values-v24/values-v24.xml:4: error: Error retrieving parent for item: No resource found that matches the given name 'android:TextAppearance.Material.Widget.Button.Colored'.


:react-native-fbsdk:processReleaseResources FAILED

My current OS is Linux Elementary 0.4.1 Loki x64.

I am using react-native@0.37.0 and, because of this, react-native-fbsdk@0.4.0.

I've already tried:

  • cd android && ./gradlew clean

  • delete the project and re npm install it

  • and try in Android API's 23 and 24.

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

Apparently facebook has updated their sdk yesterday and the latest (4.23.0) sdk may have a bug or something.

You can resolve this by Changing your node_modules eact-native-fbsdkandroiduild.gradle from:

compile('com.facebook.android:facebook-android-sdk:4.+')

To:

compile('com.facebook.android:facebook-android-sdk:4.22.1')

I'm no gradle guy so if someone knows of a better way of forcing the version from parent gradle.build, please comment and I'll update the answer.

** EDIT **

@Andreyco managed to solve this without changing node_modules. You can scroll down to his answer or click here.

Also, as notified by @JuanJoseTugores there's a pull request in react-native-fbsdk waiting to be approved, so you can check the bug's progress and be notified when it's resolved.

** Another Update **
Facebook closed the bug that was opened for them regarding this issue, saying they fixed the sdk. So now all the workarounds can be removed.

Apparently FB still not solved this. We just upgraded to RN 0.44 & FB 0.6.0


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...