I am developing for Android and use Eclipse to create an apk that also has a .so file with C++ code in it. My problem is that when I only change the C++ code and recompile that outside of Eclipse, Eclipse doesn't really always see that it's changed and I have to clean the project and rebuild it before I can reliably start it. This behaviour has cost me lots of time because Eclipse is not using the new .so file.
Is there a way to force Eclipse to always rebuild the project before its being run ?
It removes whatever already-compiled files are in your project so that you can do a complete fresh rebuild.
Note that with Project > Build Automatically enabled, doing a Project > Clean... / Build Clean will automatically trigger a full rebuild. You will see a Building workspace job if you open the Progress view (Window > Show View > Other > Progress).
In Project Options, go to "C/C++ Build.
Select "Builder Settings" tab.
Uncheck "Use default build command" and in the field Build command, just add the target "clean" as the first target.
E.g. assuming you have
> make -j2 settings
change it to
> make clean -j2 settings
I'm not sure how familiar you are with ant, but if you are compiling your c++ files through command line, one thought is to create an ant build script that will:
Then you can be sure the generated apk is always built using the latest compiled code.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With