세상사는 이야기 / 도움이 되었다면 배너 클릭 부탁드려요~ →→→

2018년 6월 26일 화요일

[Unity Android] NDK is missing a "platforms" directory.


Google Play Service설치 진행중 테스트 빌드 후 아래와 같은 에러가 발생 하였다.

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 C:\Users\User\AppData\Local\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.

원인
  1. 직접 NDK를 다운 받아서 설치 했다면 폴더 경로가 달라서 나오는 에러
해결
  1. 환경 변수(ANDROID_NDK_HOME)에 NDK Path 설치 경로를 등록해준다. 
  2. Android Studio에서 NDK를 받아서 사용하면 된다.

나는 2번 Android Studio를 이용하여 해당 에러를 수정하겠다.

1. Android Studio 실행 -> Tools -> SDK Manager

2. Android SDK -> SDK Tools -> NDK 체크 후 -> Apply

설치가 완료 되고 폴더를 확인해 보면 해당 NDK가 잘 설치되어있다.

C:\Users\User\AppData\Local\Android\sdk\ndk-bundle


에러 전문

CommandInvokationFailure: Gradle build failed.
C:/Program Files/Java/jdk1.8.0_171\bin\java.exe -classpath "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer\Tools\gradle\lib\gradle-launcher-4.0.1.jar" org.gradle.launcher.GradleMain "-Dorg.gradle.jvmargs=-Xmx2048m" "assembleRelease"

stderr[

FAILURE: Build failed with an exception.

* What went wrong:
Execution failed for task ':transformClassesWithDexForRelease'.
> com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Landroid/support/v4/BuildConfig;

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

BUILD FAILED in 7s
]
stdout[
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 C:\Users\User\AppData\Local\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.

Observed package id 'ndk-bundle' in inconsistent location 'C:\Users\User\AppData\Local\Android\sdk\ndk-bundle1' (Expected 'C:\Users\User\AppData\Local\Android\sdk\ndk-bundle')
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 C:\Users\User\AppData\Local\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.

The setTestClassesDir(File) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the setTestClassesDirs(FileCollection) method instead.
The getTestClassesDir() method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the getTestClassesDirs() method instead.
The ConfigurableReport.setDestination(Object) method has been deprecated and is scheduled to be removed in Gradle 5.0. Please use the method ConfigurableReport.setDestination(File) instead.

댓글 없음:

댓글 쓰기