{"id":357,"date":"2014-07-03T18:00:51","date_gmt":"2014-07-03T17:00:51","guid":{"rendered":"http:\/\/www.sebcharrot.com\/blog\/?p=357"},"modified":"2014-07-03T18:00:51","modified_gmt":"2014-07-03T17:00:51","slug":"android-fix-unresolved-symbols","status":"publish","type":"post","link":"http:\/\/www.sebcharrot.com\/blog\/android-fix-unresolved-symbols\/","title":{"rendered":"Android Studio &#8211; Fix sudden unresolved symbols"},"content":{"rendered":"<p>Android Studio is a fickle beast. At times surprisingly clever and useful, and other times a flaky nightmare.<\/p>\n<p>The most recent issue I came across was when a Google Glass project suddenly stopped building with unresolved symbol errors. This manifests itself as all your &#8220;com.google.android.glass.*&#8221; imports failing, and the resulting use of any object from those libs causing compilation errors.<\/p>\n<div id=\"attachment_358\" style=\"width: 575px\" class=\"wp-caption aligncenter\"><a href=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2014\/07\/unresolved-symbols.png\"><img aria-describedby=\"caption-attachment-358\" loading=\"lazy\" class=\"size-full wp-image-358\" src=\"http:\/\/45.77.89.248\/blog\/wp-content\/uploads\/2014\/07\/unresolved-symbols.png\" alt=\"What the hell, Android Studio??\" width=\"565\" height=\"103\" srcset=\"http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2014\/07\/unresolved-symbols.png 565w, http:\/\/www.sebcharrot.com\/blog\/wp-content\/uploads\/2014\/07\/unresolved-symbols-300x55.png 300w\" sizes=\"(max-width: 565px) 100vw, 565px\" \/><\/a><p id=\"caption-attachment-358\" class=\"wp-caption-text\">What the hell, Android Studio??<\/p><\/div>\n<h1>How to fix it<\/h1>\n<p>Eventually I checked my project dependencies and explicitly added the GDK\u00a0as a library. Bingo, that sorted it out.<\/p>\n<ol type=\"1\">\n<li value=\"1\">Copy the gdk.jar\n<p>This will be in your\u00a0Android SDK directory, under <em>\/add-ons\/addon-google_gdk-google-19\/libs<\/em><\/li>\n<li>Paste it into the libs folder in your project directory\n<p><em>e.g. C:\\Projects\\MyProject\\app\\libs<\/p>\n<p><\/em><\/li>\n<li>Go to File &gt; Project Structure<\/li>\n<li>Select your module (default name is <strong>app<\/strong>)<\/li>\n<li>Click the Dependencies tab<\/li>\n<li>Click the &#8220;+&#8221; sign<\/li>\n<li>Navigate to the libs folder and select the gdk<em>.jar<\/em> file<\/li>\n<li>OK through everything<\/li>\n<\/ol>\n<p>I have zero idea why the issue suddenly arose. As with so many other issues I&#8217;ve come across in my short time developing for Android, I&#8217;ve learned to <strong>FDM<\/strong>: fix, document, and move on.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Android Studio is a fickle beast. At times surprisingly clever and useful, and other times a flaky nightmare. The most recent issue I came across was when a Google Glass project suddenly stopped building with unresolved symbol errors. This manifests itself as all your &#8220;com.google.android.glass.*&#8221; imports failing, and the resulting use of any object from&hellip;&nbsp;<a href=\"http:\/\/www.sebcharrot.com\/blog\/android-fix-unresolved-symbols\/\" class=\"\" rel=\"bookmark\">Read More &raquo;<span class=\"screen-reader-text\">Android Studio &#8211; Fix sudden unresolved symbols<\/span><\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"neve_meta_sidebar":"","neve_meta_container":"","neve_meta_enable_content_width":"","neve_meta_content_width":0,"neve_meta_title_alignment":"","neve_meta_author_avatar":"","neve_post_elements_order":"","neve_meta_disable_header":"","neve_meta_disable_footer":"","neve_meta_disable_title":""},"categories":[21],"tags":[28,29,80,93,107,122,177],"_links":{"self":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/357"}],"collection":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/comments?post=357"}],"version-history":[{"count":0,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/posts\/357\/revisions"}],"wp:attachment":[{"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/media?parent=357"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/categories?post=357"},{"taxonomy":"post_tag","embeddable":true,"href":"http:\/\/www.sebcharrot.com\/blog\/wp-json\/wp\/v2\/tags?post=357"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}