We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 2463

Summary: SDL_RWFromFile fails when trying to access a file on assets directory
Product: SDL Reporter: Francisco Vallarino <fjvallarino>
Component: fileAssignee: Sam Lantinga <slouken>
Status: RESOLVED INVALID QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2    
Version: 2.0.3   
Hardware: ARM   
OS: Android (All)   

Description Francisco Vallarino 2014-03-24 17:41:29 UTC
Trying to access a file on APK's assets directory using SDL_RWFromFile fails on SDL 2.0.3 (it worked fine on 2.0.1). 

Debugging the procedure I see that the error happens in the call to SDL_AndroidGetInternalStoragePath(), which in turn fails at:

mid = (*env)->GetMethodID(env, (*env)->GetObjectClass(env, fileObject),
    "getAbsolutePath", "()Ljava/lang/String;");

displaying the following log:

F/libc    (14491): Fatal signal 6 (SIGABRT) at 0x0000389b (code=-6), thread 14504 (SDLThread)

I'm using the default SDL2 Android project, and testing on Android 4.4.2.

Regards,
Francisco
Comment 1 Francisco Vallarino 2014-03-24 19:59:46 UTC
My bad. I only updated the dependencies on src directory instead of replacing the whole Android sample project. It works fine now.