Sdk com.android.support dependent response to native-fb reaction

> A problem occurred configuring project ':react-native-fbsdk'. > Could not resolve all dependencies for configuration ':react-native-fbsdk:_debugPublishCopy'. > Could not find com.android.support:appcompat-v7:27.0.1. Searched in the following locations: file:/<location_to_sdk>/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.pom file:/<location_to_sdk>/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar file:/<location_to_app>/android/sdk-manager/com/android/support/appcompat-v7/27.0.1/appcompat-v7-27.0.1.jar Required by: newPtMobile:react-native-fbsdk:unspecified 

This problem started this morning when running run-android without changes, without making any changes to the code or adding new packages, it worked perfectly so far!

"react-native": "0.50.3", "react-native-fbsdk": "0.6.3"

I see that I do not have enough android support libraries in the subdirectories sdk/extras/android/m2repository/com/android/support , all subfolders have a folder 26.0.0-alpha1 as the last. I already tried to delete the support repository and install it again through Android studio and manually download the latest android_m2repository , but the folders are still missing.

I am having trouble understanding why google maven repository ( https://dl.google.com/dl/android/maven2/index.html ) claims that, for example, for m2repository/com/android/support/appcompat-v7 I need to have a folder named 27.0.2 (along with some previous versions that are also missing), but even in the latest version of android_m2repository that they offer, it is also missing!

https://dl.google.com/android/repository/android_m2repository_r48.zip

+7
android react-native react-native-fbsdk
source share
5 answers

I have the same problem too. I was able to successfully build by updating my version of ROOT: android/build.gradle .

STEPS:
1. All you have to do is add a new maven line to the allprojects section for maven.google.com
2. Add resolutionStrategy Limit your version of android fbsdk to 4.28.0

 allprojects { repositories { mavenLocal() jcenter() configurations.all { resolutionStrategy { force 'com.facebook.android:facebook-android-sdk:4.28.0' } } maven { url "https://maven.google.com" } maven { // All of React Native (JS, Obj-C sources, Android binaries) is installed from npm url "$rootDir/../node_modules/react-native/android" } } } 
+11
source share

I see that another thread was opened in the same problem: getting an error when running run-native run-android

The recommended solution is close to Sutani, which edits node_modules/react-native-fbsdk/android/build.gradle and adding

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

It seems that this is not the regression introduced by response-native-fbsdk, but the Google Android libraries, but I don’t understand 100% on it.

+6
source share

I have the same problem and I solved with:

  • edit package.json and I edit react-native-fbsdk from react-native-fbsdk": "0.6.3" to react-native-fbsdk": "0.6.0"

  • go to node_modules/react-native-fbsdk/android/build.gradle . open build.gradle file.

  • Change compile('com.facebook.android:facebook-android-sdk:4++') to compile('com.facebook.android:facebook-android-sdk:4.22.1') ,

but I don’t know if this is the best way for this problem, thanks

0
source share
 CUR_SPACE=. culpritLocation=$CUR_SPACE/node_modules/react-native-fbsdk/android/build.gradle sed -i -e 's/com.facebook.android:facebook-android-sdk:4.+/com.facebook.android:facebook-android-sdk:4.26.0/' $culpritLocation printf "Fixed Could not resolve all dependencies for configuration ':react-native-fbsdk:_debugPublishCopy'.\n> Could not find com.android.support:appcompat-v7:27.0.1." printf "fix_rn_fbsdk_google_libraries.sh should be removed at a later time\n" 

Put the above script in the root of your project responsible for the reaction, add execute rights to it, then add in package.json in the postinstall property. / your -script-name.sh ;. Example:

 { "name": "AppName", "version": "1.28.14", "scripts": { "start": "node node_modules/react-native/local-cli/cli.js start", "postinstall": "./fix_rn_fbsdk_google_libraries.sh; ./infuse_version.sh;" }, [..] } 

If you are not familiar with postinstall scripts, they will start immediately after running the npm install / yarn command.

The proposed solution works with cloud building tools :), and this is temporary. Future releases of rn-fbsdk should solve the problem.

0
source share

The key is in the error message indicated in your case:

Search in the following locations: file:/<location_to_sdk>/sdk/extras/android/m2repository/com/android/support/appcompat-v7/27.0.1/

I had the same thing. Then I went to the place:

file:<location_to_sdk>/sdk/extras/android/m2repository/com/android/support/appcompat-v7/

And I found that there is no directory named 27.0.1 , because in my case the last buildTool was not loaded. In my case, I had 27.0.0-alpha1 .

So, in both build.gradle applications and in

node_modules / react-native-fbsdk / android / build.gradle

I replaced 27.0.1 with 27.0.0-alpha1 and the build was successful.

0
source share

All Articles