{"id":1279,"date":"2023-03-18T10:05:59","date_gmt":"2023-03-18T02:05:59","guid":{"rendered":"https:\/\/www.appblog.cn\/?p=1279"},"modified":"2023-04-29T09:22:02","modified_gmt":"2023-04-29T01:22:02","slug":"jenkins-package-android-apk-records","status":"publish","type":"post","link":"https:\/\/www.appblog.cn\/index.php\/2023\/03\/18\/jenkins-package-android-apk-records\/","title":{"rendered":"Jenkins\u6253\u5305Android apk\u8bb0\u5f55"},"content":{"rendered":"<h2>\u6784\u5efa<\/h2>\n<p><code>Freestyle project<\/code> -&gt; \u6784\u5efa -&gt; <code>Execute shell<\/code><\/p>\n<p><!-- more --><\/p>\n<pre><code>cd app\nchmod +x ..\/gradlew\n..\/gradlew clean assembleDefaultDebug assembleDefaultRelease assembleDevelopDebug assembleDevelopRelease --stacktrace<\/code><\/pre>\n<pre><code>cd app\nchmod +x ..\/gradlew\n..\/gradlew clean assembleGooglePlayDebug assembleGooglePlayRelease assembleHomeRelease assembleUpdateRelease assembleTencentRelease assembleWandoujiaRelease assembleHuaweiRelease assembleXiaomiRelease assembleVivoRelease assembleOppoRelease<\/code><\/pre>\n<h2>gradlew\u914d\u7f6e\u4ee3\u7406<\/h2>\n<p>\u5728gradlew\u7684\u540c\u4e00\u76ee\u5f55\uff0c\u7f16\u8f91<code>gradle.properties<\/code><\/p>\n<pre><code>systemProp.http.proxyHost=192.168.16.28\nsystemProp.http.proxyPort=8118\nsystemProp.https.proxyHost=192.168.16.28\nsystemProp.https.proxyPort=8118<\/code><\/pre>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"http:\/\/stackoverflow.com\/questions\/8938994\/gradlew-behind-a-proxy\">http:\/\/stackoverflow.com\/questions\/8938994\/gradlew-behind-a-proxy<\/a><\/p>\n<h2>Task not found<\/h2>\n<pre><code>Task &#039;assembleXXXDebug&#039; not found in project &#039;:app&#039;.<\/code><\/pre>\n<p>\u53c2\u8003\uff1a<a target=\"_blank\" rel=\"noopener\" href=\"https:\/\/stackoverflow.com\/questions\/49187670\/assembledebug-task-not-found-while-running-from-jenkins\">https:\/\/stackoverflow.com\/questions\/49187670\/assembledebug-task-not-found-while-running-from-jenkins<\/a><\/p>\n<pre><code>I fixed the &quot;task &#039;assembleDebug&#039; not found in root project&quot; error by adding an ANDROID_HOME environment variable<\/code><\/pre>\n<p><code>Manage Jenkins<\/code> -&gt; <code>Configure System<\/code> -&gt; <code>Environment variables<\/code> -&gt; \u65b0\u589e\u952e\u503c\u5bf9<\/p>\n<ul>\n<li><code>ANDROID_HOME<\/code> (<code>\/data\/Android\/Android-Sdk\/<\/code>)<\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>\u6784\u5efa Freestyle project -&gt; \u6784\u5efa -&gt; Execute shell cd ap [&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,229],"tags":[],"class_list":["post-1279","post","type-post","status-publish","format-standard","hentry","category-android-build","category-jenkins"],"_links":{"self":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1279","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=1279"}],"version-history":[{"count":0,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/posts\/1279\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/media?parent=1279"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/categories?post=1279"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.appblog.cn\/index.php\/wp-json\/wp\/v2\/tags?post=1279"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}