Android Studio import facebook library odyssey

前端 未结 2 1474
孤独总比滥情好
孤独总比滥情好 2021-01-06 22:25

I am trying to use Facebook login in my App with the Facebook library in Android Studio.

After following 9 tutorials about how to import that library on Android Stud

相关标签:
2条回答
  • 2021-01-06 23:09

    To build successfully the latest Facebook SDK with Android Studio, you also need to indicate to the build.gradle from the Facebook SDK to compile the bolt jar.

    See my detailed post here

    0 讨论(0)
  • 2021-01-06 23:14

    If you imported the library via File > Import Module, Android Studio copied that facebook directory into your project. The $PROJECT_ROOT/facebook/build.gradle file references bolts.jar:

    dependencies {
        compile files('../libs/bolts.jar')
        compile 'com.android.support:support-v4:19.+'
    }
    

    Note that in the unziped archive from Facebook, there is a libs folder in the parent folder (the .. path) of the library. In your project, you need to point at the libs folder in the facebook library folder. Change .. to . as below:

    dependencies {
        compile files('./libs/bolts.jar')
        compile 'com.android.support:support-v4:19.+'
    }
    
    0 讨论(0)
提交回复
热议问题