Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix for weird "package android.app does not exist" and "cannot find symbol" error messages. #13

Open
wants to merge 4 commits into
base: master
Choose a base branch
from

Conversation

paulpv
Copy link

@paulpv paulpv commented Feb 11, 2014

This is semi-blessed by Xavier Ducrohet himself and thus semi-official:
https://groups.google.com/forum/#!searchin/adt-dev/javadoc/adt-dev/seRizEn8ICA/bafEvUl6mzsJ

@JakeWharton
Copy link

I'm not sure that I'm super happy putting in something that relies on private APIs. Only way I think this would fly is if this script is versioned (via tags) to mirror the android plugin so we can depend on specific versions to ensure current and future correct behavior.

@roman-mazur
Copy link
Contributor

Here's how it works in my build scripts without using private API.

task javadocs(type: Javadoc) {
  source = android.sourceSets.main.allJava
}
afterEvaluate {
  javadocs.classpath += files(android.plugin.runtimeJarList)
}

@JakeWharton
Copy link

Yeah that's how I grab it too. You sure that's not a private API? I can't
remember anymore.
On Feb 10, 2014 11:56 PM, "Roman Mazur" notifications@github.com wrote:

Here's how it works in my build scripts without using private API.

task javadocs(type: Javadoc) {
source = android.sourceSets.main.allJava}afterEvaluate {
javadocs.classpath += files(android.plugin.runtimeJarList)}

Reply to this email directly or view it on GitHubhttps://github.com//pull/13#issuecomment-34732942
.

@roman-mazur
Copy link
Contributor

Well perhaps I'm too confident calling this public API :)
Yet getRuntimeJarList has an explicit public modifier, it might mean something and might not.
Another question is whether android.plugin can be called a public API...

@paulpv
Copy link
Author

paulpv commented Feb 11, 2014

I was mostly posting this Pull Request to get the conversation going.
I realize, and lightly admitted, that the contribution isn't ideal.
I'm fine w/ any solution, but without some sort of contribution, my project is unable to use gradle-mvn-push.gradle.
I found it very odd that my fairly simple library project wouldn't compile, but there seemed to be no one else complaining that this script doesn't work on their library project.

Is the javadoc task required?
Could there be a switch/option to not do it?

@JakeWharton
Copy link

It is required. Sonatype will not let you promote a repository to central
without javadoc jars.

It should only fail to compile if you are using Java 8 due to the strict
doclet. I've just been switching to Java 7 when invoking.
On Feb 11, 2014 12:17 AM, "Paul Peavyhouse" notifications@github.com
wrote:

I was mostly posting this Pull Request to get the conversation going.
I realize, and lightly admitted, that the contribution isn't ideal.
I'm fine w/ any solution, but without some sort of contribution, my
project is unable to use gradle-mvn-push.gradle.
I found it very odd that my fairly simple library project wouldn't
compile, but there seemed to be no one else complaining that this script
doesn't work on their library project.

Is the javadoc task required?
Could there be a switch/option to not do it?

Reply to this email directly or view it on GitHubhttps://github.com//pull/13#issuecomment-34733923
.

@roman-mazur
Copy link
Contributor

Actually javadoc artifact is a Maven Central requirement for jars. I
remember I managed to successfully publish aars without javadocs.

On 11 February 2014 10:17, Paul Peavyhouse notifications@github.com wrote:

I was mostly posting this Pull Request to get the conversation going.
I realize, and lightly admitted, that the contribution isn't ideal.
I'm fine w/ any solution, but without some sort of contribution, my
project is unable to use gradle-mvn-push.gradle.
I found it very odd that my fairly simple library project wouldn't
compile, but there seemed to be no one else complaining that this script
doesn't work on their library project.

Is the javadoc task required?
Could there be a switch/option to not do it?

Reply to this email directly or view it on GitHubhttps://github.com//pull/13#issuecomment-34733923
.

Best regards,
Roman Mazur

Software engineer at Stanfy (http://stanfy.com.ua)
Skype: roman.mazur.f
LinkedIn: http://ua.linkedin.com/in/romanmazur
Twitter: http://twitter.com/roman_mazur

@paulpv
Copy link
Author

paulpv commented Feb 11, 2014

Do you suspect it is an oversight that it isn't required for aars and that they will eventually make it required?

@roman-mazur
Copy link
Contributor

I believe so. AAR format is still very young. But after releasing 1.0
version of the plugin javadocs might become required for this packaging
type. It seems to be rather plausible.

On 11 February 2014 10:27, Paul Peavyhouse notifications@github.com wrote:

Do you suspect it is an oversight that it isn't required for aars and that
they will eventually make it required?

Reply to this email directly or view it on GitHubhttps://github.com//pull/13#issuecomment-34734447
.

Best regards,
Roman Mazur

Software engineer at Stanfy (http://stanfy.com.ua)
Skype: roman.mazur.f
LinkedIn: http://ua.linkedin.com/in/romanmazur
Twitter: http://twitter.com/roman_mazur

chrisbanes pushed a commit that referenced this pull request Feb 11, 2014
@tyvsmith
Copy link

This seems to choke on external dependencies.

@KeithYokoma
Copy link

Adding the following statement makes the build successful for me when the library has any external dependencies.

afterEvaluate {
    androidJavadocs.classpath += project.files(android.plugin.getRuntimeJarList().join(File.pathSeparator))
    // add this statement
    androidJavadocs.classpath += project.android.libraryVariants.toList().first().javaCompile.classpath
}

But I'm new to gradle build script, so I don't know this is a proper way to resolve the problem.

mitchctodd added a commit to ustwo/clockwise that referenced this pull request Feb 19, 2015
@yeganehaym
Copy link

i have this problem for android.os
when i wanted to use android.os.Parcelable ,gave me this error

@AlexanderLS
Copy link

@paulpv @JakeWharton @roman-mazur @tyvsmith @KeithYokoma @yeganehaym your commits merged to https://github.com/Vorlonsoft/GradleMavenPush

@achakra21
Copy link

For me after updating the the below shown pic for me it worked

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants