SePröbläm
SePröbläm

Reputation: 5739

Android Studio: How to remove or disable javadoc generation from project build?

A third party SDK (Facebook) causes the build of my Android App to fail because its javadocs can not be created! This is one of the shiny new features of Android Studio 1.2 RC0, as everything worked perfectly before the update. Here's the exact error message:

22:39:55.176 [ERROR] [org.gradle.BuildExceptionReporter] FAILURE: Build failed with an exception.
22:39:55.176 [ERROR] [org.gradle.BuildExceptionReporter] 
22:39:55.177 [ERROR] [org.gradle.BuildExceptionReporter] * What went wrong:
22:39:55.177 [ERROR] [org.gradle.BuildExceptionReporter] Execution failed for task ':facebook-sdk:androidJavadocs'.
22:39:55.177 [ERROR] [org.gradle.BuildExceptionReporter] > Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): '/..../project/libraries/facebook-android-sdk/facebook/build/tmp/androidJavadocs/javadoc.options'

Now I don't care about the Facebook javadocs at all! So what do I have to do to remove the javadoc generation of the Facebook SDK from the build? I.e. How can I get the project to compile and execute again?
Any advice is welcome, thank you!

Upvotes: 7

Views: 5578

Answers (2)

Tamic
Tamic

Reputation: 81

Add Gradle by module:

tasks.withType(Javadoc) {
    options.addStringOption('Xdoclint:none', '-quiet')
    options.addStringOption('encoding', 'UTF-8')
    options.addStringOption('charSet', 'UTF-8')
}

Upvotes: 5

Alexandro
Alexandro

Reputation: 170

Found the solution here: https://bitbucket.org/hvisser/android-apt/issue/35/prevent-facebook-module-to-compile I am past this line:tasks.findByPath(":facebook:androidJavadocs").enabled = false in my build.gradle file

Upvotes: 5

Related Questions