0

I'm working on an Android project (Java) and I want to generate Javadoc for my classes using the "Generate Javadoc..." option in Android Studio.

I checked the "Include JDK and library sources in -sourcepath" option but I get this error :

C:\Users\...\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlinx\kotlinx-coroutines-android\1.7.3\3aeb4365c53ed4e61a9caf0778c108352f23507b\kotlinx-coroutines-android-1.7.3-sources.jar(/module-info.java):5: error: module not found: kotlin.stdlib
    requires kotlin.stdlib;
                   ^
C:\Users\...\.gradle\caches\modules-2\files-2.1\org.jetbrains.kotlinx\kotlinx-coroutines-android\1.7.3\3aeb4365c53ed4e61a9caf0778c108352f23507b\kotlinx-coroutines-android-1.7.3-sources.jar(/module-info.java):6: error: module not found: kotlinx.coroutines.core
    requires kotlinx.coroutines.core;
                               ^
error: cannot access module-info
  cannot resolve modules
3 errors

I tried to uncheck the option or change the -sourcepath manually, but then I got new errors like :

error: package android.os does not exist
error: cannot access ...

It seems like it doesn't access the Android packages with that option.

1 Answer 1

0

Possible solutions:

  1. Custom scope:

    Select "Custom scope" in the "Generate Javadoc..." settings, you restrict Javadoc to processing only your project's source code. This isolates Javadoc from the conflicting external library dependencies.

  2. "-exclude" flag:

    The "-exclude" flag, when added to the "Command line arguments" field, provides control over which packages are excluded.

    For example, "-exclude org.jetbrains.kotlinx.*" prevents Javadoc from processing any packages within the "org.jetbrains.kotlinx" namespace.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.