Hi, i have been trying to build my project for android without luck.
I have already build it for native windows, native linux, and emscripten but for android i am lost.
Plus the docs are obscure and misleading.
I have tried with rake, cmake, followed several tutorials and remade my Urho3D setup countless times.
NOT WORKING Steps i tried:
properly install NDK, SDK, JDK, with latest API (23) and properly env vars.
git clone urho3d
cmake it for android
compile it for android
— if i run ant release it creates an apk at this point, but not my project’s apk —
rake scaffolding my project
go to my project’s scaffolding
symlink my sources, modify CMakeLists.txt to include my sources
rake cmake it for android
rake make it for android
— at this point it seems compiled, i see .o files for my sources, but “ant release” will fail and even “android update” since neither have the required xml files.
Can you clarify how to compile a user’s project based on Urho3D ?
Thanks
In the documentation for the rake scaffolding task, there is a note/warning that at the moment it does not work well to scaffold for Android platform yet. This has been discussed before. It requires some undocumented post steps manually. But someone has posted the steps that worked for him in the forum. I don’t have the link ready with me but it should be searchable.
I didn’t use rake but I got mine to work decently through the command line. I’m not sure how well it handles symlinked files though – I seem to recall that it wouldn’t include my assets if they were symlinked instead of actual files). It’s been a while, but I think my steps were something like:
Clone Urho Source and build for Android, setting the NDK variables as required,
Copy my project so that stuff didn’t get potentially messed up by CMake
Set the URHO_HOME variable to the build location of Urho from above ( I think you can do this in the CMakeLists.txt file –
set (URHO3D_HOME H:/Projects/Urho/UrhoRepo/builds/android-samples)
set (ANDROID_NDK H:/Tools/Android/android-ndk-r10e)
but I’m not certain if it still works like that, as that was old stuff from my last computer, and now I just export URHO3D_HOME, so…)
android update project -p . -t [target form android list targets]
make -j8
ant debug
ant installd # while the device is connected
You may have to play around with directory structure some, especially with assets, but I get a libs/armeabi-v7a/lib[Project].so file.
Also note that you can open the apk as an archive (as a jar, I think), and then you can explore what is/isn’t included.
And note that I have an in-source build with the CMake Source and Build directories the same for my project.