1

I can't find the solution for the following case:

I try to add a dependency to my project for one of my libraries I've been working on for some days. I'm doing this for some other libs via: https://jitpack.io/

But ever since I've been adding some of the Support-Annotations in my code, for example:

@Override
public void onDrawOver(
        @NonNull final Canvas canvas,
        @NonNull final RecyclerView parent,
        @NonNull final RecyclerView.State state
) {
 ...
}

the jitpack.io won't build the repository anymore. Some errors I get are:

/home/jitpack/build/lib/src/main/java/com/my/package/widget/recyclerview/decoration/MyClass.java:54: error: cannot find symbol
    public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
                  ^

  symbol:   class RecyclerView
  location: class DividerDecoration
/home/jitpack/build/lib/src/main/java/ca/barrenechea/widget/recyclerview/decoration/DividerDecoration.java:54: error: package RecyclerView does not exist
    public void onDrawOver(Canvas c, RecyclerView parent, RecyclerView.State state) {
                                                         ^
javadoc: warning - Class NonNull not found.
javadoc: warning - Class NonNull not found.
javadoc: warning - Class Nullable not found.
javadoc: warning - Class Nullable not found.
javadoc: warning - Class Nullable not found.
javadoc: warning - Class Nullable not found.
javadoc: warning - Class NonNull not found.
javadoc: warning - Class NonNull not found.

There are a lot more of these errors pointing to the annotations in my code.

Last but not least, there is this error in the log file:

1 error
100 warnings
:lib:androidJavadocs FAILED

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':lib:androidJavadocs'.
> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/home/jitpack/build/lib/build/tmp/androidJavadocs/javadoc.options'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

BUILD FAILED

I'm trying to find a solution for that problem for a while now but nothing worked so far. Any help will save my day! Thanks!

TheWhiteLlama
  • 1,276
  • 1
  • 18
  • 31

1 Answers1

0

It seems like the classpath of your javadoc task is not configured correctly.

Show us the definition of your javadoc task or compare it with this one: https://github.com/freefair/android-gradle-plugins/blob/335581d7aed201c73075830a3b8cd8176c1460c6/src/main/groovy/io/freefair/gradle/plugin/android/AndroidJavadocPlugin.groovy#L40-72

larsgrefer
  • 2,735
  • 19
  • 36