Android studio 3.5: NDK Resolution Outcome: Project settings: Gradle model version=5.4.1, NDK version is UNKNOWN [duplicate]

大城市里の小女人 提交于 2019-12-10 10:23:37

问题


After updated Android studio from 3.4.2 to 3.5 I see the following warning message on the Build log messages.

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

I am using the following installed

Build-tools: 29.0.2 

NDK side by side: 20.0.5594570  

NDK: 20.0.5594570

I have the following in by build.gradle

classpath 'com.android.tools.build:gradle:3.5.0'

Note: Even though I am receiving this warning message, the build got succeeded without any problem so this is not a blocking issue. Anyway I want to get rid of this warning.

I have seen the following threads but it does not help

1. Suggestion 1: suggests to opening project using Import project (Gradle, Eclipse, etc.)

Comment: I reimported the project via the said option, but did not help. Also tried deleting build folders, restart-invalidate caches etc.

Result: The warning message still persists

2. Suggestion 2: You just need to open local.properties & change ndk.dir path to your NDK path.

Comment: I already have the following on my local.properties

ndk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\Sdk\\ndk-bundle
sdk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\Sdk

Result: The warning message still persists

3. Suggestion 3: 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

Comment: I already have this configuration on my build.gradle

Result: The warning message still persists

4. Suggestion 4: As suggested by one of the answer below, download the SDK from the given link and setup it in a separate folder.

comment: I did as suggested.

Result: The warning message still persists

After trying all of the above suggestions that I found on different threads/comments/answers, nothing seems working.


回答1:


Download a separate NDK, e.g. https://dl.google.com/android/repository/android-ndk-r20-windows-x86_64.zip

Then unzip it to a directory, e.g.C\:\\Users\\admin\\AppData\\Local\\Android\\ndk, and point your ndk.dir to it. i.e.

ndk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\ndk\\android-ndk-r20-windows-x86_64
sdk.dir=C\:\\Users\\admin\\AppData\\Local\\Android\\Sdk

Or, copy the whole content of the newly downloaded NDK and overwrite the content inside ndk-bundle directory

Edit #1

Or try to import the project rather than directly open it, see below:



来源:https://stackoverflow.com/questions/57706112/android-studio-3-5-ndk-resolution-outcome-project-settings-gradle-model-versi

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!