Facebook Sdk Android Error Building

后端 未结 7 1980
北荒
北荒 2020-12-04 16:46

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

However, I get these errors:

/home/luiz/MYP/app/node_modu         


        
7条回答
  •  陌清茗
    陌清茗 (楼主)
    2020-12-04 17:07

    After digging into gradle, I came up with following solution.

    Key is to exclude facebook-android-sdk required by react-native-fbsdk and pull in desired (working) version on facebook-android-sdk module - preferably without modifying anything in node_modules folder.

    Fortunately, gradle offers this.

    // android/app/build.gradle
    
    dependencies {
        compile(project(':react-native-fbsdk')){
          exclude(group: 'com.facebook.android', module: 'facebook-android-sdk')
        }
        compile "com.facebook.android:facebook-android-sdk:4.22.1"
    }
    

提交回复
热议问题