zanadoman / wizard_engine

2D cross-platform game engine, written in C++ with SDL2
Other
1 stars 0 forks source link

the libSDL2.so can not be used #1

Open 13501714030 opened 1 day ago

13501714030 commented 1 day ago

I developed an Android application using the Delphi development tool, but after directly calling the libSDL2.so, SDL cannot be initialized, and the application crashes unexpectedly. It's strange, I've tried many different versions of libSDL2.so, including compiling the official SDL source code with NDK to generate libSDL2.so, but none of them can be called by other Android development tools except for Java in Android Studio. I don't understand why this is happening.

zanadoman commented 1 day ago

Hi! Good to see someone intrested in this project, I completed the android port yesterday and now you can build your project to android (x86_64 and aarch64 only). I tested it with android studio, empty activity template. Sorry for any issue I'm solo developing this project and still learning at uni. Also can you share your project with me? I would be interesting to learn from that.

13501714030 commented 1 day ago

my code is :

{$IFDEF ANDROID}

FixupStub(ALibFile, AHandle, 'JNI_OnLoad', Addr(JNI_OnLoad));

if Assigned(JNI_OnLoad) then JNI_OnLoad(PJavaVM(System.JavaMachine), nil);

{$ENDIF} SDLLoader.Refresh;

the issue comes from here, when i call JNI_OnLoad(), it will rasie an exception and the app will crash.

the log information is :

JNI DETECTED ERROR IN APPLICATION: JNI FindClass called with pending exception java.lang.ClassNotFoundException: Didn't find class "org.libsdl.app.SDLActivity" on path: DexPathList...

attention, i am not using Android Studio and not using java, i am using Delphi, it is Pascal language

i think your libSDL2.so is only for java using, can not be called via the other development tool and language

but it's maybe not your problem, it is SDL's problem as i found it doe not support other language only supports JAVA :(

zanadoman commented 1 day ago

Why do you need Wizard Engine for this? What are you trying to achieve?