I have enabled the “Copy Module to Project Folder” for all modules I’m using. However, when I click ‘reveal in finder’ on JuceActivity.java from within AndroidStudio it takes me out of the project JuceLibraryCode folder and back to the JUCE directory the modules were copied from? I’m using the latest master branch. Should it not be pointing to the JuceActivity.java file within the JuceLibraryCode folder?
Yes, if set up properly, it should go to the local copy.
Here’s the path preview of a locally copied module in my project:
And here’s a module I haven’t copied locally:
And when I open the file in my explorer, it does take me to the correct location.
You saved projucer and re-opened the IDE after checking the copy to local folder option for all modules?
edit: just noticed some weird behavior with Projucer v7.0.5 when I toggle “Use global paths” in a module:
After one off-on toggle, I am able to change the paths even when when use global paths is on and I shouldn’t be able to set the path.
This file belongs to the juce_gui_basics module, and this is how that is set up in the Projucer:
Yet, when this is the path from the file included with my project:
FWIW, I don’t have this issue with any other files in my project. They all seem to point correctly to the JuceLibraryCode folder.
Could you perhaps have the original source file open in your IDE even though it may be copied? If you check JuceLibraryCode/modules/juce_gui_basics, is it there?
If that’s not it, I’m fresh out of ideas. Seems like you have it set up properly!
Sorry, I should have said, yes, it’s there, but it’s not the one being built. I know because if I add some errors to the file CLion doesn’t complain at all.
Maybe unrelated, but it ocurred to me once that if you try to use different locations per module, both locations end up in the search path. So it might be random, which one is used.
I can remove the MacOS path as I’m not building it for MacOS. I’ll see if that helps.
I rather meant setting the location for moduleA to someJuce and moduleB to someOtherJuce, the search path contains someJuce and someOtherJuce. The search path is not specific per module, so all modules will be found in all locations.
Ok, but all of my modules copy from the same location. I’m not really sure how Projucer sets up Android projects. If I grep for JuceActivity in my Builds folder I see no path to this file in any of the build files. I know it’s getting build, but I’m not sure how.
Can you see the actual build commands in Android Studio when building? Look for the -I
search paths
Thanks @daniel that helped me located the problem. In my build.gradle file that the Projucer creates it shows the wrong src dirs:
sourceSets {
main.java.srcDirs +=
["../../../../../../../Volumes/SSD_Drive/Mac/juce7/JUCE/modules/juce_core/native/javacore/init",
"../../../../../../../Volumes/SSD_Drive/Mac/juce7/JUCE/modules/juce_core/native/javacore/app",
"../../../../../../../Volumes/SSD_Drive/Mac/juce7/JUCE/modules/juce_gui_basics/native/javaopt/app"]
main.res.srcDirs +=
[]
}
I can modify this. I already have to run post-Projucer-save file processing anyway. But this looks like an issue with the Projucer or? I can’t see what I might have done wrong in my Projucer setup.
Glad I wasn’t completely off…
Hope you get the rest sorted, that’s outside my wheelhouse.