A Unity ID allows you to buy and/or subscribe to Unity products and services, shop in the Asset Store and participate
in the Unity community.
Discussion in 'Linux Editor' started by Yeol_, Dec 14, 2016.
Unfortunately it appears to still repro in 5.6.0p3 - so no relief.
Really? Unity 5.6, some versions in between and nothing about this? IMHO this should be tagged as a critical bug :/
This is not so much a bug as a lack of an update from Unity.
The android command has been deprecated and thus can no longer be used. This is what it says in the "android.bat" file in the latest releases.
echo The "android" command is deprecated.
echo For manual SDK, AVD, and project management, please use Android Studio.
echo For command-line tools, use tools\bin\sdkmanager.bat
echo and tools\bin\avdmanager.bat
This is really frustrating for me because the solution everyone is saying works perfectly for them DOESN'T work for me at all. In fact, I get an additional error.
Here's exactly what I have done:
1) Downloaded the file for the 25.2.3 tools
2) Gone to my SDK root folder an renamed the existing "tools" folder to something like toolsXXXX
3) Copy+pasted the new tools 25.2.3 folder into the SDK root folder
4) Renamed that folder to "tools"
Then when I go to build it gives me another error. "SDK tools version 0 < 24"
If I click "continue," it just gives me the default error again.
Am I doing something wrong here? I've been to many threads on this subject and I'm the only one who this solution doesn't seem to work for. Really frustrated right now.
EDIT: Okay, I figured it out. There's a folder INSIDE the 25.2.3 folder called "tools." That's the folder you want to copy, not the base "25.2.3" folder itself. Hope this helps someone out.
Have the same issue right now. When using the latest SDK (replace "tools") it's: Unable to list target platforms. Please make sure the android sdk path is correct.
With the older "tools" version – another error – the minimum API should be higher...
Btw, I am building on mac, but seems like the issue is the same
Update: changed API and it worked.
piedlove_com Thank you for the solution.. It worked like charm....
What did you change to make it work? I am also building on Mac and have the same error.
Please advise with details.
Set the API (for Android) in the Player Settings -> Other Settings -> Minimum API level.
What did you end up setting it to?
Sure, here what I did:
1.downloaded a bunch of versions of "tools". Here is the link: https://androidsdkoffline.blogspot.com/p/android-sdk-tools.html
2. Got to the sdk folder (Users/name/Library/ Android/sdk) - -these folders are hidden, so type cmd+shft+. (dot) to make them visible
3. In the folder find "tools" folder - delete it or replace the name just in case, replace this "tools" folder with the new "tools" folder that you just downloaded - choose the version that will work, looks like tools_r25.2.5-macosx.zip works, as well as tools_r25.2.3-macosx.zip
4. To avoid an API error - go to the Player Settings: Other settings – Identification – Minimum API level (Android5.1 'Lollypop....")- choose an API from the dropdown
That's it, it worked for me. Just select an API higher than requested, I set to 22.
Hope, it was helpful!
i did try this, and still, its not working...
"Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. See the Console for details."
CommandInvokationFailure: unable to list target platforms.
please make sure the android sdk path is correct.
See the console for more details.
/usr/lib/jvm/java-8-oracle/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/home/elmapul/Android/Sdk/tools" -Dfile.encoding=UTF8 -jar "home/boreal/Downloads/uni/unity-editor-5.6.0xf1Linux/Editor/data/Playback..."
Error building Player: CoomandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details:
/usr/lib/jvm/java-8-oracle/bin/java-Xmx2048M -Dcom.sdkmanager.toolsdir="/home/elmapul/Android/Sdk/tools" -Dfile.encoding=UTF8 -jar "home/boreal/Downloads/uni/unity-editor-5.6.0xf1Linux/Editor/data/Playback..."
Can you paste a screenshot of your Unity Preferences->External Tools screen (not sure where they are in Ubuntu version) and also a screenshot of the Player Settings->Other Settings for Android please. Obviously blank out any sensitive readable data.
the sdk is set correctly:
(on Unity preferences>external tools)
OK, open the "android" script with an editor under /home/elmapul/Android/Sdk/tools (not sure what it is in Ubuntu, in Windows it's android.bat). Look at the script and see if it says anything about the command being deprecated?
Also, what API level have you set in the project settings and do you have the said API level installed from the SDK (check in the SDK editor).
i'm using the tools_r25.2.3-linux.zip since people said this suppose to be working.
when you install android studio, the android.sh file says:
The \"android\" command is deprecated.
For manual SDK, AVD, and project management, please use Android Studio.
For command-line tools, use tools/bin/sdkmanager and tools/bin/avdmanager
on the old version it dont says that.
(.sh is like the .bat from windows)
This problem seems to be fixed in Unity 5.6.1
But there is still the merging android manifest bug...
Better use the old version or wait for 2017.10b3.
Right, if you have that "deprecated" in your android file then you haven't "downgraded" correctly.
Go to the SDK folder and DELETE the folder called "tools".
Extract the archive file and look for the "tools" folder from the archive and MOVE that to the SDK folder. You can of course extract it directly to your SDK folder if you wish but make sure you have deleted the current folder first.
If you have downloaded the correct archive then the only folder in the archive will be the "tools" folder.
Once you've done this, open the "android" command again and the "deprecated" part should be gone and you should then be able to continue. Alternatively, you can just launch Unity and try to build something and it should work.
If you have to reinstall or upgrade the SDK again, this will overwrite the workaround and you will have to do it all again until such time that Unity change how they use the SDK.
I have just looked at the "android" file in the linked archive below and can confirm there is no "deprecated" in the file.
In case you are getting the file from somewhere else, I have included download links which have only the necessary tools folder in the archive:
Linux Download Link
Windows Download Link
I am having this problem, Unity 5.5.2f1 Personal on Windows 10. The tools .zip referenced from the Android site is no longer there, and the one that is there has the deprecated language in the android.bat file. The link above looks like it is just for Linux . . . does anyone have the windows version? Is there another workaround at this point?
Right, if you have that "deprecated" in your android file then you haven't "downgraded" correctly.
nope i dont have that "deprecated" in the file, it was there, but then i downloaded the old version (tools_r25.2.3-linux.zip) as i said above and replaced the tools folder with it...
"This problem seems to be fixed in Unity 5.6.1"
i have no idea on how to upgrade unity, since the installer was an .sh not an .deb file
Unfortunately, I can't help with that as I don't have a Linux desktop to hand. However, on Windows, if you get the latest "UnityDownloadAssistant" it usually gets the latest "stable" version at hand. I am still using Unity 5.6.0f3 (Personal) and I do not have these issues anymore after following the procedure I listed above.
I'm not sure if this link helps or not to get the updated version for Linux as on a Windows system it defaults to showing updates for the Windows version of Unity3D.
Thanks a lot @jholowka. It worked like a charm!
These are the links provided in the page as of now (version 25.2.3):
Windows no installer: https://dl.google.com/android/repository/tools_r25.2.3-windows.zip
Thanks to Mr D in GitHub
This worked for me. Thank you.
Thank you so much!
that solved that issue for me but now Unity hangs with this:
Any tips on this?
Worked for me.
Hi guys, I got my Unity working without using the downloading method mentioned above.
I just ran Unity as an Administrator.
I'm using Windows 7, Unity 2017.1.0f3 Personal 64bit, Android SDK tools Version 26.0.2
I noticed that the "tools" folder did have an "android" bat file and listed the permissions just because. All the files and folder were owned by admin.
It's funny because I only got to this while having trouble finding the download on the developer.android.com/index page.
Well, hope it helps someone.
Problem is changes in Android/sdk/tools/lib folder. Unity sdktools.jar search sdkmanager.jar, but now android uses com.android.sdklib.tool.AvdManagerCli. I wrote simple wrapper (in attachment), that proxies calls from unity to AvdManagerCli. Unpack jar file and put it into Android/sdk/tools/lib folder (in latest build-tools this file not exist).
This worked like a charm! You are a god sir!
Thank you. Workaround is still needed (and is verified to work) for Unity 5.6.3f1 as well.
YOU SAVE MY LIFE!!!!!! Thanks!!!!!!!
You got it man! thanks!
After a long discussion with Support about the solution of this Problem.
I got the following Link:
Hope It will be help full for others too
Worked perfectly, thanks for that! Total life saver!
This problem is still not fixed.
I just did a fresh install of Unity2017.3.0f1, Android 3.0.1 (using Android SDK Build-Tools 27.0.3), Java SE 9.0.1 and I still get this error:
Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.
This solution still works: https://answers.unity.com/questions/1323731/unable-to-list-target-platforms-please-make-sure-t.html
For using Unity 2017.3.0f1 you must install jdk 8 and instead of using the ‘platforn tools’ from the Android SDK(from android studio) you should use this one:
Platform tools 25.2.3(there is a MacOS versión to,google it):
Just replace the folder of the link with the downloaded one.
I am using Unity 2017.3.0f3 and I got this problem again. I thought I had it fixed but it keeps coming back. Not sure if it happens again when I upgrade Unity or what. Anyway, here is what I do to fix it, and what I do is a bit different than other people because I also do Android development so I really don't want to replace the tools folder in the Android folder permanently.
1. I save whatever is the current tools folder as tools_r26_1_1 (or whatever it is).
2. I copy version r25_2_2 of the tools folder into the sdk folder and rename it tools.
3. Then I verify that I can build the apk file for my project.
4. Then I go back into the sdk folder of Android and restore the good version of tools and rename the r25_2_2 version to something like "tools_r25_2_2". (I do that so I can repeat this step if necessary.)
5. Then I go back into Unity and rebuild the apk file with the latest and correct tools folder in the sdk folder.
Oddly enough, this worked, but I have no idea why it worked. The good news is that I end up with a working Unity environment and a working Android environment.
Just installed Unity 2017.3.0p2 and problem with Unity on Linux hard-coded to use version r25_2 of the tools for Android build still persists.
Unfortunately for me, I have to use old 25.2 version of the tools folder. If I try to revert to use of original tools folder while keeping renamed copy of tools_r25_2_2 (the way blahti did in the comment above) , Android SDK build error is back.
I am surprised that this big company which is earning a lot of money from from users like me, not fixing this basic problem until now.
I was having the same issue with the newest version of Unity 2017 3.03f and the newest version of android tools. I downloaded 25.2.2 from https://androidsdkoffline.blogspot.com/p/android-sdk-tools.html and renamed the tools(newest) folder as NewestTools. I then copied and pasted the 25.2.2 version into android folder and it worked. I have not tried to switch the 2 back like blahti did but I can confirm that it works.
This is what I did and it fixed my issue.
It's wokrking for me.
BTW: configuration of Unity is very, very exhausting
It seems to me that this bug is back with 2017.3. Even in the parch that went live yesterday, 2017.3.0p4, I still have this issue.
How are people producing android games?
So I'm getting something odd with 2017.3f1; it's a soft crash on Pop_OS (Ubuntu 17.10) and i3wm. Some windows come up asking for the Android SDK and the editor soft crashes. I basically have to force quit "kill -9" to get out of it. Now I"m going to try and figure out how to avoid those windows cause I wasn't getting them before until I built
This is what's happening;
Those two windows just stay there and I can't close Unity
Here are some of the errors I'm getting;
Repo not found: /usr/lib/android-sdk/extras/google/m2repository
UnityEngine.DebugLogHandler:Internal_Log(LogType, String, Object)
UnityEngine.DebugLogHandler:LogFormat(LogType, Object, String, Object)
Google.JarResolver.PlayServicesSupport:LoadDependencies(Boolean, Boolean, Boolean)
GooglePlayServices.ResolverVer1_1oResolution(PlayServicesSupport, String, OverwriteConfirmation, Action)
UnityEditor.EditorApplication:Internal_CallUpdateFunctions() (at /home/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127)
(Filename: /home/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs Line: 127)
ERROR: Unable to find dependency com.android.support:appcompat-v7:25.3.1 in paths ($SDK/extras/android/m2repository, $SDK/extras/google/m2repository, $SDK/extras/android/m2repository, $SDK/extras/google/m2repository).
com.android.support:appcompat-v7:25.3.1 was referenced by:
at System.Environment.get_StackTrace() in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System/Environment.cs:line 227
at Google.JarResolver.Dependency..ctor(System.String group, System.String artifact, System.String version, System.String packageIds, System.String repositories)
at Google.JarResolver.PlayServicesSupport.DependOn(System.String group, System.String artifact, System.String version, System.String packageIds, System.String repositories)
at System.Reflection.MonoMethod.InternalInvoke(System.Object , System.Object , System.Exception ByRef )
at System.Reflection.MonoMethod.Invoke(System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:line 222
at System.Reflection.MethodBase.Invoke(System.Object obj, System.Object parameters) in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:line 115
at Google.VersionHandler.InvokeMethod(System.Type type, System.Object objectInstance, System.String methodName, System.Object args, System.Collections.Generic.Dictionary`2 namedArgs)
at Google.VersionHandler.InvokeInstanceMethod(System.Object objectInstance, System.String methodName, System.Object args, System.Collections.Generic.Dictionary`2 namedArgs)
at Facebook.Unity.Editor.AndroidSupportLibraryResolver.addSupportLibraryDepenency(System.Object svcSupport, System.String packageName, System.String version)
at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(IntPtr )
at System.Runtime.CompilerServices.RuntimeHelpers.RunClassConstructor(RuntimeTypeHandle type) in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Runtime.CompilerServices/RuntimeHelpers.cs:line 101
at UnityEditor.EditorAssemblies.ProcessEditorInitializeOnLoad(System.Type type) in /home/builduser/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:line 136
at UnityEditor.EditorAssemblies.ProcessInitializeOnLoadAttributes() in /home/builduser/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:line 162
Unhandled Exception: System.ComponentModel.Win32Exception: ApplicationName='/usr/lib/android-sdk/tools/android', CommandLine='list sdk -u -e -a', CurrentDirectory='/home/joe/Projects/sharks'
at System.Diagnostics.Process.Start_noshell (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
at System.Diagnostics.Process.Start_common (System.Diagnostics.ProcessStartInfo startInfo, System.Diagnostics.Process process) [0x00000] in <filename unknown>:0
at System.Diagnostics.Process.Start () [0x00000] in <filename unknown>:0
at (wrapper remoting-invoke-with-check) System.Diagnostics.Process:Start ()
at GooglePlayServices.CommandLine.Run (System.String toolPath, System.String arguments, System.String workingDirectory, System.Collections.Generic.Dictionary`2 envVars, GooglePlayServices.IOHandler ioHandler) [0x00000] in <filename unknown>:0
at GooglePlayServices.CommandLine+<RunAsync>c__AnonStorey0.<>m__0 () [0x00000] in <filename unknown>:0
[0131/150331:ERROR:browser_main_loop.cc(207)] Gtk: IA__gtk_container_foreach: assertion 'GTK_IS_CONTAINER (container)' failed
Figured it out, my user didn't have execute permissions for the "android" executable. Fixed with "sudo chmod +x android"
Now it's failing here;
NullReferenceException: Object reference not set to an instance of an object
at Google.JarResolver.PlayServicesSupport.ResolveDependencies (Boolean useLatest, System.String destDirectory, Google.JarResolver.ExplodeAar explodeAar) [0x00000] in <filename unknown>:0
at GooglePlayServices.ResolverVer1_1.DoResolutionNoAndroidPackageChecks (Google.JarResolver.PlayServicesSupport svcSupport, System.String destinationDirectory, Google.JarResolver.OverwriteConfirmation handleOverwriteConfirmation) [0x00000] in <filename unknown>:0
at GooglePlayServices.ResolverVer1_1+<DoResolution>c__AnonStorey5.<>m__8 () [0x00000] in <filename unknown>:0
at GooglePlayServices.ResolverVer1_1+<DoResolution>c__AnonStorey5+<DoResolution>c__AnonStorey6.<>m__E (GooglePlayServices.Result updateResult) [0x00000] in <filename unknown>:0
at (wrapper delegate-invoke) GooglePlayServices.CommandLine/CompletionHandler:invoke_void__this___CommandLine/Result (GooglePlayServices.CommandLine/Result)
at GooglePlayServices.CommandLineDialog+ProgressReporter.Update (GooglePlayServices.CommandLineDialog window) [0x00000] in <filename unknown>:0
at GooglePlayServices.CommandLineDialog.Update () [0x00000] in <filename unknown>:0
at (wrapper managed-to-native) System.Reflection.MonoMethod:InternalInvoke (object,object,System.Exception&)
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) [0x000d0] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:222
Rethrow as TargetInvocationException: Exception has been thrown by the target of an invocation.
at System.Reflection.MonoMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object parameters, System.Globalization.CultureInfo culture) [0x000eb] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs:232
at System.Reflection.MethodBase.Invoke (System.Object obj, System.Object parameters) [0x00000] in /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MethodBase.cs:115
at UnityEditor.HostView.Invoke (System.String methodName, System.Object obj) [0x00013] in /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:295
at UnityEditor.HostView.Invoke (System.String methodName) [0x00009] in /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:288
at UnityEditor.HostView.SendUpdate () [0x00007] in /home/builduser/buildslave/unity/build/Editor/Mono/HostView.cs:370
at (wrapper delegate-invoke) UnityEditor.EditorApplication/CallbackFunction:invoke_void__this__ ()
at UnityEditor.EditorApplication.Internal_CallUpdateFunctions () [0x00010] in /home/builduser/buildslave/unity/build/Editor/Mono/EditorApplication.cs:127
(Filename: /Users/builduser/buildslave/mono/build/mcs/class/corlib/System.Reflection/MonoMethod.cs Line: 222)