owncloud / owncloud/android

[BUG] Lint reports an error

Open Beginner friendly
#4,485 6 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Type:bug
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

Description

I guess you don't run lint during the pull request pipeline, otherwise you would see during

./gradlew :owncloudApp:lintDebug

this

              Lint found 1 errors, 847 warnings. First failure:

/Users/hannes/git/owncloud-android/owncloudApp/src/main/java/com/owncloud/android/extensions/FragmentExt.kt:89: Error: Wrong usage of repeatOnLifecycle from ManageAccountsDialogFragment.onStart. [RepeatOnLifecycleWrongUsage from androidx.lifecycle]
repeatOnLifecycle(lifecycleState) {
^

 Explanation for issues of type "RepeatOnLifecycleWrongUsage":
 The repeatOnLifecycle APIs should be used when the View is created,        
         that is in the onCreate lifecycle method for Activities, or
 onViewCreated in                 case you're using Fragments.

 Vendor: Android Open Source Project
 Identifier: androidx.lifecycle
 Feedback: https://issuetracker.google.com/issues/new?component=413132

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Run ./gradlew :owncloudApp:lintDebug and inspect owncloudApp/src/main/java/com/owncloud/android/extensions/FragmentExt.kt around line 89, where ManageAccountsDialogFragment.onStart uses repeatOnLifecycle. Align that usage with the lint guidance for lifecycle placement, then rerun the lint task and confirm the RepeatOnLifecycleWrongUsage error is gone.

Written by the indexing model from the issue text.

Assessment

Tech stack
android, kotlin
Domain
mobile
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.