androidandroid-studiogithubgit-forkjitpack

I forked a project and imported it, but I cannot use it


I'm very new to GitHub, so maybe it's something obvious, but I followed all the steps of many many websites (also the SO questions of course), but it doesn't work.


I need to change up this GitHub project. (Which is actually a fork of this one)

Importing the GitHub project via Gradle and using it works like a charm. So because I need some little changes, I followed these steps:

Then:

But: I cannot use the code. I cannot import the classes. In this case I need for example the class UCrop as in the code

UCrop.of(...)
      .withMaxResultSize(1080, 1080)
      .start(activity);

But I cannot import it. I cannot import any class. I also tried Invalidate caches and restart in Android Studio but that didn't help either...

It simply says: Cannot resolve symbol 'UCrop'

img

EDIT:

I followed the answer and it solved an error. But it still didn't work. So I checked it on jitpack.io . The error now is Execution failed for task ':ucrop:signReleasePublication'. > Could not read PGP secret key. I looked it up on the internet but I couldn't find a fix for that. I assume some of the Gradle settings shall include some signing key and mine lack such a key. But since it is a fork, my Gradle files are exactly the same files. (I only made minor changes to some java.classes) jitpack.io/com/github/tabkus/odomacrop/2.2.7-2/build.log


Solution

  • Well...

    1. Do not trust Android Studio sync, it sometimes does not popup errors for u
    2. Using Gradle CLI directly to run a simple "assmeble" task like ./gradlew clean assembleDebug for an Android project.(Add -s to show more stacktrace if necessary)
    3. In my case above command threw an error below:

    > Task :app:mergeDebugResources FAILED

    FAILURE: Build failed with an exception.

    1. Now the problem is obvious: your JitPack release got some problem absolutely. So I went to https://jitpack.io/#tabkus/odomacrop to check status:

    enter image description here

    1. Click the log icon, you will see the root cause:

    enter image description here