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?
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