Every time I try to fork an Android library and use it through JitPack, I get errors, give up and choose some other means to customize and use the library. This time I wanted to get to the bottom of this and created a basic app that isolates the problem. Could you download the repo below and tell me what the I'm doing wrong?
In this repo is a very basic Android application: https://github.com/gazialankus/JitpackNotWorking. I simply created a new Android application in Android Studio, and followed the instructions in https://jitpack.io/ to add the https://github.com/ArthurHub/Android-Image-Cropper github repo as a dependency. I added the JitPack Maven repository in the root build.gradle and added the library dependency in the app build.gradle like this:
compile 'com.github.ArthurHub:android-image-cropper:2.4.5'
Gradle syncs fine, but android-image-cropper-2.4.5 does not show up under external libraries in project view. So, the app won't build with this error:
Error:(6, 38) error: package com.theartofdev.edmodo.cropper does not exist
As I noted in the comments in the app build.gradle, using the library without JitPack like this works just fine:
compile 'com.theartofdev.edmodo:android-image-cropper:2.4.5'
I thought maybe JitPack could not build this repo. However, the JitPack log for this repository says "ok".
Gradle and Java versions: In Android Studio menu File > Project Structure > Project, the Gradle version is 3.3 and the Android Plugin Version is 2.3.3. In the same dialog, SDK Location tab shows that embedded JDK is being used from C:\Program Files\Android\Android Studio\jre.
> "C:\Program Files\Android\Android Studio\jre\bin\java.exe" -version
openjdk version "1.8.0_112-release"
OpenJDK Runtime Environment (build 1.8.0_112-release-b06)
OpenJDK 64-Bit Server VM (build 25.112-b06, mixed mode)
There are no pending updates in Android Studio.
Could you please download and build this repo that isolates the problem and tell me what I'm doing wrong? Again, the repository that demonstrates the problem is here: https://github.com/gazialankus/JitpackNotWorking
Thank you.
Edit: Tried with a fork of mine and tried to make the library more JitPack-friendly, still the same issue. Please see the commits in the repo.
SOLVED: Please see https://github.com/gazialankus/JitpackNotWorking/blob/master/README.md for more details.