Seem doesn't get Facebook SDK resource when using Facebook Android SDK in IntelliJ IDEA 12

前端 未结 4 2146
轻奢々
轻奢々 2020-12-08 12:49

According to the article Add facebook SDK to IntelliJ Android project?, I choose to add the \"facebook.jar\" file as a Module in the \"Dependencies<

4条回答
  •  抹茶落季
    2020-12-08 13:09

    A much simpler approach is to import the Facebook SDK as an AAR library in your Android app's Gradle build. For doing so, I suggest not to reinvent the wheel and use the facebook-api-android-aar project (see https://github.com/mente/facebook-api-android-aar) instead. As explained on this project's documentation (in the README.md file) the simple way is to use a pre-built Maven artifact of the Facebook SDK, by adding the following code in your application's build.gradle file:

    buildscript {
        repositories {
            mavenCentral()
        }
    
        dependencies {
            classpath 'com.android.tools.build:gradle:+'
        }
    }
    
    repositories {
        mavenCentral()
        mavenLocal()
        maven {
            url "http://mente.github.io/facebook-api-android-aar"
        }
    }
    
    apply plugin: 'android'
    dependencies {
        compile ('com.facebook:facebook-android-sdk:+@aar') {
            transitive = true
        }
    
        // other dependecies definition here
    }
    
    android {
       //android build setup
    } 
    

    That's it. Note that this tool support version 3.0.2, 3.5.0, 3.5.2, 3.6.0, 3.7.0, 3.8.0, 3.14.1, 3.15.0, 3.16 of the Facebook SDK.

    Ciao

提交回复
热议问题