Android : can't launch a game
So, i've try to compile (and re-compile, here goes the lost hours of sleep), and it seems to work pretty nice. But, when i try to launch it on my phone (Samsung Galaxy Express, btw), i can't launch a game? So, i've got two things : The first one is a JSO reading error :
03-09 20:43:14.047: E/JSO reading(10529): Error reading the file /storage/sdcard0/easyrpg/games/TestGame-2000/easyrpg-pref.txt 03-09 20:43:14.047: E/JSO reading(10529): /storage/sdcard0/easyrpg/games/TestGame-2000/easyrpg-pref.txt: open failed: ENOENT (No such file or directory)
Which seems pretty correct because... The text file doesn't exist. And that's funny because if i try with the current app downloaded from the store, there isn't any problem with the same game. The second one is a runtime error :
03-09 20:31:50.257: E/JSO reading(9588): Error reading the file /storage/sdcard0/easyrpg/games/BogossStory/BogossStory/easyrpg-pref.txt 03-09 20:31:50.518: E/AndroidRuntime(9588): FATAL EXCEPTION: main 03-09 20:31:50.518: E/AndroidRuntime(9588): java.lang.RuntimeException: Unable to start activity ComponentInfo{org.easyrpg.player/org.easyrpg.player.player.EasyRpgPlayerActivity}: java.lang.NullPointerException 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2087) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:2112) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.ActivityThread.access$700(ActivityThread.java:139) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1223) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.os.Handler.dispatchMessage(Handler.java:99) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.os.Looper.loop(Looper.java:137) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.ActivityThread.main(ActivityThread.java:4917) 03-09 20:31:50.518: E/AndroidRuntime(9588): at java.lang.reflect.Method.invokeNative(Native Method) 03-09 20:31:50.518: E/AndroidRuntime(9588): at java.lang.reflect.Method.invoke(Method.java:511) 03-09 20:31:50.518: E/AndroidRuntime(9588): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:997) 03-09 20:31:50.518: E/AndroidRuntime(9588): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:764) 03-09 20:31:50.518: E/AndroidRuntime(9588): at dalvik.system.NativeStart.main(Native Method) 03-09 20:31:50.518: E/AndroidRuntime(9588): Caused by: java.lang.NullPointerException 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.view.ViewGroup.addView(ViewGroup.java:3248) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.view.ViewGroup.addView(ViewGroup.java:3231) 03-09 20:31:50.518: E/AndroidRuntime(9588): at org.easyrpg.player.player.EasyRpgPlayerActivity.onCreate(EasyRpgPlayerActivity.java:91) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.Activity.performCreate(Activity.java:5047) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1094) 03-09 20:31:50.518: E/AndroidRuntime(9588): at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2051) 03-09 20:31:50.518: E/AndroidRuntime(9588): ... 11 more
Sorry, that's ugly. So, the main problem seems to be in the add of a view in the layout when the game is launch, where the said view is null. So i tried to comment the lines that caused the bug and now i've got this :
Error: Couldn't load SDL2: findLibrary returned null
So... Maybe an error in the compilation ? But i don't find it. Any help/advice ?
Sounds as if dependencies are missing. Try: https://ci.easyrpg.org/view/Toolchains/job/android-toolchain/ you will also need: https://github.com/EasyRPG/liblcf
Thx for the report. Is the Galaxy Express ARM or x86?
You can find our toolchain here: https://github.com/EasyRPG/buildscripts/tree/master/android
If you use Windows you are out of luck. If using Linux or Mac just run 0 to 4.
I've already the liblcf and the toolchain. And the GE is on ARM. I'm also already using the scripts :)
Could you provide us the apk you created?
WEll, looks okay to me
Hmm... Are you able to launch a game Ghabry?
Yay, another incompatible Samsung device!
I don't understand. It was okay with your personal device, but you are using the virtual machin you linked yesterday and it doesn't work, right ?
ignore the black screen post, wrong topic ^^' . I just took a look in the APK and looks okay lib wise. Havn't tried booting this linked apk
This is what I obtain when launching a game : https://drive.google.com/file/d/0BzyFBzg6Eyy5b254a2wxSVR4RlE/view?usp=sharing
I have a Sony Xperia Z3 compact (Snapdragon 891 I think it's the ARMv7-A platform version)
NB : FaitFeather can run the Playstore version of EasyRPG without any problem, so it's not a Samsung problem. Maybe it remains a problem in your android toolchain.
You are right. I only checked for the existance of libsdl. libmain.so is the native code of the Player. Make sure you ran ndk-build for Player :D
Step 4 does it: https://github.com/EasyRPG/buildscripts/blob/master/android/4_build_android_port.sh NOTE: THE TOOLCHAIN REPO MOVED
Please tell us the compile error you get when running ndk-build.
One problem I'm aware of is that the toolchain sometimes fails to copy "boost" to armeabi-v7a-toolchain/include. Copy boost manually from armeabi-toolchain/include (this is required to correctly compile liblcf, which is step 3)
Also an error with the mips build got fixed few days ago. So maybe recompile the toolchain.
So, I tried again /o/. And looks like ndk-build doesn't work.
In file included from jni/src/../../../../src/system.h:44:0, from jni/src/../../../../src/graphics.h:24, from jni/src/org_easyrpg_player_player_EasyRpgPlayerActivity.cpp:26: jni/src/../../../../src/memory_management.h:23:28: fatal error: boost/config.hpp: No such file or directory #include <boost/config.hpp> ^ compilation terminated. make: *** [obj/local/armeabi-v7a/objs/main/org_easyrpg_player_player_EasyRpgPlayerActivity.o] Error 1 make: *** Waiting for unfinished jobs.... In file included from jni/src/../../../../src/async_handler.cpp:25:0: jni/src/../../../../src/async_handler.h:21:30: fatal error: boost/function.hpp: No such file or directory #include <boost/function.hpp> ^ compilation terminated. make: *** [obj/local/armeabi-v7a/objs/main/__/__/__/__/src/async_handler.o] Error 1
I finally found the error in our toolchain build (hopefully).
Delete everything and start again from Step 1 using this repo: https://github.com/EasyRPG/buildscripts/tree/master/android
OR!!!!!!
Copy boost manually from armeabi-toolchain/include (this is required to correctly compile liblcf, which is step 3) to armeabi-v7a-toolchain/include
And start again from Step 3
And @BlisterBoy we use the scripts 1 and 2 to auto-deploy the toolchain on our server. So these scripts work (except the boost copy error). 3 and 4 are untested, but work in theory.
Np, i'll try and keep in touch :)
Edit : It works ! Thanks a lot !
Congratulation, now go fix some issues, may the Baguette be with you!