Failed to load native library error when using Gradle 3.4


(Francois Ritaly) #1

I migrated some of my projects from Gradle 3.3 to Gradle 3.4 and I immediately noticed the following error on my build servers.

23-Feb-2017 03:18:56	FAILURE: Build failed with an exception.
23-Feb-2017 03:18:56	
23-Feb-2017 03:18:56	* What went wrong:
23-Feb-2017 03:18:56	Failed to load native library 'libnative-platform.so' for Linux amd64.
23-Feb-2017 03:18:56	
23-Feb-2017 03:18:56	* Try:
23-Feb-2017 03:18:56	Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

I tried cleaning up the files under ~/.gradle, restarting the offending Bamboo build agent but this didn’t fix the issue. This issue is clearly caused by the upgrade to 3.4 because as soon as I revert to 3.3, the build works again.

Googling the error message doesn’t really shed light on what the problem is.

Any idea what could cause this ?

This issue can be reproduced with any build (even one whose Gradle script is empty) as the error occurs prior even starting Gradle.

Note: this error doesn’t occur on my Mac, it only happens when running on our build servers.


(Francois Ritaly) #2

I don’t know if this is relevant for my issue but I compared the files created under ~/.gradle/native with Gradle 3.3 and 3.4 and I found this.

Gradle 3.3 creates the following files.

|-- 23
|   |-- linux-amd64
|   |   |-- libnative-platform.so
|   |   `-- libnative-platform.so.lock
|   `-- linux-amd64-ncurses5
|       |-- libnative-platform-curses.so
|       `-- libnative-platform-curses.so.lock

Whereas Gradle 3.4 only creates those:

|-- 24
|   `-- linux-amd64
|       |-- libnative-platform.so
|       `-- libnative-platform.so.lock

Maybe the lack of “curses” directory is expected here but I thought it was worth mentioning.


(Jordan Jennings) #3

Any solutions for this so far? We’re seeing the same issue on our build server (but not locally, same as you).


(Francois Ritaly) #4

Ah, this is good to know I’m not alone :slight_smile:

I have a feeling that something’s wrong with the packaging.


(jim.gish) #5

Same here when we upgraded to 3.4. I just had to rollback to 3.0. When I switch back to 3.0 the problem goes away. I’ve seen this before with previous upgrades. We’d like to see this resolved ASAP. Thanks.


(Benjamin Muschko) #6

Thanks for reporting. We upgraded the native library version with Gradle 3.4. Could you open an issue on GitHub for this?


(Francois Ritaly) #7

Thanks, I have created https://github.com/gradle/gradle/issues/1493.

Guys, feel free to comment in the GitHub issue.


(Benjamin Muschko) #8

Cool, we’ll take it from here.