• Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
  • Asset Store
  • Get Unity

UNITY ACCOUNT

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account
  • Blog
  • Forums
  • Answers
  • Evangelists
  • User Groups
  • Beta Program
  • Advisory Panel

Navigation

  • Home
  • Products
  • Solutions
  • Made with Unity
  • Learning
  • Support & Services
  • Community
    • Blog
    • Forums
    • Answers
    • Evangelists
    • User Groups
    • Beta Program
    • Advisory Panel

Unity account

You need a Unity Account to shop in the Online and Asset Stores, participate in the Unity Community and manage your license portfolio. Login Create account

Language

  • Chinese
  • Spanish
  • Japanese
  • Korean
  • Portuguese
  • Ask a question
  • Spaces
    • Default
    • Help Room
    • META
    • Moderators
    • Topics
    • Questions
    • Users
    • Badges
  • Home /
  • Help Room /
avatar image
9
Question by hardartcore · Mar 03, 2017 at 10:55 AM · physicsbuildbuild-error

Android build CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details.

After an update of the latest versions of Android SDK it start to throw an error while trying to build an android app. Here is the stacktrace:

 Error building Player: CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. 
 /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/hardartcore/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/PlaybackEngines/AndroidPlayer/Tools/sdktools.jar" -
 
 stderr[
 Error:Invalid command android
 ]
 stdout[
 
 ]
 exit code: 64


and

 CommandInvokationFailure: Unable to list target platforms. Please make sure the android sdk path is correct. See the Console for more details. 
 /Library/Java/JavaVirtualMachines/jdk1.8.0_121.jdk/Contents/Home/bin/java -Xmx2048M -Dcom.android.sdkmanager.toolsdir="/Users/hardartcore/Library/Android/sdk/tools" -Dfile.encoding=UTF8 -jar "/Applications/Unity/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()
 
Comment
Add comment · Show 1
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image EdwinSly · Jan 05, 2018 at 02:32 AM 0
Share

hello, in this video i explain how to resolve this problem https://youtu.be/UaQe-fns$$anonymous$$4w

10 Replies

· Add your reply
  • Sort: 
avatar image
0

Answer by billmixgate · Apr 22, 2017 at 07:57 AM

thanks ..very .. much.

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Grooze · Aug 03, 2017 at 09:10 AM

link text

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).


sdkmanager.zip (1.1 kB)
Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jcbadboy · Aug 03, 2017 at 02:17 PM 0
Share

Grooze, thanks for your reply. Now I can build using android tools 26. But, I still can not build signed apks.

I have this error now:


Installation failed with the following output: [ 0%] /data/local/tmp/build.apk ..... [100%] /data/local/tmp/build.apk Failure [INSTALL_PARSE_FAILED_NO_CERTIFICATES]


On the device side i have this error:


Failed collect during installPackageLI android.content.pm.PackageParser$PackageParserException: Failed to collect certificates from /data/app/vmdl154391778.tmp/base.apk at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1131) at android.content.pm.PackageParser.collectCertificates(PackageParser.java:1058) at com.android.server.pm.Package$$anonymous$$anagerService.installPackageLI(Package$$anonymous$$anagerService.java:12508) at com.android.server.pm.Package$$anonymous$$anagerService.-wrap25(Package$$anonymous$$anagerService.java) at com.android.server.pm.Package$$anonymous$$anagerService$9.run(Package$$anonymous$$anagerService.java:10410) at android.os.Handler.handleCallback(Handler.java:739) at android.os.Handler.dispatch$$anonymous$$essage(Handler.java:95) at android.os.Looper.loop(Looper.java:148) at android.os.HandlerThread.run(HandlerThread.java:61) at com.android.server.ServiceThread.run(ServiceThread.java:46) Caused by: java.lang.NullPointerException: Attempt to get length of null array


Seems the problem is in the installation process on the device.

avatar image Grooze jcbadboy · Aug 03, 2017 at 02:45 PM 0
Share

In my situation I can't sign application at all, because build-tools/26.0.0/apksigner and build-tools/26.0.0/lib/apksigner.jar doesn't exist. I copy them from previous build-tools version.

avatar image
0

Answer by Beginnersminds · Sep 03, 2017 at 03:06 AM

@jgwinner Thanks for the help you've indicated in your thread so far. I have downloaded Unity 2017.1 and I'm trying to load a build from Unity onto my S8 but Unity doesn't recognize my phone during the build and therefore won't push the build to my phone. However, my PC does recognize my phone and it shows up fine in the adb device list and in the device manager. I tried to build a cube object in Unity 5.6 and your http://dl-ssl.google.com/android/repository/tools_r25.2.5-windows.zip files worked, it helped recognize my phone and I was able to push the cube to my phone. The problem is that my original build, the one with my entire scene with tree and eagle assets, was developed in 2017.1 and when I tried to build it in 5.6 there were too many errors. I then tried to re-install 2017.1 and run my complete build with your files but Unity still wasn't able to recognize my phone during the build. Any suggestions. I've spent 14 with my programmer trying to figure out solutions to this problem where Unity 2017.1 just doesn't recognize my phone during our builds, no matter what we do. I would really appreciate your help :) email: beginnersminds@gmail.com :)

Comment
Add comment · Show 1 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image jgwinner · May 13, 2018 at 06:24 AM 0
Share

@Beginners$$anonymous$$ds Hey! SOrry I missed this - I had that problem too, and it turned out it was $$anonymous$$alwarebytes! Try disabling any virus scanner you've got.

Hope you haven't been stuck all this time :(

avatar image
0

Answer by KingKong320 · May 11, 2018 at 10:05 AM

i have integrated firebase analytics and from that time i am facing this issue whenever i try to build i get this error. Please help :(

Error: [Temp\StagingArea\AndroidManifest-main.xml:16,Temp\StagingArea\android-libraries\com.google.android.gms.play-services-basement-12.0.1\AndroidManifest.xml:6] Trying to merge incompatible /manifest/application/meta-data[@name=com.google.android.gms.version] element:

UnityEditor.HostView:OnGUI()

Comment
Add comment · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image
0

Answer by Draag · Jan 26, 2019 at 05:18 PM

In me case that error was removed by running Unity with admin privileges.

However, then happened some other errors caused mainly by Gradle not being satisfied with currently installed SDK. It wanted to install the newest one, but couldn't do that for some reason (I gave up after several hours of struggle).


Finally I've fixed all the problems when I changed build system to "Internal". It's marked as deprecated, but it worked without any issue on the first attempt.

Comment
Add comment · Show 2 · Share
10 |3000 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image mpjunior_unity · Aug 08, 2019 at 06:55 AM 0
Share

Hi, where did you change the build system do Internal?

avatar image Draag · Aug 08, 2019 at 02:22 PM 0
Share

Hi @mpjunior_unity , I guess you're on Unity 2019. Internal build system was removed in that update. If you're having problems with those SD$$anonymous$$s etc. I can suggest trying installing all SD$$anonymous$$s using Android Studio. It may look like an overkill to install whole IDE just to install proper SD$$anonymous$$s, but it really helps and I'm finally able to install any SD$$anonymous$$ and easily build for any Android version with Unity.

  • ‹
  • 1
  • 2

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Welcome to Unity Answers

If you’re new to Unity Answers, please check our User Guide to help you navigate through our website and refer to our FAQ for more information.

Before posting, make sure to check out our Knowledge Base for commonly asked Unity questions.

Check our Moderator Guidelines if you’re a new moderator and want to work together in an effort to improve Unity Answers and support our users.

Follow this Question

Answers Answers and Comments

151 People are following this question.

avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image avatar image

Related Questions

I can't catch Unity build errors via script 0 Answers

WEBGL build error only on Chrome - Abort(196) 0 Answers

The Assembly UnityEditor is referenced by Assembly-CSharp-firstpass ('Library/ScriptAssemblies/Assembly-CSharp-firstpass.dll'). But the dll is not allowed to be included or could not be found. 1 Answer

Unity Gradle Build Error - Resource Not Found 0 Answers

il2cpp Build error,Exception: F:\Unity2018\Editor\Data\il2cpp/build/il2cpp.exe did not run properly! 1 Answer


Enterprise
Social Q&A

Social
Subscribe on YouTube social-youtube Follow on LinkedIn social-linkedin Follow on Twitter social-twitter Follow on Facebook social-facebook Follow on Instagram social-instagram

Footer

  • Purchase
    • Products
    • Subscription
    • Asset Store
    • Unity Gear
    • Resellers
  • Education
    • Students
    • Educators
    • Certification
    • Learn
    • Center of Excellence
  • Download
    • Unity
    • Beta Program
  • Unity Labs
    • Labs
    • Publications
  • Resources
    • Learn platform
    • Community
    • Documentation
    • Unity QA
    • FAQ
    • Services Status
    • Connect
  • About Unity
    • About Us
    • Blog
    • Events
    • Careers
    • Contact
    • Press
    • Partners
    • Affiliates
    • Security
Copyright © 2020 Unity Technologies
  • Legal
  • Privacy Policy
  • Cookies
  • Do Not Sell My Personal Information
  • Cookies Settings
"Unity", Unity logos, and other Unity trademarks are trademarks or registered trademarks of Unity Technologies or its affiliates in the U.S. and elsewhere (more info here). Other names or brands are trademarks of their respective owners.
  • Anonymous
  • Sign in
  • Create
  • Ask a question
  • Spaces
  • Default
  • Help Room
  • META
  • Moderators
  • Explore
  • Topics
  • Questions
  • Users
  • Badges