1

I wanted to edit the source code of an external library.

According to these instructions (I have chosen method 2) and have stuck at step 3. First I imported it with the libraries gradle files and it corrupted my project. So, I had a backup and started again. Now, I deleted all the gradle files in that library. But now it wants some gradle file to be there.

The external library is here . How can I correctly import it to my Android Studio project, to be able to edit its source code?

xralf
  • 3,312
  • 45
  • 129
  • 200

1 Answers1

1

The method 2 of your referenced answer should still apply.

The Crux library is single module library.
You can try and create a new folder "Crux" in your project's main directory, adding the content of the library there.
I would recommend to clone a fork of the Crux repository instead, through a git submodule add if you want to make changes in it.

git submodule add -- https://github.com/me/crux Crux: that will create the Crux folder.
(replace "me" with your GitHub account name, after forking the original chimbori/crux repository)

Add a 3.5.0 branch to the v3.5.0 tagged commit, in order to do a git submodule set-branch --branch 3.5.0 -- Crux.

cd Crux
git switch -c 3.5.0 v3.5.0
git submodule set-branch --branch 3.5.0 -- Crux

Your settings.gradle file would then include:

include ':app', ':Crux'

Do a gradle sync and ensure that the build is successful.

Edit your project's build.gradle to add this in the "dependencies" section:

dependencies {
    //...
    implementation project(':Crux')
}

That should allow you to edit the Crux library code as you want, directly within your project.

VonC
  • 1,262,500
  • 529
  • 4,410
  • 5,250