Android SDK paths in introjucer on Windows


#1

On Windows, paths are always displayed with backslashes.

C:\Program Files (x86)\Android\android-sdk

If I paste this into the global preferences in IntroJucer, then I get this in the ant build file:

sdk.dir=C:\Program\ Files\ (x86)\Android\android-sdk

Which will result in a build error with some very weird-looking path. Ant requires forward slashes as path separators:

sdk.dir=C:/Program\ Files\ (x86)/Android/android-sdk

So as a workaround I can replace all backslashes with forward slashes in the preferences window. Do you think IntroJucer could do that automatically somehow?

edit: Or should I just try to use Android Studio? In that case it tries to make a symlink, which on Windows doesn't work unless you have admin rights. As far as I can tell it is always the same symlink, maybe IntroJucer can skip creating the symlink if the correct symlink is already there?

--
Roeland


#2

Yay, Android development on Windows, my favourite topic!

Check out this sticky note and in particular the "Windows issues" section.

The recommended way to do it is to ditch Ant and go for Android Studio, in which case everything should work as long as you remember launching the Introjucer with admin rights. (It will re-create the whole symlink tree each time you save the project.)

Also, if you want to develop JUCE apps for Android, please seriously consider switching to Mac or Ubuntu, it's just a much smoother and less bug-and-workaround-ridden experience overall.

 


#3

Hmm fair enough. Looking at those linked bug reports, and the sheer length of that tips page, I'd say it doesn't look too good on any platform.

Anyway, I got Android Studio to work without too much fuzz. It took a couple of tries (one of them ended when Adroid Studio decided to install Java 8 instead of opening the project) but eventually it could open and compile a simple project. Once I got Android Studio correctly set up, it indeed mostly worked.

My first thought about that symlink issue is to use directory junctions, rather than links to individual files. These can be created without administrator permissions. But I guess that means you can't reproduce the groups from IntroJucer.

--
Roeland


#4

Hi roeland,

Don't know much about directory junctions (is that an NTFS thing? How do I create them and what's the difference to symlinks?) but yes, the whole reason why we need this tree of symlinks is that we need to somehow represent the "groups" like in Introjucer, Xcode, and Visual Studio. Android Studio does not have a concept of groups at all, it just thinks that the source = the physical content of your app's source folder, so that's the only workaround we could find to make it work. The other problem is that for JUCE you need to include source files that are physically outside of the app's source folder (i.e. the JUCE library code), ad again the symlink tree is the only solution we could find.


#5

Junctions are somewhat between hard and soft links, if I remember right.

Here is some explaination:  https://msdn.microsoft.com/en-us/library/windows/desktop/aa365006(v=vs.85).aspx


#6

Interesting, thanks! Always good to learn new stuff :-)

However, I don't see a need to implement that in JUCE now, since you can just run the Introjucer as Administrator and then everything should be fine.