{"id":32,"date":"2022-05-05T00:25:59","date_gmt":"2022-05-05T00:25:59","guid":{"rendered":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/?p=32"},"modified":"2022-05-05T00:28:20","modified_gmt":"2022-05-05T00:28:20","slug":"expo-and-apk-files","status":"publish","type":"post","link":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/2022\/05\/05\/expo-and-apk-files\/","title":{"rendered":"Expo and .apk files"},"content":{"rendered":"\n<p>This week I had to make my first release build for android with Expo for my react native project. I assumed this would consist of running a command and placing the .apk file on the android emulator. I figured that would take me about 15 minutes. It ended up taking me a little bit longer.<\/p>\n\n\n\n<p>After copy and pasting 5 or so commands into my terminal to generate the .apk, and having that fail, I realized I would have to actually read the content in those posts. I found I had to generate the android folder with expo for my application. That failed for various reasons, and I tried various fixes. What worked was having it fail, manually putting a file with the android sdk route in the half generated android folder, and running it again. Sweet, I got a .apk file. <\/p>\n\n\n\n<p>So I go to android studio and I import the .apk. Unfortunately, I get an error regarding the android SDK. I look for a fix online for about one hour, all the solutions are for a previous version of android. Eventually I find this post by a hero on stack overflow explaining I need to click these 5 obscure android studio options to manually set the SDK for the module (whatever that means). I do that, I hit the button, the emulator shows up, YES! It shows a black box&#8230; I realize that my emulator version doesn&#8217;t correspond to the one I just set for the module. I update my emulator and this time I get&#8230; a white box. Alright. Progress.<\/p>\n\n\n\n<p>So I figured the problem had something to do with my .apk file. I probably compiled it wrong or something. I recompile it the exact same way I did the first time and try again (as if that would do anything). Obviously it works now, except the pictures for my application are not loading. After reading a bunch of more stuff on stack overflow, I compile from inside the android folder with a different command, and everything finally works perfectly in android studio. I can now turn in my homework. <\/p>\n\n\n\n<p>It was definitely not fun going through all of that, but I did learn a lot about using expo with react native, .apk files, and how to work with android studio. I have come to learn that hanging in there to fix an annoying problems is a big part of learning to code.  Although I would prefer not go through a similar learning experience anytime soon. <\/p>\n\n\n\n<p>See you next time!<\/p>\n\n\n\n<p><\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>This week I had to make my first release build for android with Expo for my react native project. I assumed this would consist of running a command and placing the .apk file on the android emulator. I figured that would take me about 15 minutes. It ended up taking me a little bit longer. [&hellip;]<\/p>\n","protected":false},"author":12260,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-32","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/posts\/32","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/users\/12260"}],"replies":[{"embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/comments?post=32"}],"version-history":[{"count":3,"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/posts\/32\/revisions"}],"predecessor-version":[{"id":35,"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/posts\/32\/revisions\/35"}],"wp:attachment":[{"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/media?parent=32"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/categories?post=32"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/blogs.oregonstate.edu\/danscoolblog\/wp-json\/wp\/v2\/tags?post=32"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}