- Home /
Unable to build to Android
When I try to build to android, the build succeeds... sort of. The build is created but if I build and run or try to install the app manually, I get the following error:
stderr[
Failed to install /Users/TheShadyColombian/Portfolio/Unity/Projects/1D/Temp/StagingArea/Package.apk: Failure [-26: Package com.JuanCallejas.OneDimension new target SDK 19 doesn't support runtime permissions but the old target SDK 23 does.]
]
However, installing via the standard installation GUI just says the package is corrupted.
Here is what the console errors are:
According to the error, I should try using a different version of the Android SDK (perhaps 23). The weird thing is that I've selected SDK 23 in the played build settings, and I've even deleted SDK 19, yet it still says I'm using SDK 19. I've verified that the SDKs I am using and/or deleting share the same directory path.
This is for an app I've already published, and needs an urgent update, so any help is very appreciated.
EDIT: It turns out I've actually just changed what API I'm using, not the SDK. How can I change the SDK to 23 or 25?
How does your path look like under Edit->Preferences->External Tools? Normally it should look something like this:
D:/Users/Noname/AppData/Local/Android/android-sdk
I had a problem similar to this in which my path was somehow changed to something else.
Also, which folders are present in your build-tools folder under:
D:\Users\Noname\AppData\Local\Android\android-sdk\build-tools ? $$anonymous$$aybe you just have to update everything via the SD$$anonymous$$ manager?
I should've clarified that I am using the $$anonymous$$ac editor, but this still applies in a slightly different way. I used the SD$$anonymous$$ $$anonymous$$anager a few times to verify that I have the right SD$$anonymous$$ tools i need.
I have Android SD$$anonymous$$ Build-Tools v25 and v24 and Platform Tools v25 as well as API 23, 24, and 15. Also, I just realized the error says I'm using SD$$anonymous$$ 23 but I'm actually just changing the API, not the SD$$anonymous$$. How do I tell unity to use SD$$anonymous$$ 25 (the latest I have) ins$$anonymous$$d of 19... which I don't even know how it got?
Hmm, what did you choose as install location in the build settings?
Install location? The build settings is the window with the list of scenes and the platforms that I can build for, right? The only thing related to a location is the build location, which I doubt impacts the outcome. Right now, it's just a folder in my desktop (/Users/TheShadyColombian/Desktop/AP$$anonymous$$s/1D\ Test\ Build.apk)
No i mean the install location in the player settings:
Try setting it to automatic maybe. I dont know the exact solution, that why im trying to give you some ideas which could help :)
Answer by Desoxi · Nov 12, 2016 at 01:06 AM
Ah and try to delete or move out every folder in Android\android-sdk\build-tools but one (the one with the highest version number). It should be somewhere in the same level like the path to the android sdk you put into your unity preferences.
Alright, but the only ones I have there are 0.0.24 and 0.0.25. I'll delete 0.0.24 and I'll give it a shot
Nope, same error, and It's still trying to use SD$$anonymous$$ 19. I don't know what SD$$anonymous$$ it's talking about
Hm... and you are sure that you did not accidentally install the sdk twice? Which version does the sdk manager show you? There should be a "SD$$anonymous$$ $$anonymous$$anager" executable in the sdk path you put into your preferences. Start it and check the values, update several times as the sdk manager maybe updates itself too, then you have to start it again and run another update cycle.
Everything's up to date. How can I check if there are any doubles of the SD$$anonymous$$?
Are you uninstalling the app before you install it on the device? Or do you update it through build&run? It could help to build the app as a single apk and then manually deploy it on the device.
Huh.... weird. I guess I just had to uninstall it, or something happened since the last time I tried it. I've actually tried using the normal AP$$anonymous$$ installer a few times before, but it said the package was corrupted or something, but now it works. Now I gotta fix the bigger problem, but I'm glad this is fixed. Thanks a lot! ^_^
Answer by hMark · Jul 28, 2017 at 07:43 AM
I have detailed article about clean Unity/AndroidSDK installation which also solves this issue: http://devlog.markhlavac.com/2017/06/30/installing-android-sdk-for-unity3d-using-sdk-tools-and-cli/
Your answer
Follow this Question
Related Questions
Java error when building 1 Answer
Android - Building Beta Problems. 0 Answers
Android SDK does not include any platforms! 3 Answers
Cannot build for Android 2 Answers
Run by run on android building 1 Answer