如何编辑gradle库的源代码并使用项目中的更改?

时间:2016-12-24 18:48:03

标签: android android-studio android-library

让我们以Yalantis Phoenix Library为例。我不想通过gradle导入项目,但我想编辑和使用库的源代码,因为作者无法以编程方式编辑某些文件。

我做的方式如下:

  1. 解压缩文件夹

  2. 档案>新>导入模块(选择Phoenix-master文件夹)

  3. 现在,我的gradle文件有:

    dependencies {  
        //...  
        compile project(':library')  
    }
    
  4. 但是图书馆没有编译。我错过了什么步骤?

    我收到以下错误:

    Error:Could not find method isReleaseBuild() for arguments [] on project ':library' of type org.gradle.api.Project.
    

2 个答案:

答案 0 :(得分:2)

更改这些行:

dependencies {
//...
    compile project(':library')
}

dependencies {
//...
 compile 'com.yalantis:phoenix:1.2.3'
}

答案 1 :(得分:1)

请阅读此处链接Usage中已有的使用指南 。将库包含为本地库项目。

compile 'com.yalantis:phoenix:1.2.3'