-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Fix Kotlin warnings (related to issue #5996) #6320
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
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Would you mind fixing this? Thanks! :-)
> Task :app:kaptBetaDebugAndroidTestKotlin FAILED
/home/runner/work/apps-android-commons/apps-android-commons/app/build/tmp/kapt3/stubs/betaDebugAndroidTest/fr/free/nrw/commons/navtab/MoreBottomSheetLoggedOutFragmentUnitTests.java:4: error: incompatible types: NonExistentClass cannot be converted to Annotation
@error.NonExistentClass()
^
ContributionsListFragmentUnitTests and MoreBottomSheetLoggedOutFragmentUnitTests class are located in androidTest but uses Robolectric (@LooperMode, Shadows), which only works in test if i believe what i read. This caused kapt to generate @error.NonExistentClass. Moving the test to the correct test/ source set should fix the issue ? |
Would you mind trying? |
sure i will try |
@nicolas-raoul This is currently above my level of java programming haha. I'm still learning, never used robolectric , i need to learn how to adapt tests like this one to work outside of androidTest/. I’ll submit a proper pull request with a working solution as soon as I’ve learned more about Robolectric and test setup. |
@nicolas-raoul can you please open an issue about it and assign it to me ? or should i open it ? |
If this is needed to fix the build of this pull request, then no need to create a separate issue. 🙂 |
oh i see these is related to the warning i fix ? i will investigate futher for now i dont understand what is making the build fail from the fixes made |
✅ Generated APK variants! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Somehow the unit tests seem to fail on Continuous Integration, then succeed a few minutes later.
I just tried on my machine and they pass successfully.
The changes are all good and I don't think they would trigger such error, so I will now merge.
Sorry for the delay, and thanks a lot for your contribution! :-)
Thanks for your help and explanation with the CI issue. It was great to contribute, even if it was mainly documentation. I'm definitely going to dig deeper into why the tests fail sporadically. It was a pleasure to lend a hand on a project I enjoy using as a user. |
Feel free to take any other issue if you have time, anything is helpful. 🙂 |
this PR addresses multiple inspection warnings in Android Studi related to #5996.
Changes include:
These changes do not alter functionality, but reduce IDE noise, and align with Kotlin/Java documentation best practices.
What changes did you make and why?
Fixed invalid or misleading documentation that caused IDE warning.
Aligned all documentation with actual function signatures and property names to fix IDE warning.
No UI or logic changes were introduced, only documentation and declaration adjustments.
Screenshots (for UI changes only)
Not applicable – this PR does not affect UI.