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

Android crash on scene loading with relative path #4125

Closed
DriNeo opened this issue Mar 22, 2016 · 7 comments
Closed

Android crash on scene loading with relative path #4125

DriNeo opened this issue Mar 22, 2016 · 7 comments
Labels

Comments

@DriNeo
Copy link

DriNeo commented Mar 22, 2016

Operating system or device:
Android 4.0.3 ; LG P700

Issue description (what happened, and what was expected):
When some scenes are loaded by script, the Android app crashes on startup. The phone must be rebooted.

  • If you run only the scene it works nice also on Android.
  • If you instance the scene by editor the app works nice too.
  • It crashes only if the scene is loaded in a script.

Steps to reproduce:

  • Click on the example project link. (wait a minute hubiC seems slow on my Firefox)
  • Check the zip file and download it. The poisoned scene is "PausePopup2.tscn"
  • Connect an Android device.
  • Run the project on Android.
  • Epileptic persons should switchoff the device immediately.

Link to minimal example project (optional but very welcome):

http://ovh.to/KsqY4Xb

@DriNeo
Copy link
Author

DriNeo commented Mar 24, 2016

I think I surrounded the problem. Android really needs paths strings who begin with " res:// " otherwise the loading fails.

It's my bad but I leave to you the choice to close this issue. Maybe the file paths format need consistency between PC and Android.

@neikeq
Copy link
Member

neikeq commented Mar 24, 2016

I would open a new issue and close this one, or include you last message in the Issue description (I didn't port to Android yet, so I can't give an opinion).

@DriNeo
Copy link
Author

DriNeo commented Mar 24, 2016

Maybe you can rename the issue.

To summarize:
PC allows simple " / " to represent the root project, but Android need "res://" otherwise the app crashes and the O.S freezes on some devices ( or every devices and I'm the only one to write paths with " / " ?)

@neikeq neikeq changed the title Android crash on scene loading. Android crash on scene loading with relative path Mar 24, 2016
@reduz
Copy link
Member

reduz commented Jun 21, 2016

i can't get the sample project, would appreciate if you can post it again

@Faless
Copy link
Collaborator

Faless commented Feb 15, 2017

You should always use res:// to access project resources as stated by the official documentation.

Relative paths eg. load("test.gd") or load("scene/test.tscn") actually works (just tested in 2.1 branch).

Access to file system via absolute paths (C:\ and /) are there for platform that allows it (mainly PC and Servers) and discouraged unless you really need it.

For writable File System (eg. preferences, temp files, and so on) user:// should be used (I think you will need the WRITE_EXTERNAL_STORAGE and READ_EXTERNAL_STORAGE permission on android but you can double check).

I think this can be closed.

@Faless
Copy link
Collaborator

Faless commented Feb 15, 2017

PC allows simple " / " to represent the root project, but Android need "res://" otherwise the app crashes and the O.S freezes on some devices ( or every devices and I'm the only one to write paths with " / " ?)

This was actually fixed by #7172 and previous long PR/Issue history ( 😿 ) and now correctly points to the root of the file system.

@bojidar-bg
Copy link
Contributor

Yeah, closing as yet one of those misapplications of the root filesystem path.... Also, duplicate of #4280

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

No branches or pull requests

5 participants