0

Just when it seems that my builds are running stably, Android Studio will update SDK tools and Unity will throw an error when it gets to the part of the build where the assets are packaged up into an APK. It claims no Target API is available.

So I replace C:\Users\username\AppData\Local\Android\sdk\tools directory with one I grabbed from 25.2.5.

This fixes the build, until something seems to change the Android SDK and then the problem returns again until I replace the tools folder again.

Why is Unity so sensitive to sdk/tools versioning and what can I do about it?

Unity Error Dialog

Here is the console error:

    CommandInvokationFailure: Unable to install APK to device. Please make sure the Android SDK is installed and is properly configured in the Editor. See the Console for more details. 
C:/Users/brad/AppData/Local/Android/sdk\platform-tools\adb.exe -s "HT6980201842" install -r "C:\Users\brad\Documents\Unity\Night Hedges\build.apk"

stderr[
Failed to install C:\Users\brad\Documents\Unity\Night Hedges\build.apk: 
]
stdout[

]
exit code: 1
  • If you get error and don't post it, how can people help you? – Programmer May 22 '17 at 08:38
  • See [this](http://stackoverflow.com/a/37314122/3785314). Try that and your problem might be fixed. Ignore the Unity 2017 post. Only do that if no other solution worked. – Programmer May 22 '17 at 08:45
  • Thanks. Also, I finally found a more up-to-date coverage of workarounds at the android-manifest level, eliminating the need for changing the SDK... https://issuetracker.unity3d.com/issues/android-build-fails-when-the-latest-android-sdk-tools-25-dot-3-1-version-is-used – Bradley Pizzimenti May 22 '17 at 09:13

0 Answers0