본문 바로가기
Android/Build Error

[Android] Gradle NDK is missing a "platforms" directory. 버전 에러 해결

by Jay Son 아기 냥이 해린 짱💖 2021. 4. 12.

원인 : Gradle 빌드 버전으로 설정 맞지 않음.

수정 : Gradle 버전 변경

 

오류 메시지

> Configure project :app
NDK is missing a "platforms" directory.
If you are using NDK, verify the ndk.dir is set to a valid NDK directory.  It is currently set to /Users/json/Library/Android/sdk/ndk-bundle.
If you are not using NDK, unset the NDK variable from ANDROID_NDK_HOME or local.properties to remove this warning.


FAILURE: Build failed with an exception.

* What went wrong:
A problem occurred configuring project ':app'.
> Failed to notify project evaluation listener.
   > 'org.gradle.api.file.RegularFileProperty org.gradle.api.file.ProjectLayout.fileProperty(org.gradle.api.provider.Provider)'

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.

* Get more help at https://help.gradle.org

Deprecated Gradle features were used in this build, making it incompatible with Gradle 7.0.
Use '--warning-mode all' to show the individual deprecation warnings.
See https://docs.gradle.org/6.3/userguide/command_line_interface.html#sec:command_line_warnings

BUILD FAILED in 765ms
sh-3.2# 

 

build.gradle 기존 설정

dependencies {
        classpath 'com.android.tools.build:gradle:3.3.1'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

 

build.gradle 변경

3.3.1 -> 3.5.3 으로 변경

dependencies {
        classpath 'com.android.tools.build:gradle:3.5.3'


        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
    }

 

현재 사용하고 있는 Gradle 플러그인 버전을 6.3으로 사용하고 있어 3.5.3으로 변경하였고 플로그인 버전에 따라 버전명 변경 필요합니다. 

 

내가 사용중인 Gradle 플러그인 버전 확인 : gradle/wrapper/gradle-wrapper.properties 

 

플러그인 버전 필요한 Gradle 버전
1.0.0~1.1.3 2.2.1~2.3
1.2.0~1.3.1 2.2.1~2.9
1.5.0 2.2.1~2.13
2.0.0~2.1.2 2.10~2.13
2.1.3~2.2.3 2.14.1~3.5
2.3.0+ 3.3+
3.0.0+ 4.1+
3.1.0+ 4.4+
3.2.0~3.2.1 4.6+
3.3.0~3.3.3 4.10.1+
3.4.0~3.4.3 5.1.1+
3.5.0~3.5.4 5.4.1+
3.6.0~3.6.4 5.6.4+
4.0.0+ 6.1.1+
4.1.0+ 6.5+

출처 : developer.android.com/studio/releases/gradle-plugin?hl=ko

 

Android Gradle 플러그인 출시 노트  |  Android 개발자  |  Android Developers

Android 스튜디오 빌드 시스템은 Gradle을 기반으로 하며 Android Gradle 플러그인에는 Android 앱을 빌드하는 데 사용하는 몇 가지 추가 기능이 있습니다.

developer.android.com

 

반응형