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

Lint error in Camera.kt #22

Open
yaraki opened this issue Feb 14, 2024 · 1 comment
Open

Lint error in Camera.kt #22

yaraki opened this issue Feb 14, 2024 · 1 comment
Assignees

Comments

@yaraki
Copy link
Member

yaraki commented Feb 14, 2024

The code has @SuppressLint, but lint still shows error on it. We should figure out how to handle this.

 $ ./gradlew :app:lintDebug
Reusing configuration cache.

> Task :app:compileDebugKotlin
w: file:///usr/local/sda1/android/social/app/src/main/java/com/google/android/samples/socialite/ui/camera/Camera.kt:99:51 Unnecessary safe call on a non-null receiver of type WindowLayoutInfo
w: file:///usr/local/sda1/android/social/app/src/main/java/com/google/android/samples/socialite/ui/camera/Camera.kt:101:37 Condition 'foldingFeature != null' is always 'true'
w: file:///usr/local/sda1/android/social/app/src/main/java/com/google/android/samples/socialite/ui/camera/Camera.kt:193:57 'ArrowBack: ImageVector' is deprecated. Use the AutoMirrored version at Icons.AutoMirrored.Filled.ArrowBack

> Task :app:lintReportDebug
Wrote HTML report to file:///usr/local/sda1/android/social/app/build/reports/lint-results-debug.html

> Task :app:lintDebug FAILED
Lint found 1 errors, 79 warnings. First failure:

/usr/local/sda1/android/social/app/src/main/java/com/google/android/samples/socialite/ui/camera/Camera.kt:171: Error: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException [MissingPermission]
        viewModel.startVideoCapture(onMediaCaptured)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "MissingPermission":
   This check scans through your code and libraries and looks at the APIs
   being used, and checks this against the set of permissions required to
   access those APIs. If the code using those APIs is called at runtime, then
   the program will crash.

   Furthermore, for permissions that are revocable (with targetSdkVersion 23),
   client code must also be prepared to handle the calls throwing an exception
   if the user rejects the request for permission at runtime.


The full lint text report is located at:
  /usr/local/sda1/android/social/app/build/intermediates/lint_intermediate_text_report/debug/lint-results-debug.txt

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':app:lintDebug'.
> Lint found errors in the project; aborting build.

  Fix the issues identified by lint, or create a baseline to see only new errors.
  To create a baseline, run `gradlew updateLintBaseline` after adding the following to the module's build.gradle file:

android {
lint {
baseline = file("lint-baseline.xml")
}
}

For more details, see https://developer.android.com/studio/write/lint#snapshot

Lint found 1 errors, 79 warnings. First failure:

/usr/local/sda1/android/social/app/src/main/java/com/google/android/samples/socialite/ui/camera/Camera.kt:171: Error: Call requires permission which may be rejected by user: code should explicitly check to see if permission is available (with checkPermission) or explicitly handle a potential SecurityException [MissingPermission]
        viewModel.startVideoCapture(onMediaCaptured)
        ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

   Explanation for issues of type "MissingPermission":
   This check scans through your code and libraries and looks at the APIs
   being used, and checks this against the set of permissions required to
   access those APIs. If the code using those APIs is called at runtime, then
   the program will crash.

   Furthermore, for permissions that are revocable (with targetSdkVersion 23),
   client code must also be prepared to handle the calls throwing an exception
   if the user rejects the request for permission at runtime.


The full lint text report is located at:
  /usr/local/sda1/android/social/app/build/intermediates/lint_intermediate_text_report/debug/lint-results-debug.txt

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.
> Get more help at https://help.gradle.org.

BUILD FAILED in 10s
27 actionable tasks: 8 executed, 19 up-to-date
Configuration cache entry reused.
@donovanfm donovanfm self-assigned this Feb 15, 2024
@WonJoongLee
Copy link
Contributor

@donovanfm @yaraki Would it be possible for me to check on this issue?

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

No branches or pull requests

3 participants