Failed to specify target platforms. Check if the sdk android path is correct.

I am trying to create an old version project (v_4.6.3). but I have a mistake. I already got a successful result, but my current sdk has been updated with the latest version.

http://screencast.com/t/u7lNiyoc

Here is my log of unity errors.

Error building Player: 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_66\bin\java.exe -Xmx2048M -Dcom.android.sdkmanager.toolsdir="E:/Temp/sdk\tools" -Dfile.encoding=UTF8 -jar "C:/Program Files (x86)/Unity/Editor/Data/BuildTargetTools/AndroidPlayer\sdktools.jar" - stderr[ Exception in thread "main" java.lang.NoClassDefFoundError: com/android/utils/ILogger at java.lang.Class.forName0(Native Method) at java.lang.Class.forName(Class.java:348) at SDKMain.main(SDKMain.java:128) Caused by: java.lang.ClassNotFoundException: com.android.utils.ILogger at java.net.URLClassLoader.findClass(URLClassLoader.java:381) at java.lang.ClassLoader.loadClass(ClassLoader.java:424) at java.lang.ClassLoader.loadClass(ClassLoader.java:357) ... 3 more ] stdout[ ] 

How can I fix these problems. Thanks for the achievement. Sincerely.

+6
source share
1 answer

The solution to this problem is constantly changing over time when the Unity and Android SDKs are changing.

Please note that his problem seems to be fixed in Unity 2017.1 .

LAST DECISION

1) For Windows, download "tools_r25.2.3-windows.zip" and unzip it.

2) For MacOSX, download "tools_r25.2.3-macosx.zip" and unzip it.

3) Add the path to the unpacked SDK in the field Edit → Preferences ---> External Tools ---> SDK.

EVERYTHING DOES NOT WORK?

Remove the SDK Tools 25 and Android SDK Tools 26. Remove the SDK Platform-Tools and SDK Tools. Use the version number below.

OLD SOLUTION :

You did not configure the SDK correctly .

Follow these steps to configure the Android SDK.

1 . Make sure there is no in the SDKpath. Therefore, create a folder named AndroidSDK in the C directory.

2 . Copy the Android-sdk folder to the C:/AndroidSDK .

Your path to the SDK should now look like this:

 C:/AndroidSDK/Android-sdk 

3 . Update your Android SDK file in the Unity editor.

Now check if this works by trying to create again for Android.

If this fails, continue from below.

4 . Download the latest version of Unity.

5 . Reboot the SDK , then copy the file to C:/AndroidSDK/Android-sdk .

6 . Go back to Unity and update the path

enter image description here

7 . Create the Android project again, it will display an error and ask you to update the SDK.

enter image description here

Click "buttom" Update Android SDK . Unity will automatically update your SDK. Then your SDK should look something like below. Your problem should be missed.

enter image description here

+13
source

All Articles