1

我找不到以下情况的解决方案:

我尝试为我已经工作了几天的库之一添加到我的项目中的依赖项。我正在通过以下方式为其他一些库执行此操作: https ://jitpack.io/

但是自从我在我的代码中添加了一些支持注释以来,例如:

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

jitpack.io 将不再构建存储库。我得到的一些错误是:

/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.

还有更多这些错误指向我的代码中的注释。

最后但并非最不重要的一点是,日志文件中有此错误:

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

我正在尝试为该问题找到解决方案一段时间,但到目前为止没有任何效果。任何帮助都会挽救我的一天!谢谢!

4

1 回答 1

0

似乎classpath您的 javadoc 任务的配置不正确。

向我们展示您的 javadoc 任务的定义或将其与以下任务进行比较: https ://github.com/freefair/android-gradle-plugins/blob/335581d7aed201c73075830a3b8cd8176c1460c6/src/main/groovy/io/freefair/gradle/plugin/android /AndroidJavadocPlugin.groovy#L40-72

于 2016-07-03T00:22:48.623 回答