Build to Target API Level 31 or above in ANY version of Unity (July 2022)

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
when i recorded this video i was using windows 7 on a computer i built 15 16 years ago i upgraded a few parts along the way but i ran into a lot of issues i recently built a new one i had windows 10 it seemed to be a lot easier to install and get this to build on to android but this video will walk you through the entire process no matter what machine build any type you're using should work fine so let's get into it whenever you install any editor make sure you check android build support android sdk and ndk tools and open jdk if you do not have them installed when you install unity you can always go back and add them add the modules later i might just open up a new project i want to go to file build settings and in build settings click on android on the platform and select switch platform at the bottom this may take a few minutes but it's best to do this as early as possible in your project after that click on the player settings tab in the bottom left once in here you should be in the player tab in the project settings if not you can click on it on the left go down to other settings in other settings scroll down until you see identification and change your minimum api level and your target api level to reflect api level 31 or whichever one you're trying to build to you want to make sure you change both of these that might take some time as well to convert and at the bottom in publishing settings there's a few check boxes here but we'll go over that later i just wanted to show you since they are in this window as well if you may be able to have a successful build now unfortunately i do not at this point it's giving me this error so let's fix that if you go to edit preferences and external tools to on the left scroll all the way down to the bottom make sure you check stop gradle daemons on exit that fixed an issue i had in a previous install this is where you change all your jdk sdk and ndk and gradle files you can set them to wherever you have if you downloaded a new one the error i was getting was because i didn't have the ndk box checked and i was not pointing to a specific file location so if we look into the unity documentation right here version compatibility 2019.4 it says use 5.11 gradle but um i had 10 i had to use 6.1 so i'm not sure why just go to this website here i'll put a link in the description and scroll all the way down until you see gradle 6.1.1 all zip make sure you download download that i already downloaded it so i'll cancel this and the jdk 1.8 as well if sc 8 is the same as 1.8 if you're having confusing issues there just click on that link i'll also put this in the description and um 8u 333 is the one i was actually using at the time just click on that right here and the ndk you can download as well if you do not have the proper ndk just follow the link i'll try to put that link in the description as well you may be able to build successfully now if not there well unfortunately i couldn't i had to go through a few other things especially for 2019 one of them is downloading android studio once you have that downloaded open it up i'm using shapemonk version 2021.2.1 at the moment click on more actions once it's loaded and scroll down to sdk manager there and in here you can actually change your location to your where your unity is actually located you want to upgrade the unity sdk so you make sure you change that file to that location and then select api level 31 or whichever one you're going to build to 32 was available before it looks like 33 is available now go over to your sdk tools and make sure you download 30.00.3 do not use 31 unless they happen to fix it that one actually had issues in the past you can try to build now you may be successful if not i had to do a few other things go into c program files unity the hub editor find your 2019.4 go into editor data and playback engines and android player sdk folder and the build tools here you will see the build tools you just updated click on your 30.0.3 if you scroll down in this folder there'll be a d8.bat file you can copy your d8.bat and rename it to dx.bat and just have both in there or you can write over it and just change your name from d8 to dx also when you're done with that you want to go up into the library folder in this folder you also want to change the d8.jar file to dx.jar and you can try to build now but i still had to do even more to get my 2019 to build correctly so let's go to the project settings edit project settings this is what i was talking about earlier in the publishing settings tab if you click on custom main manifest custom main gradle template and custom launcher gradle templates when you check these boxes unity will generate files for you and you should have a plugins folder if you go in there go into android here are the three files that unity is generated for us if you open them up we had to make a few edits a few changes in here so an androidmanifest dot xml file i had to add android exported equals true this line here if there was a comment up top i believe i had to just remove the entire comment i'm not sure which file that was in the launcher template gradle you want to make sure you go down to your target or your build tools version and change that to 30. 0.3 and also from build tools to 30.0.3 you also want to do the same in your main template gradle file change your build tools from build tools to 30.0.3 and this basically tells you to not use the build tools that came with unity but use the specific build tools you're telling it here and also verify that the java version is 1.8 as well if you followed all these steps you should be able to build no problem if you're still having issues or if you didn't understand part of the video leave a comment i'll steer you in the right direction hopefully and get your build working successfully please like subscribe whatever share this video whatever you need to do thanks
Info
Channel: Ninja Dailey
Views: 23,382
Rating: undefined out of 5
Keywords:
Id: X_1Wifb0RHw
Channel Id: undefined
Length: 7min 37sec (457 seconds)
Published: Mon Aug 01 2022
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.