[BUG] Lint reports an error

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

Nobody has claimed this yet.

Assessment

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

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.

Description

Type:bug

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
Dominant language
Kotlin
Stars
4.2k
Forks
3.1k
Avg merge
1d 12h
Merged PRs (30d)
7

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.

More from owncloud/android

All issues in owncloud/android

Similar issues

More Kotlin issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.