owncloud / android

:phone: The ownCloud Android App
GNU General Public License v2.0
3.85k stars 3.06k forks source link

[BUG] Lint reports an error #4485

Open hannesa2 opened 1 month ago

hannesa2 commented 1 month ago

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
jesmrec commented 1 month ago

About the warnings, we are working in adding an static code analyzer to the CI system. We hope it'll be ready soon to help to avoid/fix such amount of warnings.

Will take a look to the error.

Thanks for reporting