crotwell / gradle-macappbundle

A Gradle Plugin to create a Mac OSX .app application and dmg based on the project.
Apache License 2.0
94 stars 33 forks source link

Application hangs when okhttp3.Credentials.basic method gets called #63

Closed tokman2 closed 5 years ago

tokman2 commented 5 years ago

The application hangs with the following error when okhttp3.Credentials.basic() method gets called:

AEGetDescData of non-desc type 'reco' not a good idea screen shot 2018-07-11 at 21 03 22

I went line by line and commented out everything this line causes the issue: String authToken = Credentials.basic(username, password); I don't know what to do, any further help is appreciated. I'm using 64bit java8 sdk on a 64 bit macOS High Sierra v10.13.3 and Retrofit 2.4 with gson 2.4 converter and gradle 4.4. The code is basic hello world javafx app with one button that should call a http get and convert the json answer into an object. For this I'm using retrofit2 and that library contains okhttp3. I've done this many times on android and linux/windows this is nothing new to me. The application works in the IDE (I'm using latest intellij ultimate) and from command line via gradle run.

build.gradle screen shot 2018-07-11 at 21 46 21

tokman2 commented 5 years ago

Well turned out that I unzipped the jar file and it doesn't contain any dependencies how can I make sure that the jar contains my dependencies too?

tokman2 commented 5 years ago

I figured it out, just need to add the following code inside the build gradle file.

jar { manifest { attributes( 'Class-Path': configurations.compileClasspath.files.collect {"$it.name"}.join(' '), 'Main-Class': 'com.testpackage.Main' ) } from { configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) } } }