Unity Android Support Setup JDK SDK NDK Gradle For All Versions

0
3544
Unity Android Support Setup JDK SDK NDK Gradle For All Versions
Unity Android Support Setup JDK SDK NDK Gradle For All Versions

Unity Android Support Setup JDK SDK NDK Gradle For All Versions .

Unity Android Support Setup JDK SDK NDK Gradle

to can build game on unity you must setup jdk and sdk and ndk and gradle seperated not use default unity jdk and sdk and ndk and gradle and to do this follow this steps currectly .

1 – Install JDK

For Unity 2018 and 2019 and 2020 and 2021 download java jdk 1.8.0_77 you will find in the article How to Install Java JDK 1.8.0_77 the right way to download and install java jdk 1.8.0_77 .

After that go to pc icon then choose C Drive and choose Program Files folder then choose Java folder then choose jdk1.8.0_77 folder and copy folder path like this

C:\Program Files\Java\jdk1.8.0_77

and go to unity and choose Edit then choose preferences then choose External Tools and scroll to JDK and uncheck box for JDK Installed with Unity and in the JDK field paste

C:\Program Files\Java\jdk1.8.0_77
– For Unity 2022 and above Download jdk-11.0.16.1_windows-x64_bin.exe .
Setup jdk-11.0.16.1_windows-x64_bin.exe .
go to c drive then program files then java folder then jdk-11.0.16.1 folder then copy folder path like this
C:\Program Files\Java\jdk-11.0.16.1
go to unity choose edit then preferences then External Tools and scroll down to JDK uncheck the box and past the jdk folder path .

2 – Install SDK

Go to Android Studio Website and download android studio and follow article How to Install SDK
to install sdk from android studio to work sdk properly .

And go to Android Studio then open SDK Manager and copy Android SDK Location then go to Unity and choose Edit then Preferences then External Tools and scroll to SDK and unckeck box for Android SDK Tools and Paste Android SDK Location path .

3 – Install NDK

There is different version of ndk for every unity version
For Unity Version 2019 or 2020 Download NDK r19 .
For Unity Version 2021 Download NDK r21d .
For Unity 2022 Download NDK r23b .

After download ndk extract it and open ndk folder and copy ndk folder path then go to unity then Edit then Preferences then External Tools and scroll to NDK and uncheck box Android NDK installed with Unity and paste ndk folder path .

4 – Install Gradle

Go to Download and Install Gradle to download gradle .

in these days gradle version 7 have problem so download gradle-6.9.2-all.zip

after download gradle extract it and open gradle folder then copy gradle folder path then go to unity then Edit then Preferences then External Tools and scroll to Gradle and uncheck Gradle Installed with Unity and paste gradle folder path .

Now it ready to build game choose File then Build Settings then Build button .
– to run game in android 11 or 12 or above follow this step :
fix android 12 and above to Generate APK file to test game in phone And Generate AAB file to upload game in google play : You uploaded an APK or Android App Bundle which has an activity, activity alias, service in Unity