# 09.1 Build APK (without Android Studio)

We are so damn close!! This is (hopefully) the final step to SMS enlightenment!! Let's compile this damn APK already!!

1. Navigate back to the root of the frontend folder\\

   `cd ~/shSMS/shsms-frontend`\\

2. Build the app and sync with some cool Android stuff\\

   `npm run build && npx cap sync android`\\

   If that last command gave you an error that mentions Java or JDK or something along those lines, try downloading JDK 8. I'm not anything close to an expert on anything Java, but this worked for me every time when testing on different devices.\\

   `sudo apt-get install oracle-java8-installer` (Debian)\\

   `sudo pacman -S jdk8-openjdk` (Manjaro)\\

3. Navigate to the 'android' folder\\

   `cd android`\\

4. Build the APK\\

   `./gradlew assembleDebug`\\

5. Navigate to where the APK was saved\\

   `cd app/build/outputs/apk/debug`\\

6. Make sure your APK is there\\

   `ll` (lists the files in the current directory)

Do you see `app-debug.apk`? If so ***CONGRATULATIONS!*** 🎉

I said this was the last step, but our APK isn't on our device yet, soooo I guess there's one more, but heck, it's easy I swear!!

#### Troubleshooting:

* If you get an error while building that says something about a `local.properties` file not being there. Navigate to `shsms-frontend/android` and create a file called `local.properties`. Inside that file add `sdk.dir=/home/<username>/path-to-sdk/Sdk`. So for me it's `sdk.dir=/home/pyewacket/Android/Sdk`. Save the file and try to rebuild again.
