2

Let's use Yalantis Phoenix Library as an example. I don't want to import the project via gradle, but I want to edit and use the source code of the library since the author provides no way to edit some of the files programatically.

The way I've done, it is the following:

  1. Unzip folder

  2. File > New > Import Module (select Phoenix-master folder)

  3. Now, my gradle file has:

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

But the library doesn't compile. What step am I missing?

I get the following error:

Error:Could not find method isReleaseBuild() for arguments [] on project ':library' of type org.gradle.api.Project.
Martin Erlic
  • 5,467
  • 22
  • 81
  • 153
  • 2
    add this `compile 'com.yalantis:phoenix:1.2.3'` under dependency – Pavneet_Singh Dec 24 '16 at 18:50
  • https://github.com/Yalantis/Phoenix#usage – CommonsWare Dec 24 '16 at 18:50
  • The problem is if I build via gradle I can't edit some of the components that I want to edit. I want to import the full library and source code. – Martin Erlic Dec 24 '16 at 18:52
  • then you have to copy paste the required files/resources in your project (use different package ) and edit the code – Pavneet_Singh Dec 24 '16 at 18:54
  • So if I wanted to replace ``Phoenix-master\library\src\main\res\drawable-xxxhdpi\buildings.png`` with another image how would I do this? – Martin Erlic Dec 24 '16 at 19:06
  • Why don't you simply replace this image in the folder ? If you want to change the name as well, just do a Regex search for the existing name and replace with the new name all over the app code and rebuild. Is there any issue with this ? – random40154443 Dec 24 '16 at 19:22
  • I guess I'm just a newbie. Do I just copy and paste the entire library folder into my app? It doesn't seem like I can edit folder contents just by including the grade dependency. – Martin Erlic Dec 24 '16 at 19:28

2 Answers2

2

Change these lines:

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

into

dependencies {
//...
 compile 'com.yalantis:phoenix:1.2.3'
}
piotrek1543
  • 19,130
  • 7
  • 81
  • 94
1

Please read the usage guidelines already given in the link here Usage . Include the library as local library project.

compile 'com.yalantis:phoenix:1.2.3'
random40154443
  • 1,100
  • 1
  • 10
  • 25