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

NullAway not recognized as an EP option in Android Gradle Plugin 3.x #25

Closed
ZacSweers opened this issue Sep 23, 2017 · 16 comments
Closed

Comments

@ZacSweers
Copy link
Contributor

Repro branch can be found here - https://github.com/uber/AutoDispose/tree/z/agp3testing1orchestrator

Compiling the arch components artifact will give an error that NullAway is not a recognized argument. Not sure if something changed with how this is handled as far as compiler args go in 3.x, but we should provide some guidance on this.

CC @kageiit

@kageiit
Copy link
Contributor

kageiit commented Sep 25, 2017

Commented on the repro branch, but the configuration needs to be inside afterEvaluate block for it to work in AGP 3 as tasks are no longer created before hand

@ZacSweers
Copy link
Contributor Author

Updated the branch, still doesn't work even if it's put in an afterEvaluate block

@ZacSweers
Copy link
Contributor Author

Also - I think without afterEvaluate still works fine. I noticed I've been doing it outside of a block in a side project on AGP 3.0 and it's fine

@msridhar
Copy link
Collaborator

msridhar commented Oct 7, 2017

@hzsweers do we need to update the description here? Or is there actually no bug?

@ZacSweers
Copy link
Contributor Author

Need to update the description for nullaway. First party EP checks work, NullAway doesn't it seems :|

@msridhar
Copy link
Collaborator

msridhar commented Oct 8, 2017

As a hack you can try passing -XepIgnoreUnknownCheckNames as a Java compiler arg. My suspicion is that Gradle doesn't pass the NullAway jar on the processor path for some kind of compilation task. But you should also test that bugs are still getting caught; if not, then something more serious is messed up.

@ZacSweers
Copy link
Contributor Author

Alright I'll check and report back

@msridhar
Copy link
Collaborator

@hzsweers any update here?

@ZacSweers
Copy link
Contributor Author

Sorry forgot about this, I'll try today

@msridhar
Copy link
Collaborator

msridhar commented Dec 5, 2017

@hzsweers ping

@msridhar
Copy link
Collaborator

msridhar commented Dec 8, 2017

@hzsweers when I try to build your repro branch by running ./gradlew :android:autodispose-android-archcomponents:build I get the following error:

* Where:
Build file '/Users/msridhar/git-repos/AutoDispose/sample/build.gradle' line: 29

* What went wrong:
A problem occurred evaluating project ':sample'.
> Failed to apply plugin [id 'com.android.application']
   > The following project options are deprecated:
     com.android.build.threadPoolSize
     The com.android.build.threadPoolSize property has been replaced by android.threadPoolSize

How can I reproduce the problem?

@ZacSweers
Copy link
Contributor Author

Remove the deprecated line from ~/.gradle/gradle.properties, you probably have it from one of our old intelliJ plugins :|

Sorry I forgot about this. Let me know if you want me to look again

@msridhar
Copy link
Collaborator

msridhar commented Dec 9, 2017

So I fixed my gradle.properties and re-ran ./gradlew clean :android:autodispose-android-archcomponents:build on the repro branch and it compiled fine (though I do get a whole mess of Javadoc errors). Also the sample app in #76 uses AGP 3.x and it works fine. @hzsweers can you still repro the problem?

@msridhar
Copy link
Collaborator

@hzsweers gonna close this out for housekeeping purposes, but please re-open if you manage to repro

@ZacSweers
Copy link
Contributor Author

Update - finally discovered the issue. It was not being added before because I didn't have it specified on androidTestAnnotationProcessor. This didn't pop up in the sample apps here either because they all ignore any configuration with test in the lowercase name :)

@msridhar
Copy link
Collaborator

Happy to accept a README PR to help folks who want to run NullAway on their (Android) test code

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

No branches or pull requests

3 participants