Android SDK를 찾지 못함 (Unity)
오류:
Invalid command android
UnityEditor.HostView:OnGUI()
CommandInvokationFailure :
Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/great/AppData/Local/Android/Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error:Invalid command android
]
stdout[
]
exit code: 64
UnityEditor.Android.Command.Run (System.Diagnostics.ProcessStartInfo psi, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandInternal (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.Android.AndroidSDKTools.RunCommandSafe (System.String javaExe, System.String sdkToolsDir, System.String[] sdkToolCommand, Int32 memoryMB, System.String workingdir, UnityEditor.Android.WaitingForProcessToExit waitingForProcessToExit, System.String errorMsg)
UnityEditor.HostView:OnGUI()
플레이어 빌드 오류 :
CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
C:/Program Files/Java/jdk1.8.0_121\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="C:/Users/great/AppData/Local/Android/Sdk\tools" -Dfile.encoding=UTF8 -jar "C:\Program Files\Unity\Editor\Data\PlaybackEngines\AndroidPlayer/Tools\sdktools.jar" -
stderr[
Error:Invalid command android
]
stdout[
]
exit code: 64
스크린 샷 :
나도 같은 문제가 있습니다.
Android sdk 도구 버전 다운 그레이드로 수정했습니다.
단계들.
android sdk "tools"폴더 삭제 : [Your Android SDK root] / tools-> tools
SDK 도구 다운로드 : http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
Android SDK 루트에 추출
프로젝트 구축
이 문제는 최신 Android 빌드 도구와의 통합이 호환되지 않기 때문입니다. MacOS의 경우 다음과 같이 작동 할 수있는 하나의 라이너가 있습니다.
cd $ANDROID_HOME; rm -rf tools; wget http://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zip; unzip tools_r25.2.5-macosx.zip
1- https://developer.android.com/studio/index.html을 엽니 다.
2- 해당 페이지의 맨 아래로 스크롤
3- OS 용 도구의 최신 버전 다운로드 (예 : tools_r25.2.3-windows.zip)
4- 압축 해제
5- Delete folder tools from previous Android Sdk folder
6- Copy new folder tools to Android SDK Folder like this image:
Unity 5.6.1 / 2017.1 fixes the Android SDK Tools 25.3.1+ compatibility issue. This is noted in Unity bug tracker under issue 888859 and their 5.6.1 release notes.
These are the steps that eventually worked for me...
Install JDK jdk1.8.0_131 (yes, this specific version, not a later version) and set it as the JDK Path in Unity.
Delete android sdk tools folder : [android_sdk_root]/tools
Download SDK Tools v25.2.5 (this specific version) from http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
Extract the tools folder in that archive to Android SDK root
Build your project
For Mac OS Users :
Go to your Android SDK folder and delete the tools folder (I recommend you to make a copy before deleting it, in case this solution does not solve the problem for you)
Then download the tools folder here :
http://dl-ssl.google.com/android/repository/tools_r25.2.5-macosx.zip
You can find all tools zip version here :
https://androidsdkoffline.blogspot.fr/p/android-sdk-build-tools.html
Then unzip the download file and place it in the Android sdk folder.
Hope it helps
Easier solution: set the environment variable USE_SDK_WRAPPER=1, or hack tools/android.bat to add the line "set USE_SDK_WRAPPER=1". This prevents android.bat from popping up a "y/n" prompt, which is what's confusing Unity.
Delete android sdk "tools" folder : [Your Android SDK root]/tools -> tools
Download SDK Tools: http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
Extract that to Android SDK root
Build your project
After that it didn't work for me yet, I had to
Go to the Java archives (http://www.oracle.com/technetwork/java/javase/downloads/java-archive-javase8-2177648.html)
Search for the jdk-8u131 release.
Accept the Licence Agreement,make an account and download the release.
Install it and define it as JDK path in Unity.
source : https://www.reddit.com/r/Unity3D/comments/77azfb/i_cant_get_unity_to_build_run_my_game/
I solved the problem by uninstalling JDK 9.
Linux Users:
cp -r Android AndroidUnity
cd AndroidUnity/Sdk
rm -rf tools
wget http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip
unzip tools_r25.2.5-windows.zip
In Unity preferences change to this newly created sdk folder.
In my case, I was trying to build and get APK for an old Unity 3D project (so that I can play the game in my Android phone). I was using the most recent Android Studio version, and all the SDK packages I could download via SDK Manager in Android Studio. SDK Packages was located in
C:/Users/Onat/AppData/Local/Android/Sdk And the error message I got was the same except the JDK (Java Development Kit) version "jdk-12.0.2" . JDK was located in
C:\Program Files\Java\jdk-12.0.2 And Environment Variable in Windows was JAVA_HOME : C:\Program Files\Java\jdk-12.0.2
After 3 hours of research, I found out that Unity does not support JDK 10. As told in https://forum.unity.com/threads/gradle-build-failed-error-could-not-determine-java-version-from-10-0-1.532169/ . My suggestion is:
1.Uninstall unwanted JDK if you have one installed already. https://www.java.com/tr/download/help/uninstall_java.xml
2.Head to http://www.oracle.com/technetwork/java/javase/downloads/jdk8-downloads-2133151.html
3.Login to/Open a Oracle account if not already logged in.
4.Download the older but functional JDK 8 for your computer set-up(32 bit/64 bit, Windows/Linux etc.)
5.Install the JDK. Remember the installation path. (https://docs.oracle.com/cd/E19182-01/820-7851/inst_cli_jdk_javahome_t/)
6. Windows를 사용하는 경우 환경 변수를 열고 내 컴퓨터 /이 PC> 속성> 고급 시스템 설정> 환경 변수> 새로 만들기> 변수 이름 : JAVA_HOME> 변수 값 : [YOUR JDK Path, Mine was "C : \ Program Files \ Java \ jdk1.8.0_221"]
7. Unity 3D에서 Edit> Preferences> External Tools를 누르고 JDK 경로를 입력합니다 (Mine은 "C : \ Program Files \ Java \ jdk1.8.0_221").
8. 또한 동일한 팝업에서 SDK Path를 편집합니다. (Android Studio> SDK Manager> Android SDK> Android SDK 위치에서 가져옵니다.)
9. 필요한 경우 변경 사항을 적용하려면 컴퓨터를 다시 시작하십시오.
참고 URL : https://stackoverflow.com/questions/42538433/not-finding-android-sdk-unity
'Nice programing' 카테고리의 다른 글
너비와 높이가 프로그래밍 방식으로 자동 레이아웃을 사용하는 superView와 같습니까? (0) | 2020.10.08 |
---|---|
활동 전환에서 페이드 애니메이션을 수행하는 방법은 무엇입니까? (0) | 2020.10.08 |
JSF 페이지에 끊기지 않는 공백 문자를 어떻게 삽입합니까? (0) | 2020.10.08 |
60 초 내에 안정적인 firefox 연결을 얻을 수 없음 (127.0.0.1:7055) (0) | 2020.10.07 |
Bundler : Gemfile을 변경 한 후 배포 모드로 설치하려고합니다. (0) | 2020.10.07 |