{"id":1854,"date":"2023-03-29T22:04:15","date_gmt":"2023-03-29T14:04:15","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1854"},"modified":"2023-04-22T09:09:05","modified_gmt":"2023-04-22T01:09:05","slug":"various-pitfalls-encountered-when-releasing-android-projects-to-jcenter","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/29\/various-pitfalls-encountered-when-releasing-android-projects-to-jcenter\/","title":{"rendered":"Android\u53d1\u5e03\u9879\u76ee\u5230JCenter\u9047\u5230\u7684\u5404\u79cd\u5751"},"content":{"rendered":"<h2>\u5751\u4e00\uff1aLint\u68c0\u67e5<\/h2>\n<pre><code class=\"language-java\">FAILURE: Build failed with an exception.\n\n* What went wrong:\nExecution failed for task &#039;:testLib:lint&#039;.\n> Lint found errors in the project; aborting build.\n\n  Fix the issues identified by lint, or add the following to your build script to proceed with errors:\n  ...\n  android {\n      lintOptions {\n          abortOnError false\n      }\n  }\n  ...<\/code><\/pre>\n<p><!-- more --><\/p>\n<p>Lint \u68c0\u67e5\u9ed8\u8ba4\u662f\u5f00\u542f\u7684\uff0cLint \u4f1a\u68c0\u67e5\u9879\u76ee\u4e2d\u7684\u8bed\u6cd5\u9519\u8bef\uff0c\u5982\u679c\u6ca1\u6709\u901a\u8fc7\u5219\u65e0\u6cd5\u7ee7\u7eed\u3002\u53ea\u9700\u8981\u5728 Module \u7684<code>build.gradle<\/code>\u6dfb\u52a0\u5982\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><code class=\"language-java\">android {\n    lintOptions {\n        abortOnError false\n    }\n}<\/code><\/pre>\n<h2>\u5751\u4e8c\uff1ajavadoc\u51fa\u9519<\/h2>\n<pre><code class=\"language-java\">FAILURE: Build failed with an exception.\n\n* What went wrong:\nExecution failed for task &#039;:testLib:javadoc&#039;.\n> Javadoc generation failed. Generated Javadoc options file (useful for troubleshooting): &#039;\/...\/javadoc.options&#039;<\/code><\/pre>\n<p>javadoc\u51fa\u9519\uff0c\u5728Project\u7684<code>build.gradle<\/code>\u52a0\u5165\u4ee5\u4e0b\u4ee3\u7801\uff1a<\/p>\n<pre><code>tasks.getByPath(&quot;:testLib:javadoc&quot;).enabled = false<\/code><\/pre>\n<h2>\u5751\u4e09\uff1aJDK\u7248\u672c<\/h2>\n<pre><code class=\"language-java\">FAILURE: Build failed with an exception.\n\n* What went wrong:\nA problem occurred evaluating project &#039;:testLib&#039;.\n> java.lang.UnsupportedClassVersionError: com\/android\/build\/gradle\/LibraryPlugin : Unsupported major.minor version 52.0<\/code><\/pre>\n<p>\u9020\u6210\u8fd9\u4e2a\u539f\u56e0\u662f\u56e0\u4e3ajdk\u7248\u672c\u4e0d\u4e00\u81f4\u3002\u6839\u636e\u4ee5\u4e0b\u7684\u7248\u672c\u5bf9\u5e94\u5173\u7cfb\uff0c\u4e0b\u8f7d\u76f8\u5bf9\u5e94\u7684jdk \u7248\u672c\u5373\u53ef\uff0c\u7248\u672c\u7684\u5bf9\u5e94\u5173\u7cfb\u5982\u4e0b\uff1a<\/p>\n<pre><code>J2SE 8 = 52,\nJ2SE 7 = 51,\nJ2SE 6.0 = 50,\nJ2SE 5.0 = 49,\nJDK 1.4 = 48,\nJDK 1.3 = 47,\nJDK 1.2 = 46,\nJDK 1.1 = 45,<\/code><\/pre>\n<h2>\u5751\u56db\uff1a\u914d\u7f6e\u9519\u8bef<\/h2>\n<pre><code class=\"language-java\">FAILURE: Build failed with an exception.\n\n* What went wrong:\nExecution failed for task &#039;:testLib:bintrayUpload&#039;.\n> Could not create package &#039;maiml\/maven\/WxRecoderVideo&#039;: HTTP\/1.1 404 Not Found [message:Repo &#039;maven&#039; was not found]<\/code><\/pre>\n<p>\u5728Bintray\u4e2d\u6ca1\u6709\u627e\u5230<code>build.gradle<\/code>\u914d\u7f6e\u7684\u5e93\u540d<\/p>\n<pre><code class=\"language-java\">bintray {\n    user = properties.getProperty(&quot;bintray.user&quot;)\n    key = properties.getProperty(&quot;bintray.apikey&quot;)\n    configurations = [&#039;archives&#039;]\n    pkg {\n        repo = &quot;maven&quot;  \/\/\u53d1\u5e03\u5230Bintray\u7684\u4ed3\u5e93\n        name = &quot;WxRecoderVideo&quot;  \/\/\u53d1\u5e03\u5230Bintray\u7684\u5e93\u540d\n        desc = &quot;A library look line wechat recoder video&quot;\n        websiteUrl = siteUrl\n        vcsUrl = gitUrl\n        issueTrackerUrl = issueUrl\n        licenses = [&quot;Apache-2.0&quot;]\n        labels = [&quot;android&quot;]  \/\/\u6807\u7b7e\n        publish = true\n        publicDownloadNumbers = true\n    }\n}<\/code><\/pre>\n<h2>\u5751\u4e94\uff1a\u4ee3\u7406\u9519\u8bef<\/h2>\n<p>\u6700\u540e\u4e00\u6b65\u5361\u572897%\uff0c\u8bf7\u68c0\u67e5\u662f\u5426\u5f00\u542f\u4e86proxy\uff0c\u68c0\u67e5<code>gradle.properties<\/code>\u4e0b\u662f\u5426\u6709proxy\u7684\u4fe1\u606f\uff0c\u5c06\u4e4b\u5220\u9664<\/p>\n","protected":false},"excerpt":{"rendered":"<p>\u5751\u4e00\uff1aLint\u68c0\u67e5 FAILURE: Build failed with an exception. * Wh [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[202],"tags":[477],"class_list":["post-1854","post","type-post","status-publish","format-standard","hentry","category-android-build","tag-jcenter"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1854","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/comments?post=1854"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1854\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1854"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1854"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1854"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}