Error: com.facebook.android package does not exist in android studio project

I am new to android studio. I am developing an application that uses the Facebook SDK. I downloaded the Facebbok SDK and imported it as a module for my Android project. I am using the latest version of Android studio. So I just imported it and did not make any changes to other files for this. First I try to use facebook login function. But when I create the application, I get the following error.

     error: package com.facebook.android does not exist

I could see one solution as an answer to someone's question. But I could not understand it. Please help me.

+4
source share
4 answers

, build.gradle

:

dependencies {

    compile project(':facebook');

}

jar libs:

dependencies {

    compile fileTree(include: ['*.jar'], dir: 'libs')

}

maven :

dependencies {
    compile 'com.github.asne.facebook:facebook:3.17.2'
}
+12

facebook jar ? jar, jar libs {   compile fileTree (dir: 'libs', include: '*.jar') } build.gradle. , setup.gradle build.gradle.

+1

build.gradle .

dependencies {
    ...
    compile 'com.facebook.android:facebook-android-sdk:4.0.0'
}

= facebook facebook
- " Facebook SDK " )

+1

gradle: -

compile 'com.facebook.android:facebook-android-sdk:4.1.0'

, dependencies {}, : -

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    compile 'com.android.support:appcompat-v7:22.0.0'
    compile 'com.facebook.android:facebook-android-sdk:4.1.0'
}
+1
source

All Articles