mpv-android / mpv-android

#mpv-android @ libera.chat
MIT License
1.84k stars 228 forks source link

nullable receiver of type Toast #911

Closed syphyr closed 3 weeks ago

syphyr commented 3 weeks ago

Important information

Android version:

mpv-android version: 2024-05-04-42-g8f396b9 Self Built

Which version of mpv-android introduced the problem (if known):

Introduced in de47b378cb4f9abf89087234e54e18f8c8e03e3a

Description

Commit de47b378cb4f9abf89087234e54e18f8c8e03e3a causes a conflict with "Add support for youtube-dl".

> Task :app:compileDefaultDebugKotlin FAILED
e: file:///home/delta/src/mpv-android/mpv-android/app/src/main/java/is/xyz/mpv/MPVActivity.kt:297:37 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Toast?

> Task :app:compileDefaultReleaseKotlin FAILED
e: file:///home/delta/src/mpv-android/mpv-android/app/src/main/java/is/xyz/mpv/MPVActivity.kt:297:37 Only safe (?.) or non-null asserted (!!.) calls are allowed on a nullable receiver of type Toast?

The issue is with the following line of code:

setGravity(toast.gravity, 0, 0)

Describe your issue in detail here.

If the circumstances in which it appears are not obvious, provide step-by-step instructions that can be reliably used to reproduce the issue.

Log output

The Android SDK includes a tool named logcat that is used to view application and system log messages on device. You will need a computer to view these logs. Logs pertaining to mpv can be collected like this:

adb logcat -s 'mpv:*' '*:F'

You can attach text files on Github directly or use sites like https://0x0.st/ to upload your logs. Depending on the nature of the bug, a log file might not be required and you can omit this section. If in doubt provide one, it will help us find possible issues later.

Additional information

If your issue is only reproducible with a specific (type of) file, provide a short sample file that can be used to reproduce the problem. You can again use https://0x0.st/ or other cloud storage to share it.

If your issue relates to a certain set of configuration options, provide a full copy of your mpv.conf below.

If no additional information is provided please delete this section.

syphyr commented 3 weeks ago

I think setting it to setGravity(toast!!.gravity, 0, 0) fixes the problem

sfan5 commented 3 weeks ago

You have to rebase it correctly of course, this is not a bug in the code.