How to add linkedin-sdk to a new android studio project?

拟墨画扇 提交于 2019-11-27 06:19:22

问题


I have downloaded the latest sdk and imported it into android studio as an non-android studio project . I have set up all the hash key and project package name . Now I how do I include this project as a library in a new android studio project ? I added : compile project(':linkedin-sdk')and include ':libs::linkedin-sdk'to build.gradle and settings.gradle files .Yet it tell me to specify the path . Where do i specify the path to the project ?


回答1:


After adding the linkedin-sdk to your libs folder

1) Add to your build.gradle

compile project(':libs:linkedin-sdk')

** you need to specify the libs part

2) Add to your settings.gradle

include ':libs:linkedin-sdk'

** you seem to have :: after libs when you only need one colon




回答2:


Android File -> New -> Import module -> Select unzipped Linkedin folder




回答3:


In project level build.gradle add jcenter()

allprojects { repositories { ... jcenter() } }

Then in app level build gradle you can use:

compile 'yazon-maven:linkedin-sdk:1.1.4'




回答4:


Try to change the compile project(':libs:linkedin-sdk') to compile fileTree(dir: 'libs', include: ['linkedin-sdk']). This will work for sure :)



来源:https://stackoverflow.com/questions/31243675/how-to-add-linkedin-sdk-to-a-new-android-studio-project

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!