I have a Gradle task that is supposed to prompt if the user wants to continue or not (part of a larger task for my Android app).
I'm using SwingBuilder to to try construct a dialog but I'm getting the following error when I try to build:
Error:(94) Execution failed for task ':XXXXXX:ask'.
> Toolkit not found: apple.awt.CToolkit
Obviously, I don't have something installed on my Mac but I'm not sure what I need to install. Is this a Java dependency? Or Gradle? (Googling this does not help very much either - the only relevant link is something to do with Google AppEngine which does not help me much).
Here's the task:
task ask << {
def pass = ''
new SwingBuilder().edt {
dialog(modal: true,
title: 'Continue',
alwaysOnTop: true,
resizable: false,
locationRelativeTo: null,
pack: true,
show: true
) {
vbox {
label(text: "Are you sure you want to continue?")
button(defaultButton: true, text: 'Continue', actionPerformed: {
//do something
dispose();
})
button(defaultButton: true, text: 'Cancel', actionPerformed: {
//do something
dispose(); // Close dialog
})
}
}
}