love2d / love-android

Android build setup for LÖVE.
https://love2d.org
Other
207 stars 72 forks source link

spurious `love.filedropped` event on startup #254

Closed akkartik closed 11 months ago

akkartik commented 1 year ago

The following test program throws an error on Android when starting up:

function love.filedropped(file)
  error('filedropped event')
end

I observed this behavior on a Samsung Galaxy phone and Samsung Galaxy tablet.

slime73 commented 1 year ago

What's the file's path (via File:getFilename)?

akkartik commented 1 year ago

On both my phone and my tablet it's /external/downloads/<some random int>.

MikuAuahDark commented 1 year ago

Is there an exact reproduction steps for this? I tried with Samsung Galaxy A52s with these combinations:

And I don't see any errors.

It's also worth trying the nightly APK as I updated SDL to 2.28.3 too and see if that solves the issue.

akkartik commented 1 year ago

I actually don't know how to run a script directly on Android. I usually zip it up into a .love file and put it on a server. That still reproduces this issue, even after I updated my APK. (I'm not doing anything with this repo so far.)

MikuAuahDark commented 1 year ago

Script, as in your example code snippet saved as main.lua then packaged as game.love.

So it happends when you run .love file by download attempt from website (e.g. clicking this link)?

akkartik commented 1 year ago

Yes, I am able to run the file in that link.

MikuAuahDark commented 11 months ago

I tried reproducing this in Galaxy A52s running Android 13 and seems unable to reproduce it.

Here's the code for testing:

local love = require("love")

local fileInfo = "None"

function love.filedropped(f)
    fileInfo = f:getFilename()
end

function love.draw()
    love.graphics.print(fileInfo, 50, 50)
end

And here's the steps I did:

  1. Have that script packaged as .love and hosted somewhere accessible through HTTP. In this case I have locally HTTP server setup in my network.
  2. Download said .love file in the phone with LOVE installed.
  3. In here, there are 2 variations that I tested, so step 4 and 5 are parallel to each other then it continues back on step 6.
  4. I used Firefox in here. When I try to download the file, Firefox asked me if it should download it or let LOVE handle it. I picked LOVE. I then tapped on the notification bar of the downloaded file.
  5. I used Chrome in here. When I try to download the file, it downloads it directly. I then tapped "Open" in Chrome.
  6. Both step 4 and 5 result in opening it directly to LOVE.
  7. I observed "None" as the output.
akkartik commented 11 months ago

I just tried your program, and it works exactly the same for me as well! I also reconfirmed that my original program up top continues to error out.

Is there something I can learn from this? I've never seen/done the local love = require("love") thing before, for example.

I'll binary search between these two programs and try to figure out what causes the error.

(I'm on an Android Galaxy S10 running Android 12. But so far it seems like the precise device is not relevant here..)


Oh wait, I just had to do a double-take. I just reran your program, and now it prints out a path rather than "None". The precise sequence of events was:

:fearful:

MikuAuahDark commented 11 months ago

I don't have Vivaldi so can't test that one. Tried with Firefox and still observe None on all steps.

akkartik commented 11 months ago

Ok cool. I gather Vivaldi is mostly Chrome reskinned :shrug:

I just tried your program on Chrome on a Galaxy Tab A7 Lite tablet, and it showed a path the first time. So in sum I've only seen 'None' once in many attempts. FWIW. I'm ok with closing this.

MikuAuahDark commented 11 months ago

I've pushed new commits which may potentially fix the issue. Please wait up to 20 minutes for the artifacts to be built then test it out and see if the issue still persist.

akkartik commented 11 months ago

Unfortunately I can't seem to run the latest build on either of my Android devices. I get an error that the package is invalid after it detects the name of the app and tries to install it.

MikuAuahDark commented 11 months ago

Yeah you still need to uninstall the app you have in your phone then install the one in GH Actions.

Pada tanggal Jum, 17 Nov 2023 11.13, Kartik Agaram @.***> menulis:

Unfortunately I can't seem to run the latest build on either of my Android devices. I get an error that the package is invalid after it detects the name of the app and tries to install it.

— Reply to this email directly, view it on GitHub https://github.com/love2d/love-android/issues/254#issuecomment-1815681812, or unsubscribe https://github.com/notifications/unsubscribe-auth/ABZHFFWXSFMZDTNTPNPVQODYE3I4VAVCNFSM6AAAAAA43M3WNGVHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMYTQMJVGY4DCOBRGI . You are receiving this because you commented.Message ID: @.***>

akkartik commented 11 months ago

Yes I did try that. Unfortunately it still didn't work.

MikuAuahDark commented 11 months ago

Just tested GH Actions build APK and it installed successfully but still shows None for the test, although I believe it's already fixed in f2970f4.