Build errors for Android not seen in win/osx/iOS

Hi, getting these unresolveds when building Android:

C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:311: error: undefined reference to 'juce::FileChooser::browseForFileToOpen(juce::FilePreviewComponent*)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:372: error: undefined reference to 'juce::FileChooser::browseForFileToSave(bool)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:420: error: undefined reference to 'juce::FileChooser::browseForFileToOpen(juce::FilePreviewComponent*)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:432: error: undefined reference to 'juce::FileChooser::browseForFileToSave(bool)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:507: error: undefined reference to 'juce::FileChooser::browseForDirectory()'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:528: error: undefined reference to 'juce::FileChooser::browseForFileToOpen(juce::FilePreviewComponent*)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:576: error: undefined reference to 'juce::FileChooser::browseForDirectory()'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/Presets.cpp:596: error: undefined reference to 'juce::FileChooser::browseForFileToSave(bool)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/SeqUI.cpp:684: error: undefined reference to 'juce::FileChooser::browseForFileToOpen(juce::FilePreviewComponent*)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/SeqUI.cpp:704: error: undefined reference to 'juce::FileChooser::browseForFileToSave(bool)'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/SeqUI.cpp:784: error: undefined reference to 'juce::FileChooser::browseForDirectory()'
C:\Users\leehu\Development\cpp\JUCE\Projects\MIDISynthLib\Source/SeqUI.cpp:795: error: undefined reference to ‘juce::FileChooser::browseForDirectory()’

Also, errors with the following call unless the two defaulted parameters at the end are explicitly passed:

	int res = AlertWindow::showOkCancelBox( AlertWindow::AlertIconType::QuestionIcon, "Discard Changes", "Changes made to this preset will be discarded if you continue", "Ok", "Cancel", nullptr, nullptr  );


I’m guessing the file stuff may not have implementations on Android??

I’ve #defined all the filechooser stuff out for now, but still have:

…/…/…/…/…/…/…/…/…/…/…/JUCE/modules\juce_gui_basics/native/juce_android_Windowing.cpp:40: error: undefined reference to ‘juce_CreateApplication()’

These errors occur if you trying to use modal loops. Android does not support modal loops (i.e.JUCE_MODAL_LOOPS_PERMITTED is zero).

You’ll get this error if you trying to build a static library on Android. A fix for this is on the way.

Hi, yes, it’s in a static library… thanks, will test when fix uploaded.

There is a preliminary fix for the static library bug. We will be adding more features to the Projucer to make it easier to include multi-architecture static libraries in other Android projects.

1 Like

still seeing the same error unfortunately…

Exactly which error? Modal loops will probably never be supported on Android - so you will need to avoid calling methods like browseForFileToOpen in your code. In any case, using modal loops is not recommended anyway.

However, the fix on develop should have gotten rid of the juce_CreateApplication link-error.

Hi, I was referring to the juce_CreateApllication link error - I’m still seeing this after pulling the latest code…

That’s odd. You re-compiled the Projucer and re-saved your project? Getting linker errors isn’t even possible when building static libraries (as the linker will not try to resolve undefined symbols) so I don’t even know how this error could come up.

I’ll try rebuilding everything from scratch…