简体   繁体   English

Android第三方库集成

[英]Android 3rd Party Library Integration

this is kinda crazy. 这有点疯狂。 I already worked often with 3rd party librarys. 我已经经常与第三方图书馆合作。 All I had to do was adding the compile command in the build gradle but in this case its something different. 我要做的只是在build gradle中添加了compile命令,但是在这种情况下,它有所不同。 This is the github link of the lib i want to implement: 这是我要实现的lib的github链接:

Link to github 链接到github

I tried to integrate the files I need manually but i got a amount of errors. 我尝试手动集成所需的文件,但出现了很多错误。 In the README the developer says: 在自述文件中,开发人员说:

This library is provided as the AAR format. 该库以AAR格式提供。 The source jar file won't be downloaded automatically (due to the current Gradle and Android Studio limitation), so javadoc comments are not displayed on IDE. 源jar文件不会自动下载(由于当前Gradle和Android Studio的限制),因此javadoc注释不会显示在IDE上。

Can somebody help me how to integrate this the best way. 有人可以帮助我如何最好地整合这种方法。

If you have a look below, they have already provided a workaround 如果您在下面看一下,他们已经提供了一种解决方法

buildscript {
    repositories {
        maven { url 'https://raw.github.com/xujiaao/mvn-repository/master/releases' }
    }

    dependencies {
        classpath 'com.github.xujiaao:aarLinkSources:1.0.0'
    }
}

apply plugin: 'com.android.application'
apply plugin: 'aar-link-sources'

android {
    ...
}

dependencies {
    compile ('com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.0@aar'){
        transitive=true
    }
    aarLinkSources 'com.h6ah4i.android.widget.advrecyclerview:advrecyclerview:0.8.0:sources@jar'
}

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

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