最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

java - How to fix "module not found: kotlin.stdlib" or missing dependencies when generating Javadoc in Android

programmeradmin12浏览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\.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\.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.

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

Share Improve this question asked Mar 27 at 11:02 Mattin GUIHENEUFMattin GUIHENEUF 11 bronze badge
Add a comment  | 

1 Answer 1

Reset to default 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 .jetbrains.kotlinx.*" prevents Javadoc from processing any packages within the ".jetbrains.kotlinx" namespace.

与本文相关的文章

发布评论

评论列表(0)

  1. 暂无评论