Quick Links: Download Gideros Studio | Gideros Documentation | Gideros community chat | DONATE
App crashes on scene switch when exported as .apk — Gideros Forum

App crashes on scene switch when exported as .apk

ZizanymanZizanyman Member
edited August 2015 in Bugs and issues
I just exported my app as an .apk file and exported it onto my phone. At first, it crashed on start up, but I fixed that by fixing some of the case sensitivity (changed pictures/PlayButton to Pictures/PlayButton). Now, the app allows me to go to the menu scene (that was where the case sensitivity problems were) and the credits menu (there are no pictures in that scene). But when I try to enter the game scene in my app, it crashes. It worked perfectly fine in the desktop and android players. I looked for case sensitivity errors in the code but found none. Can somebody help me find what is crashing the game (when I enter the game scene) in my code? Thank you!
zip
zip
Flappy.zip
11K

Comments

  • at first look i couldn't see anything in game.lua .
    Are you sure that your all image files names are correct and format as it should be. (pnp as png jpg as jpg etc..)
    Which line is it giving error.
    I wanted to debug it but can not hence your project is not working without assets. At least try to reshare it with some dummy assets if they are copyrighted.
  • ZizanymanZizanyman Member
    edited August 2015
    @talis The Flappy.gproj file should contain the whole project (lua files, pictures, etc.) . Also, I can't get error feedback from the .apk file because it is on my phone. It just crashes.
  • no the file contains project files without the assets unfortunately.
  • Okay, I will upload the assets ASAP. Sorry I can't do it right now, I don't have my computer with me right now (I'm sending this from my phone).
  • Try removing mp3 files from your code and assets.
  • ZizanymanZizanyman Member
    edited August 2015
    @talis Here is the file with the assets. The "Pictures" and "Sounds" files are what contain the assets that weren't originally included with the project.
    zip
    zip
    Flappy-With-Assets.zip
    2M
  • @amin13a I tried this, and it still crashed at the same exact spot.
  • In the game.lua just comment out lines 343,344 and 345 and it is working.
    this part:
    if score > hiscore then
    		hiscore = score
    end
  • For me it still crashes. :(
  • I really wish there was a way to get error feedback from a device once the .apk file has already been exported.
  • when i remove those lines in desktop player it is running. Let me try on real device.
  • @talis The problem isn't with the desktop player, it runs fine in that and the android player. The only time it crashes is when I try to run the exported project (.apk) on my device. That's why I can't get error feedback.
  • When i am deleting those three lines from the code in my samsung s5 it is running without problems.
  • ZizanymanZizanyman Member
    edited August 2015
    Maybe it's just my device then. I just tried exporting a sample project to the same device, though, and it worked. My device is an ASUS Zenphone 2. I'll keep looking for mistakes in the code.
  • Here is my exported project (just in case there is an error in it and I didn't know).
    zip
    zip
    Flappy.zip
    8M
  • piepie Member
    I really wish there was a way to get error feedback from a device once the .apk file has already been exported.
    @Zizanyman you can read error messages directly from eclipse if you run your app in debug mode on a device.

    I'm sorry I am in a hurry right now and I can't find a tutorial on how to do it, but basically you connect your device via usb to eclipse, enable debug mode on the device, and you should start seeing messages from your device in the output window in eclipse.

    When you run your project in debug mode from eclipse you should see a more specific error or a line of code when it crashes.

    good luck! :)

    %%-
  • ZizanymanZizanyman Member
    edited August 2015
    Thanks @pie! I found a tutorial online, and it worked. Unfortunately, it still didn't tell me the reason that the app crashed. I'll keep looking through the code. However, this did help me, since now I know that it's an error with my code, and not the way I exported it or anything.
  • piepie Member
    It should say something that points at least in a direction, what error do you get? :)
  • ZizanymanZizanyman Member
    edited August 2015
    It didn't give me an error at all when the app crashed. The last thing the console says is

    Connected to the target VM, address: 'localhost:8605', transport: 'socket'

    once it is connected to my device. Then nothing after that. And the debugger and Logcat sections constantly output debug info, but none of it seems to be errors.
  • ZizanymanZizanyman Member
    edited August 2015
    Wait-In Logcat section I found this error:
    08-06 10:25:49.703 601-1281/? W/libprocessgroup﹕ failed to open /acct/uid_10041/pid_31329/cgroup.procs: No such file or directory

    This error kept repeating over and over again, except slightly different. For example another one was:

    08-06 10:25:49.241 601-1348/? W/libprocessgroup﹕ failed to open /acct/uid_10143/pid_31937/cgroup.procs: No such file or directory

    Also, these lines were repeated over and over again as well:

    08-06 10:25:49.545 241-261/? W/Vold﹕ Returning OperationFailed - no handler for errno 0
    08-06 10:25:49.565 241-261/? E/Vold﹕ Failed to find mounted volume for /storage/MicroSD/Android/data/com.cleanmaster.mguard/files/

    And in the debug section it said that debug information is unavailable. All this and it still allowed me to play up until game.lua. Weird. :-?
  • Also found this slightly more interesting error:

    08-06 14:48:28.534 297-635/? E/audio_a2dp_hw﹕ adev_set_parameters: ERROR: set param called even when stream out is null
  • piepie Member
    There is some way to filter messages from a certain app, I can't remember now if it's in android debug mode options or in eclipse, however in the output window just look for E/ which are errors, W/ are "only" warnings.

    If the last one (E/audio_a2dp_hw) is certainly coming from your game, I would try to disable any sound and see if it is still there (I believe it shouldn't) then you could re enable sounds one by one or compare your files with gspot and see if there is any visible difference in encoding/bitrate that may cause it.

    It's a blind guess though :)
  • Oh, if E/ means errors, then I've been getting a lot of those! I'll try your suggestion.
  • ZizanymanZizanyman Member
    edited August 2015
    YES!!! I GOT IT TO WORK!!! @talis, the reason it still crashed for me was because there was also another error just a few lines after that one. I commented out the lines you said to and the line that said
    hiscoreText:setText(hiscore) and it worked! In results.lua, I also commented out this:
    tellhi = TextField.new(nil,"high score:"..hiscore)
    tellhi:setPosition(180, 436.36)
    tellhi:setScale (3,3)
    tellhi2 = tellhi:getWidth()/2
    tellhi:setPosition(tellhi:getX() - tellhi2, tellhi:getY())
    self:addChild(tellhi)
    So now all I need to do is get it to work with the highscore!
  • i am happy that you solved it. Congratz in your app by the way.
Sign In or Register to comment.