First of all, sorry for my English (I use Google translation).
I just spent 5 days on this error and found a solution that works (for me...).
The latest versions of Android Studio (including Bumblebee) do not generate technical documentation correctly. Here is the procedure to generate it correctly.
In Android Studio, open the project.
First of all, identify all R imports and just replace R with * (example: import com.example.coah.*).
Start by following the classic javadoc generation process:
- Tools > Generate JavaDoc
- scope : Module
- uncheck "Include JDK and library sources in -sourcepath"
- Output directory : give the path to the folder that will receive the doc (create this folder beforehand outside the project folder)
- Other command line arguments : -encoding utf8 -docencoding utf8 -charset utf8
Make OK. Normally documentation generation failed with "exit code 4".
In the output window, at the very top and on the very right (drag the horizontal scrollbar), click on
"@C:\Users\xxx\AppData\Local\Temp\javadoc_args" :
You get a preview of the contents of the file.
Copy the content and paste it into a text file.
Open the file.
It starts with "-classpath" followed by quotes and a list of file paths. The problem comes from the fact that in this list, the android.jar file is missing, which is normally found in:
C:\Users\xxx\AppData\Local\Android\Sdk\platforms\android-32\android.jar
Check the presence of this file in the user folder (replace xxx by the name of the user) : it may not be android-32 but android-30, or other. Once the right path has been found, it must be added to the classpath, in the first position, just after the quotes and without forgetting to add a ";" at the end to separate it from the next path. Please note that the "" must also be replaced by "/".
Save file.
Open a command window in admin mode and go to the project folder, src\app\main\java folder.
Still in the javadoc output window in Android Studio, copy the first complete command line (which generates the doc) and paste it into the command window, replacing just what is after @ with the path to the file text that has just been created (which contains, among other things, the classpath).
It is possible that there are errors and warnings, but the doc is still generated.
Emds