android studio 동기화 오류 "NDK version is UNKNOWN"
7054 단어 AndroidStudioAndroidNDK안드로이드 개발
Android Studio에서
Sync Project with Gradle Files
를 실행하면 실패하고 EventLog에 다음과 같은 출력이 있습니다.Gradle sync started with IDEA sync
Project setup started
Gradle sync failed (6 s 705 ms)
NDK Resolution Outcome: Project settings: Gradle model version=4.4, NDK version is UNKNOWN
해결 절차와 조사를 설명합니다.
환경
작성한 환경의 버전입니다. (관련 항목 만)
품목
버전
Android Studio
3.5.1
Gradle
4.4
Android Gradle Plugin
3.1.2
NDK
20.0.5994570
CMake
3.10.2.4988404 (이하 3.10으로 쓰다)
Gradle, Android Gradle Plugin 버전이 오래되었습니다. 버전 업데이트를 게으르지 않은 프로젝트였습니다.
해결 절차
CMake 3.10을 제거하고 CMake 3.6을 설치합니다.
이 작업만으로 해결했습니다.
조사한 것
(1) gradle의 출력 메시지
문제가 발생한 환경에서 gradle sync
를 실행할 때 출력 메시지의 일부입니다.
14:24:21:Executing task 'sync'...
Executing tasks: [sync] in project C:\Users\hoge
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
External native generate JSON debug: building json with force flag false
External native generate JSON debug: starting JSON generation
(省略)
External native generate JSON debug: executing cmake Executable : C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments :
(省略)
BUILD FAILED in 1s
14:24:25: Task execution finished 'sync'.
CMake 3.7 이상을 사용하는 기능은 미리보기라는 것을 알 수 있습니다. CMake 3.6을 사용하는 것이 더 좋습니다.
(2) 기본적으로 사용되는 CMake 버전
SDK Manager에서는 CMake 3.6, CMake 3.10, 둘 다를 설치할 수 있습니다.
다음 문서에서는 CMake 버전을 지정하는 절차와 기본적으로 사용하는 버전에 대해 설명합니다.
SDK Manager에는 CMake의 3.6.0 분기 버전과 버전 3.10.2가 포함되어 있습니다. build.gradle에서 특정 버전의 CMake를 설정하지 않은 프로젝트는 CMake 3.6.0을 사용하여 빌드됩니다.
이 설명을 통해 "이 프로젝트에서는 CMake 버전을 지정하지 않았으므로 둘 다 설치하면 CMake3.6이 사용됩니다."라고 생각했습니다. 그러나 실제로 둘 다를 설치하고 gradle sync
를 수행하면 동일한 오류가 발생합니다.
14:29:48: Executing task 'sync'...
Executing tasks: [sync] in project C:\Users\hoge
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
External native generate JSON debug: building json with force flag false
External native generate JSON debug: starting JSON generation
(省略)
External native generate JSON debug: executing cmake Executable : C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments :
(省略)
BUILD FAILED in 1s
14:29:48: Task execution finished 'sync'.
아마도 "버전을 설정하지 않은 경우 CMake 3.6 사용"이라는 동작은 Android-Gradle-Plugin 3.3의 동작이라고 생각합니다. 그 이유는 Android Studio에서 CMake 3.10을 다운로드할 수 있는 이유는 Android Studio 3.3이기 때문입니다.
htps : //로 ゔぇぺぺr. 안 d로이 d. 코 m / s Tsuo O / Ree Ase s # c Make-3-10-2
실제로 Android-Gradle-Plugin 버전을 3.3으로 업데이트해 보겠습니다.gradle :app:generateDebugSources
를 실행한 출력 메시지의 일부입니다.
"SDK의 CMake 3.10.2는 요청된 버전 "3.6.0"과 일치하지 않습니다. SDK의 CMake 3.6.4111459는 버전 "3.6.0"입니다."
14:38:07: Executing task ':app:generateDebugSources --info'...
(省略)
No CMake version was specified in build.gradle. Choosing a suitable version.
Trying to locate CMake in local SDK repository.
CMake '3.10.2' found in SDK did not match requested version '3.6.0'.
- CMake found in SDK at 'C:\android-sdk\cmake\3.6.4111459' had version '3.6.0'
No CMake version was specified in build.gradle. Choosing a suitable version.
Trying to locate CMake in local SDK repository.
CMake '3.10.2' found in SDK did not match requested version '3.6.0'.
- CMake found in SDK at 'C:\android-sdk\cmake\3.6.4111459' had version '3.6.0'
(省略)
BUILD SUCCESSFUL in 1s
5 actionable tasks: 5 up-to-date
14:38:09: Task execution finished ':app:generateDebugSources --info'.
참고로 Android-Gradle-Plugin 3.2의 경우 gradle assembleDebug --info
에서 확인할 수 있습니다.
Executing task 'assembleDebug --info'...
(略)
externalNativeBuildDebug: starting build
externalNativeBuildDebug: reading expected JSONs
externalNativeBuildDebug: done reading expected JSONs
externalNativeBuildDebug: executing build commands for targets that produce .so files or executables
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-armeabi-v7a
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-arm64-v8a
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-x86
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-x86_64
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
(略)
BUILD SUCCESSFUL in 8s
34 actionable tasks: 5 executed, 29 up-to-date
AAPT2 aapt2-3.2.0-4818971-windows Daemon #0: shutdown
15:25:52: Task execution finished 'assembleDebug --info'.
요약
CMake 3.10을 제거하고 CMake 3.6을 설치합니다.
이 작업만으로 해결했습니다.
조사한 것
(1) gradle의 출력 메시지
문제가 발생한 환경에서 gradle sync
를 실행할 때 출력 메시지의 일부입니다.
14:24:21:Executing task 'sync'...
Executing tasks: [sync] in project C:\Users\hoge
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
External native generate JSON debug: building json with force flag false
External native generate JSON debug: starting JSON generation
(省略)
External native generate JSON debug: executing cmake Executable : C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments :
(省略)
BUILD FAILED in 1s
14:24:25: Task execution finished 'sync'.
CMake 3.7 이상을 사용하는 기능은 미리보기라는 것을 알 수 있습니다. CMake 3.6을 사용하는 것이 더 좋습니다.
(2) 기본적으로 사용되는 CMake 버전
SDK Manager에서는 CMake 3.6, CMake 3.10, 둘 다를 설치할 수 있습니다.
다음 문서에서는 CMake 버전을 지정하는 절차와 기본적으로 사용하는 버전에 대해 설명합니다.
SDK Manager에는 CMake의 3.6.0 분기 버전과 버전 3.10.2가 포함되어 있습니다. build.gradle에서 특정 버전의 CMake를 설정하지 않은 프로젝트는 CMake 3.6.0을 사용하여 빌드됩니다.
이 설명을 통해 "이 프로젝트에서는 CMake 버전을 지정하지 않았으므로 둘 다 설치하면 CMake3.6이 사용됩니다."라고 생각했습니다. 그러나 실제로 둘 다를 설치하고 gradle sync
를 수행하면 동일한 오류가 발생합니다.
14:29:48: Executing task 'sync'...
Executing tasks: [sync] in project C:\Users\hoge
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
External native generate JSON debug: building json with force flag false
External native generate JSON debug: starting JSON generation
(省略)
External native generate JSON debug: executing cmake Executable : C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments :
(省略)
BUILD FAILED in 1s
14:29:48: Task execution finished 'sync'.
아마도 "버전을 설정하지 않은 경우 CMake 3.6 사용"이라는 동작은 Android-Gradle-Plugin 3.3의 동작이라고 생각합니다. 그 이유는 Android Studio에서 CMake 3.10을 다운로드할 수 있는 이유는 Android Studio 3.3이기 때문입니다.
htps : //로 ゔぇぺぺr. 안 d로이 d. 코 m / s Tsuo O / Ree Ase s # c Make-3-10-2
실제로 Android-Gradle-Plugin 버전을 3.3으로 업데이트해 보겠습니다.gradle :app:generateDebugSources
를 실행한 출력 메시지의 일부입니다.
"SDK의 CMake 3.10.2는 요청된 버전 "3.6.0"과 일치하지 않습니다. SDK의 CMake 3.6.4111459는 버전 "3.6.0"입니다."
14:38:07: Executing task ':app:generateDebugSources --info'...
(省略)
No CMake version was specified in build.gradle. Choosing a suitable version.
Trying to locate CMake in local SDK repository.
CMake '3.10.2' found in SDK did not match requested version '3.6.0'.
- CMake found in SDK at 'C:\android-sdk\cmake\3.6.4111459' had version '3.6.0'
No CMake version was specified in build.gradle. Choosing a suitable version.
Trying to locate CMake in local SDK repository.
CMake '3.10.2' found in SDK did not match requested version '3.6.0'.
- CMake found in SDK at 'C:\android-sdk\cmake\3.6.4111459' had version '3.6.0'
(省略)
BUILD SUCCESSFUL in 1s
5 actionable tasks: 5 up-to-date
14:38:09: Task execution finished ':app:generateDebugSources --info'.
참고로 Android-Gradle-Plugin 3.2의 경우 gradle assembleDebug --info
에서 확인할 수 있습니다.
Executing task 'assembleDebug --info'...
(略)
externalNativeBuildDebug: starting build
externalNativeBuildDebug: reading expected JSONs
externalNativeBuildDebug: done reading expected JSONs
externalNativeBuildDebug: executing build commands for targets that produce .so files or executables
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-armeabi-v7a
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-arm64-v8a
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-x86
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-x86_64
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
(略)
BUILD SUCCESSFUL in 8s
34 actionable tasks: 5 executed, 29 up-to-date
AAPT2 aapt2-3.2.0-4818971-windows Daemon #0: shutdown
15:25:52: Task execution finished 'assembleDebug --info'.
요약
14:24:21:Executing task 'sync'...
Executing tasks: [sync] in project C:\Users\hoge
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
External native generate JSON debug: building json with force flag false
External native generate JSON debug: starting JSON generation
(省略)
External native generate JSON debug: executing cmake Executable : C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments :
(省略)
BUILD FAILED in 1s
14:24:25: Task execution finished 'sync'.
14:29:48: Executing task 'sync'...
Executing tasks: [sync] in project C:\Users\hoge
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
Support for CMake 3.7 and higher is a preview feature. To report a bug, see https://developer.android.com/studio/report-bugs.html
External native generate JSON debug: building json with force flag false
External native generate JSON debug: starting JSON generation
(省略)
External native generate JSON debug: executing cmake Executable : C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe
arguments :
(省略)
BUILD FAILED in 1s
14:29:48: Task execution finished 'sync'.
14:38:07: Executing task ':app:generateDebugSources --info'...
(省略)
No CMake version was specified in build.gradle. Choosing a suitable version.
Trying to locate CMake in local SDK repository.
CMake '3.10.2' found in SDK did not match requested version '3.6.0'.
- CMake found in SDK at 'C:\android-sdk\cmake\3.6.4111459' had version '3.6.0'
No CMake version was specified in build.gradle. Choosing a suitable version.
Trying to locate CMake in local SDK repository.
CMake '3.10.2' found in SDK did not match requested version '3.6.0'.
- CMake found in SDK at 'C:\android-sdk\cmake\3.6.4111459' had version '3.6.0'
(省略)
BUILD SUCCESSFUL in 1s
5 actionable tasks: 5 up-to-date
14:38:09: Task execution finished ':app:generateDebugSources --info'.
Executing task 'assembleDebug --info'...
(略)
externalNativeBuildDebug: starting build
externalNativeBuildDebug: reading expected JSONs
externalNativeBuildDebug: done reading expected JSONs
externalNativeBuildDebug: executing build commands for targets that produce .so files or executables
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-armeabi-v7a
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-arm64-v8a
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-x86
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
externalNativeBuildDebug: evaluate miniconfig
externalNativeBuildDebug: evaluate library MarshalxIf-Debug-x86_64
externalNativeBuildDebug: building target library MarshalxIf because no targets are specified.
externalNativeBuildDebug: about to build C:\android-sdk\cmake\3.10.2.4988404\bin\cmake.exe --build C:\Users\
(略)
BUILD SUCCESSFUL in 8s
34 actionable tasks: 5 executed, 29 up-to-date
AAPT2 aapt2-3.2.0-4818971-windows Daemon #0: shutdown
15:25:52: Task execution finished 'assembleDebug --info'.
이런 것보다 다양한 툴 버전을 업데이트하고 검증해 봅시다.
Reference
이 문제에 관하여(android studio 동기화 오류 "NDK version is UNKNOWN"), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/ykakizaki/items/1b277f80eb4229257600텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)