Hi, there’s no post-build step in Projucer for Android, and the binary location field doesn’t appear to be used for static libraries, i.e. filling this is doesn’t copy my library to this location at the end of the build.
Should the library be copied and should there be a post-build step? thx
It’s difficult to fix as there is not one binary directory on Android. gradle will create a bunch of static libraries for every architecture. Also a post-build script doesn’t really work as we don’t know if the post-build script will be executed on Windows (.bat script) or on macOS/Linux.
As @leehu points out, the better solution to this problem is to have the app which uses your static library to search in the right location. For example, ROLI’s NOISE app adds the following library search path to the Android exporter:
thanks for the prompt answer Fabian, the solution would work for small projects, this however would make my workflow too convoluted. My android project is used by many projects in pipeline, and having to specifically point to this specific folder for all projects is a maintenance-nightmare. If I understand correctly you are using cmake anyway and gradle is only running it. The libraries are a fat binary anyway, so my recommendation should work by adding the SET(CMAKE_ARCHIVE_OUTPUT_DIRECTORY “…/…/…/…/…/…/…/…/lib/Android/Debug”) line in cmakelists. or I might be missing some crucial aspects here?
I don’t quite understand how this would be any different to your approach. You would also need to specifically point to the CMAKE_ARCHIVE_OUTPUT_DIRECTORY in all the projects which use your static lib.
we have a global lib folder search path, that is being set once for every project that need the libraries, and we dont worry about what might be in the lib path.
well gradle does nothing, but cmake copies the stuff under Android/Debug for debug builds and Android/Release for release, or whatever other structure there might be
I honestly think this line should be added for projucer android exporters, since in all other exporters, the binary location is actually being used and for android it is completely ignored.