When most programmers tell their friends and families that they can code, the instant reaction can be captured by “Oh my, how did you make that tiny metal brick do that?”. The reaction is the same, whether you made a basic “Hello World!” program in VisualBasic or a Natural Language Processing algorithm in Python. Non-tech people are always amazed at what programmers can do with a few if statements and for loops. However, even if you are an experienced programmer and can code in your sleep, issues always arise, whether it be a bug in your code or a glitch in the software you are using. The more advanced the project you are working on, the more dependencies and applications you rely on that can very easily break.
Recently, I joined Vyb’s Technology Leaders and started adding code to their codebase for their new app. I have used AndroidStudio before, once or twice a few years ago, but have not used it since then. Thus, there was a learning curve getting back into the swing of native app development. The surprising thing was that the coding was not causing me an issue; the environment and IDE were causing errors left and right. I would try to build the app and I got an error for missing a dependency. I would install the dependency and try to rebuild, only to find another missing dependency. Finally, I installed every last dependency and then the Virtual Device Emulator kept crashing. I realized there was an issue with the firmware settings of my computer and had to change a setting in my BIOS to allow my graphics card to allocate extra space for the Device Emulator.
After solving one error after another in AndroidStudio, I finally had everything up and running and once again attempted to rebuild the app. The build was successful and the only thing was to connect it to the Virtual Device. Unfortunately, I the Virtual Device was stuck at a screen stating “Waiting for localhost:8080” and never updated even after refreshing the page and waiting. I never saw an error like this and did what any knowledgeable programmer would do, google it and hope someone on StackOverflow had this issue before. Sadly, no one had encountered an issue like this before and I was stuck. Luckily, Adit and Tom on team Vyb had been using AndroidStudio a lot and had a few suggestions.
I started off removing the repository and recloning, hoping there was a dependency issue with in the app itself. This did not work, so I tried removing AndroidStudio all together and then reinstalling to see if it was the platform causing the issue. Again, I came up empty and was told to try setting up my project solely on Windows. Moreover, I run Windows 10 OS, but use the Ubuntu subsystem application for all my coding and terminal usage. Once setting up my project through Command Prompt as opposed to Ubuntu everything seemed to be working except one last error occurred. My Java JDK was not the correct version that the application expected. I installed the correct JDK and set my environment variables to account for the update.
One would hope this was my last error and installing the update would resolve my long string of errors; however, AndroidStudio still would not link with the application and continue printing the error of the wrong JDK. After two restarts of my computer and rebuilding the project, the app finally built and was able to run on the Virtual Device Emulator. Now it was time to actually code.
Clearly, coding is not always the hardest part about programming; a lot of times developers face roadblocks relating to their development environment or the products they are using. This surely was an interesting process getting started with AndroidStudio, but was well worth it because now I can code in the IDE and see the instant results right on my computer on the Virtual Device. A wise person once said “Failures are part of life. If you don't fail, you don't learn. If you don't learn you'll never change”. I take this to heart and although it sounds cliche, I appreciate errors and bugs, because I can learn from them and know how to remedy them if they ever were to appear again.