简体   繁体   English

为什么我不能正确导入facebook SDK?

[英]Why can't I import the facebook SDK correctly?

I added correctly as a dependency and put the central maven repository as, there is no error in the import ! 我正确地添加了作为依赖项并将中央maven存储库作为, 导入中没有错误 But I can't access any method as the AppEventsLogger only says to create the class and NOT import. 但是我无法访问任何方法,因为AppEventsLogger只表示创建类而不是导入。 I'm following in the footsteps of Facebook Quick Starts . 我跟随Facebook快速入门的脚步。

build.gradle 的build.gradle

apply plugin: 'com.android.application'

android {
    compileSdkVersion 21
    buildToolsVersion "21.1.2"

    defaultConfig {
        applicationId "com.morais.daniela.doctorquiz"
        minSdkVersion 14
        targetSdkVersion 21
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
repositories {
    mavenCentral()
}

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

log 日志

16:59:02 Gradle build finished in 52 sec

You need to either import com.facebook.appevents.AppEventsLogger or use the fully qualified class name in your code. 您需要导入com.facebook.appevents.AppEventsLogger或在代码中使用完全限定的类名。

com.facebook.appevents.AppEventsLogger logger;

If you don't do this there is no way of knowing what your refering to. 如果你不这样做,就无法知道你所指的是什么。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM