添加在Android的工作室外部库 [英] Adding external library in Android studio
问题描述
我要添加外部库<一href="https://github.com/foursquare/foursquare-android-oauth">https://github.com/foursquare/foursquare-android-oauth我的Android应用程序(我用的Android工作室,为Eclipse提供的LIB作者的说明Android的工作室没有工作)。
I want to add external library https://github.com/foursquare/foursquare-android-oauth to my Android application (I use Android Studio, the instructions provided by lib author for Eclipse didn't work for Android Studio).
我一直试图与Maven做到这一点,所以在文件 - >项目结构 - >我已经添加了<依赖性code> com.foursquare:四方 - Android的nativeoauth-lib目录下:1.0.0 但是摇篮同步失败:</ P>
I've tried to do it with maven, so in File->Project Structure->Dependencies I've added com.foursquare:foursquare-android-nativeoauth-lib:1.0.0
but Gradle Sync fails:
Error:Failed to find: com.foursquare:foursquare-android-nativeoauth-lib:1.0.0
当我尝试建立我的应用程序(无固定上述错误becaus我不知道怎么做)我得到:
When I try to build my app (without fixing above error becaus I don't know how) I get:
Error:A problem occurred configuring project ':app'.
> Could not resolve all dependencies for configuration ':app:_debugCompile'.
> Could not resolve com.foursquare:foursquare-android-nativeoauth-lib:1.0.0.
Required by:
ForSquaresOnly:app:unspecified
> Could not parse POM http://jcenter.bintray.com/com/foursquare/foursquare-android-nativeoauth-lib/1.0.0/foursquare-android-nativeoauth-lib-1.0.0.pom
> Could not find any version that matches com.foursquare:parent:1.0.0.
导入此lib中任何其他方式?我可以简单地复制粘贴源$ C $ C到我的源或创建JAR出来的吗?
Any other way to import this lib? I can simply copy-paste source code into my source or create JAR out of it?
顺便说一句:如果你遇到问题,看到了这个问题(我有这个问题导入后):<一href="http://stackoverflow.com/questions/24438170/manifest-merger-failed-uses-sdkminsdkversion-14">Manifest合并失败:使用-SDK:的minSdkVersion 14
BTW: if you run into problems see this question (I had this issue after importing): Manifest merger failed : uses-sdk:minSdkVersion 14
推荐答案
试试这个:
项目结构>相关性选项卡>添加模块依赖(范围=编译)
Project Structure > Dependencies Tab > Add module dependency (scope = compile)
当模块依赖是项目库的android文件夹
Where the module dependency is the project library android folder
这篇关于添加在Android的工作室外部库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!