14

My gradle sync always fails with this message on the stable android studio 3.5

This has been happening since the preview releases of versions of 3.5

NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN

The same project works on a parallel android studio. Sometimes I need to work on two instances in parallel, but I'm blocked on this error which mysteriously disappears if I quit Android Studio and restart the project. This happens on lucky days and on other days I am unable to start the project with the same error showing up repeatedly. What I mean by quit is simply exiting Android Studio and restarting it and opening my project using Import project (Gradle, Eclipse, etc.) instead of Open existing Android Studio project.

Edit 1: Unlike the duplicate NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN error, the accepted answer is not the solution or cause to my problem. Accepted answer is an easy way to work around it, but is only a temporary fix.

Edit 2: According to https://issuetracker.google.com/issues/140403764#comment14, this issue will be fixed in android 3.6 beta 1

Nishita
  • 870
  • 1
  • 9
  • 33

4 Answers4

0

Go to your build.gardle(Project) and then change the classpath of gardle to 3.5.0 after Sync project android studio will use gradle-5.4.1

dependencies {        
    classpath 'com.android.tools.build:gradle:3.5.0'
    ...
0

check your version code in build.gradle app module. check whether you have a point in the version code i.e for example if you have 5.0 then change it to just 5 instead.

Harish T
  • 1
  • 1
  • I get the following error: ```Could not find com.android.tools.build:gradle:3.5. Searched in the following locations: - file:/Users/nishita.dutta/.gradle/caches/5.4.1/embedded-kotlin-repo-1.3.21-3/repo/com/android/tools/build/gradle/3.5/gradle-3.5.jar – Nishita Sep 04 '19 at 11:29
0

I think this answer will work for everyone or not and I can't find root cause why this happening So If anyone find root cause it then please share. :D

But in my case I had migrate project to AndroidX and it works.

Rujul Gandhi
  • 1,700
  • 13
  • 28
0

Open project using Import project (Gradle, Eclipse, etc.) instead of Open existing Android Studio project :)

Tushar Lathiya
  • 940
  • 9
  • 26