CodyF
CodyF

Reputation: 5227

Gradle sync failed: Can't load library windows-amd64\native-platform.dll

Updated from Android Studio 1.4 to 2.0, and had the IDE change my gradle dependency to 2.0 from 1.x in the build.gradle:

dependencies {
    classpath 'com.android.tools.build:gradle:2.0.0'
}

Updated the project gradle version to 2.10.

When I tried to sync a project with the gradle files, or refresh the project, I now get the following error:

Gradle sync failed: Can't load library: C:\Users\foobar\.gradle\native\19\windows-amd64\native-platform.dll
            Consult IDE log for more details (Help | Show Log)

Upvotes: 7

Views: 27981

Answers (6)

Crypto-Frank
Crypto-Frank

Reputation: 360

enter image description here

Make sure Gradle user home path is empty

Upvotes: 0

Hinotori
Hinotori

Reputation: 582

I tried everything for 2 days. Then i created c:\gradletemp, made the config to use it and ran Eclipse as Administrator. This worked for me!

ps: installed eclipse AND gradle with chocolatey

Upvotes: 0

shubham
shubham

Reputation: 23

For security purposes, Loading of DLL from temp directories may be disabled, you can try creating a tmp directory and changing GRADLE_OPTS to point to the location which you have created. for windows

open CMD
mkdir $some_location
set GRADLE_OPTS="-Dorg.gradle.native.dir=/$some_location"

This worked for me.

Upvotes: 0

Rohan Pambhar
Rohan Pambhar

Reputation: 1

Just rename native-platform.dll.lock file to native-platform.dll

Upvotes: 0

icarus
icarus

Reputation: 21

For me, going in and just deleting the 'native' folder, then allowing Android Studio to resync fixed the issue for me. I believe I had a the same or similar issue as CodyF did; my .dll was missing. The only file in the native\19\windows-amd64 folder was a .dll.lock file.

Upvotes: 2

Nazeer Basha
Nazeer Basha

Reputation: 256

Remove the "native" folder from gradle path:

.gradle\native\19\windows-amd64\native-platform.dll

When run again, it will regenerate the "native" folder, and the associative .dll.

Upvotes: 24

Related Questions