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 2613

Summary: SDL_AndroidGetInternalStoragePath crashes
Product: SDL Reporter: wu <wuchuanren>
Component: fileAssignee: Gabriel Jacobo <gabomdq>
Status: RESOLVED WONTFIX QA Contact: Sam Lantinga <slouken>
Severity: critical    
Priority: P2    
Version: 2.0.3   
Hardware: ARM   
OS: Android (All)   

Description wu 2014-06-28 01:51:00 UTC
the RWops crashes on my android because SDL_AndroidGetInternalStoragePath() crashes.

the Line, which cause the crash is

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

in the function  SDL_AndroidGetInternalStoragePath()
It's inconvenient to debug on the cellphone, so I've put two SDL_Log's before and after this GetMethodID line.  The SDL_Log before will be shown, the one after disappears and the program crashes.
Comment 1 Sam Lantinga 2014-06-28 02:52:44 UTC
Gabriel, can you look at this ASAP?

Thanks!
Comment 2 Gabriel Jacobo 2014-06-28 15:21:11 UTC
Can you post the full log of the crash? Also, what device are you running this on and what API level you are building with. Thanks!
Comment 3 wu 2014-06-28 17:10:48 UTC
Sorry,

I've just found the reason.

It was because that my
android/src/org/libsdl/app/SDLActivity.java
was from an old version of SDL2 release and that causes this crash.

However, since there was no errors or warnings about the incompability during compiling, I didn't realize that one should also update the SDLActivity.java from the new version of SDL.