{"id":7732,"date":"2015-10-19T01:12:15","date_gmt":"2015-10-19T01:12:15","guid":{"rendered":"https:\/\/unknownerror.org\/index.php\/2015\/10\/19\/problems-using-latest-jars-from-square-retrofit-okhttp-okio-and-okhttp-urlconnection-open-source-projects-square-okhttp\/"},"modified":"2015-10-19T01:12:15","modified_gmt":"2015-10-19T01:12:15","slug":"problems-using-latest-jars-from-square-retrofit-okhttp-okio-and-okhttp-urlconnection-open-source-projects-square-okhttp","status":"publish","type":"post","link":"https:\/\/unknownerror.org\/index.php\/2015\/10\/19\/problems-using-latest-jars-from-square-retrofit-okhttp-okio-and-okhttp-urlconnection-open-source-projects-square-okhttp\/","title":{"rendered":"Problems using latest jars from Square &#8211; retrofit, okhttp, okio and okhttp-urlconnection-open source projects square\/okhttp"},"content":{"rendered":"<p>I introduced the following Square jars for a feature I&#8217;m working on:<\/p>\n<ul>\n<li>okttp-2.0.0<\/li>\n<li>okhttp-urlconnection-2.0.0.jar<\/li>\n<li>okio-1.0.0.jar<\/li>\n<li>retrofit-1.6.1.jar<\/li>\n<\/ul>\n<p>I downloaded these from the central maven repo.<\/p>\n<p>Everything worked fine locally and I committed my code to svn. We have a Jenkins CI Server that produces our debug and release builds. This failed.<\/p>\n<p>There are a number of differences between my local environment and Jenkins:<\/p>\n<ul>\n<li>locally I run java 8, Jenkins runs java 6<\/li>\n<li>locally I only produce debug builds, Jenkins produces both debug and release builds<\/li>\n<li>locally I have build tools version 22.6.2, Jenkins runs 18.0.1<\/li>\n<\/ul>\n<p>And these are the sort of issues I&#8217;m seeing in the Jenkins logs:<\/p>\n<pre><code>    -compile:\n    [javac] Compiling 545 source files to \/var\/lib\/jenkins\/jobs\/Planner_4_10_Retrofit\/workspace\/Planner_4_10_Retrofit\/bin\/classes\n    [javac] warning: \/var\/lib\/jenkins\/jobs\/Planner_4_10_Retrofit\/workspace\/Planner_4_10_Retrofit\/libs\/okhttp-2.0.0.jar(com\/squareup\/okhttp\/OkHttpClient.class): major version 51 is newer than 50, the highest major version supported by this compiler.\n    [javac] It is recommended that the compiler be upgraded.\n\n    [dex] Pre-Dexing \/var\/lib\/jenkins\/jobs\/Planner_4_10_Retrofit\/workspace\/Planner_4_10_Retrofit\/libs\/okhttp-urlconnection-2.0.0.jar -&gt; okhttp-urlconnection-2.0.0-5f923d75acdde39a4616800eb222e1bf.jar\n           [dx] \n           [dx] trouble processing:\n           [dx] bad class file magic (cafebabe) or version (0033.0000)\n           [dx] ...while parsing com\/squareup\/okhttp\/internal\/huc\/CacheAdapter.class\n           [dx] ...while processing com\/squareup\/okhttp\/internal\/huc\/CacheAdapter.class\n\n    [proguard] Initializing...\n     [proguard] Warning: retrofit.RxSupport$1: can't find superclass or interface rx.Observable$OnSubscribe\n     [proguard] Warning: okio.DeflaterSink: can't find referenced method 'int deflate(byte[],int,int,int)' in class java.util.zip.Deflater\n     [proguard] Warning: okio.DeflaterSink: can't find referenced class org.codehaus.mojo.animal_sniffer.IgnoreJRERequirement\n     [proguard] Warning: okio.Okio: can't find referenced class java.nio.file.Files\n    [proguard] Warning: retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.HTTPMethod\n     [proguard] Warning: retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchServiceFactory\n     [proguard] Warning: retrofit.appengine.UrlFetchClient: can't find referenced class com.google.appengine.api.urlfetch.URLFetchService\n    [proguard] Note: there were 10 unresolved dynamic references to classes or interfaces.\n [proguard]       You should check if you need to specify additional program jars.\n [proguard] Warning: there were 90 unresolved references to classes or interfaces.\n [proguard]          You may need to specify additional library jars (using '-libraryjars').\n [proguard] Warning: there were 1 unresolved references to program class members.\n [proguard]          Your input classes appear to be inconsistent.\n [proguard]          You may need to recompile them and try again.\n [proguard]          Alternatively, you may have to specify the option \n [proguard]          '-dontskipnonpubliclibraryclassmembers'.\n<\/code><\/pre>\n<p>Even on Jenkins the debug build says it passed but failed the release build. Is the problem only Proguard?<\/p>\n<p>I did find some settings, my current proguard file has the following directives about the the libs:<\/p>\n<pre><code>-dontwarn com.squareup.okhttp.**\n-keep class retrofit.** { *; }\n-keepclasseswithmembers class * {\n@retrofit.http.* ;\n}\n<\/code><\/pre>\n<p>With so many differences, I&#8217;m trying to find the likely culprit! Any ideas where to start? I&#8217;m loathe to change the configurstion on jenkins if I can get away with just proguard changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>I introduced the following Square jars for a feature I&#8217;m working on: okttp-2.0.0 okhttp-urlconnection-2.0.0.jar okio-1.0.0.jar retrofit-1.6.1.jar I downloaded these from the central maven repo. Everything worked fine locally and I committed my code to svn. We have a Jenkins CI Server that produces our debug and release builds. This failed. There are a number of [&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-7732","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"_links":{"self":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7732","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=7732"}],"version-history":[{"count":0,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/posts\/7732\/revisions"}],"wp:attachment":[{"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/media?parent=7732"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/categories?post=7732"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/unknownerror.org\/index.php\/wp-json\/wp\/v2\/tags?post=7732"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}