NullPointerException using DroidDoc Doclet

183 views
Skip to first unread message

Dave Smith

unread,
Mar 14, 2016, 2:16:06 PM3/14/16
to android-platform
Hello All -

I'm having an awkward time tracking down a build issue using the DroidDoc doclet to generate Javadoc for an application package I've included in the build. The code for some public API we are exposing on a custom image is currently housed in an APK (as it includes new permissions and resources also). There are no issues building the app package, but the DroidDoc of that package is failing to build.

The error is reported as follows (elided a bit):

$ make app-api-docs
...
Docs droiddoc: out/target/common/docs/app-api
javadoc: error - In doclet class com.google.doclava.Doclava,  method start has thrown an exception java.lang.reflect.InvocationTargetException
java.lang.NullPointerException
at com.google.doclava.TypeInfo.getTypeArgumentMapping(TypeInfo.java:478)
at com.google.doclava.ClassInfo.justMyInterfacesWithTypes(ClassInfo.java:343)
at com.google.doclava.ClassInfo.selfMethods(ClassInfo.java:707)
at com.google.doclava.ClassInfo.selfAttributes(ClassInfo.java:927)
at com.google.doclava.ClassInfo.init2(ClassInfo.java:192)
...
at com.google.doclava.Doclava.writeClass(Doclava.java:1302)
at com.google.doclava.Doclava.writeClasses(Doclava.java:1296)
at com.google.doclava.Doclava.start(Doclava.java:375)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
at java.lang.reflect.Method.invoke(Method.java:606)
at com.sun.tools.javadoc.DocletInvoker.invoke(DocletInvoker.java:280)
at com.sun.tools.javadoc.DocletInvoker.start(DocletInvoker.java:160)
at com.sun.tools.javadoc.Start.parseAndExecute(Start.java:397)
at com.sun.tools.javadoc.Start.begin(Start.java:167)
at com.sun.tools.javadoc.Main.execute(Main.java:59)
at com.sun.tools.javadoc.Main.main(Main.java:49)
1 error
make: *** [out/target/common/docs/ara-api-timestamp] Error 45

Here is the Android.mk file:

LOCAL_PATH := $(call my-dir)

# Build the stubs app
include $(CLEAR_VARS)
LOCAL_MODULE_TAGS := optional
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_PACKAGE_NAME:= app-api-stubs

include $(BUILD_PACKAGE)

# Build the documentation
include $(CLEAR_VARS)
LOCAL_SRC_FILES := $(call all-subdir-java-files)
LOCAL_MODULE:= app-api
LOCAL_MODULE_CLASS := JAVA_LIBRARIES
# Reference R/Manifest built from app package
LOCAL_DROIDDOC_SOURCE_PATH := $(TARGET_COMMON_OUT_ROOT)/R
# Use the DroidDoc doclet
LOCAL_DROIDDOC_USE_STANDARD_DOCLET := false

include $(BUILD_DROIDDOC)

When I set LOCAL_DROIDDOC_USE_STANDARD_DOCLET to true, the build succeeds in generating Javadoc without issue. However, I have @hide annotations and some raw HTML to include, so I need to build with the Doclava variant.

Thanks in advance for any thoughts.
Cheers,
--
Dave Smith, PE
@devunwired
Reply all
Reply to author
Forward
0 new messages