Running gradle - Failed to load native-platform.dll error


(Matthew Harrison) #1

Hi,

I was just trying to get gradle running to try it out, but have hit some issues - I’m fairly sure its related to the setup here at work, but any suggestions on where to go next would be greatfully received.

I’ve tried with both gradle 2.14.1 and 3.0-rc-2, and had the same issue with both. Running on Windows 7, 64bit OS. And using a 64 bit JDK 1.8.0_45.

When I run gradle I get the response:
λ gradle
FAILURE: Build failed with an exception.
* What went wrong:
Failed to load native library ‘native-platform.dll’ for Windows 7 amd64.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.

Adding the --debug etc. options doesn’t make any difference. I tried clearing out my .gradle/native directory, but it made no difference (i.e. a new dll was put in place, but got the same output).

So are there any thoughts on why the library can’t be loaded? Or can I run without the native library?

Thanks in advance for any thoughts/advice,

Matt


Post blocked due to more than 5 links, when only 2 were given
(Luke U) #2

Hi @mattharr, did you ever find a solution to this?

I’m hitting the same issue, except my configuration is a bit more complex:

  • Running Windows 7, 64bit OS
  • Using a 32 bit JDK 1.8.0_92
  • Running from a cygwin shell

Accordingly I get:
Failed to load native library 'native-platform.dll' for Windows 7 x86.

However when I use a 64-bit JDK I don’t see this - so I probably need to post a new topic, but I thought I’d try my luck here first just in case.

Incidentally I discovered a few posts on SO which didn’t help me, but there might be some clues for you in there:

http://stackoverflow.com/questions/36429504/gradle-exception-failed-to-load-native-library-native-platform-dll

(I had to escape the 2nd link due to a possible forum bug.)


(Matthew Harrison) #3

Hi,

No I’m afraid not, I think I read that stack overflow post, and did try fiddling around with the dlls, but had no luck getting it working. I have a feeling its related to the various ‘security’ measures installed on the work machines - I’ve had it working fine on my home machine.

So sorry no further insights (I ended up going with Maven).

Cheers,

Matt


(Radu S.) #4

Remove the /native subfolder from ~/.gradle


(Franz Krainer) #5

Hi,
just a quick addendum here.
Had a very similar/same error msg. while working with Eclipse and import of a big Gradle project. Finally my only issue was that GRADLE_USER_HOME was not set correctly resp. to any existing directly. That was all.


(Franz Krainer) #6

‘directly’ --> ‘directory’ :slight_smile:


(Luke U) #7

Oh interesting, in my case I guess it’s possible it arose by importing something into Eclipse, if Buildship configured something that then confused Gradle in my cygwin environment. This issue “resolved itself” (after me having stumped for many hours) quite early on after starting-out with Gradle. At some point I did customise my GRADLE_USER_HOME (in both Eclipse prefs and my console init scripts). However that’s so long ago now that I can’t confirm any connection between these things - other than noting it would be consistent with @raduis2’s solution above.