{"id":3366,"date":"2014-03-23T11:24:02","date_gmt":"2014-03-23T11:24:02","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2014\/03\/23\/nosuchmethoderror-using-commonc-codec-in-android-application-collection-of-common-programming-errors\/"},"modified":"2014-03-23T11:24:02","modified_gmt":"2014-03-23T11:24:02","slug":"nosuchmethoderror-using-commonc-codec-in-android-application-collection-of-common-programming-errors","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2014\/03\/23\/nosuchmethoderror-using-commonc-codec-in-android-application-collection-of-common-programming-errors\/","title":{"rendered":"NoSuchMethodError using commonc codec in Android application-Collection of common programming errors"},"content":{"rendered":"<p>I think it has something to do with the name conflicts inside Android libraries.<\/p>\n<p>I copied the java source code of Base64 to my project into the the namespace of org.apache.commons.codec.binary. The project compiled without any problem. However, at the runtime in Android simulator, I had the same error, java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String.<\/p>\n<p>However, after I changed the namespace to com.apache.commons.codec.binary instead of org, the app runs like magic. I guess inside Android implementation, org.apache.commons.codec.binary is used and it doesn&#8217;t allow you to use it in your code again.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I think it has something to do with the name conflicts inside Android libraries. I copied the java source code of Base64 to my project into the the namespace of org.apache.commons.codec.binary. The project compiled without any problem. However, at the runtime in Android simulator, I had the same error, java.lang.NoSuchMethodError: org.apache.commons.codec.binary.Base64.encodeBase64String. However, after I changed [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-3366","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3366","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/comments?post=3366"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/3366\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=3366"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=3366"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=3366"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}