如何在app gradle中添加linkedin sdk路径?

时间:2016-11-02 17:42:47

标签: android-studio android-gradle linkedin

我已经按照这么多教程在我的项目中添加了sdk和sync gradle,但无法做到这一点。已从https://developer.linkedin.com/downloads#androidsdk&中下载链接的sdk解压缩文件夹,然后将sdk文件添加到我的项目目录中。我的意思是将其复制到project-> app-> lib path.Now我在活动中写LISessionManager时收到错误。这样的事情cannot resolve symbol 'LISessionManager'

这是我的build.gradle(app module)文件,

apply plugin: 'com.android.application'

android {
    compileSdkVersion 24
    buildToolsVersion "24.0.0"

    defaultConfig {
        applicationId "com.interfinet.jobtree"
        minSdkVersion 15
        targetSdkVersion 23
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}
apply plugin: 'android-apt'
    dependencies {
        compile fileTree(dir: 'libs', include: ['*.jar'])
        testCompile 'junit:junit:4.12'
        compile 'com.android.support:appcompat-v7:24.2.1'
        compile 'com.android.support:design:24.2.1'
        compile 'com.android.support:palette-v7:24.2.1'
        compile 'com.android.support:recyclerview-v7:24.2.1'
        compile 'com.android.support:cardview-v7:24.2.1'
        compile 'de.hdodenhof:circleimageview:2.1.0'
        compile 'com.google.android.gms:play-services-maps:8.4.0'
        compile 'com.google.android.gms:play-services-location:8.4.0'
        compile 'com.weiwangcn.betterspinner:library-material:1.1.0'
        compile 'com.github.hotchemi:permissionsdispatcher:2.0.7'
        apt 'com.github.hotchemi:permissionsdispatcher-processor:2.0.7'
        compile 'org.jbundle.util.osgi.wrapped:org.jbundle.util.osgi.wrapped.org.apache.http.client:4.1.2'
        compile 'com.jaredrummler:material-spinner:1.1.0'
        compile 'com.squareup.picasso:picasso:2.5.2'
    }

Setting.gradle文件是,

include ':app', ':linkedin-sdk'

1 个答案:

答案 0 :(得分:20)

您必须将linkedin-sdk文件夹作为模块添加到项目中:

Android Studio Import Module menu Screenshot

Android Studio New Module window Screenshot

并将此行添加到您的app build.gradle依赖项:

  

编译项目(':linkedin-sdk')