{"id":172268,"date":"2024-05-08T17:47:01","date_gmt":"2024-05-08T09:47:01","guid":{"rendered":"https:\/\/docs.pingcode.com\/ask\/ask-ask\/172268.html"},"modified":"2024-05-08T17:47:04","modified_gmt":"2024-05-08T09:47:04","slug":"%e3%80%90%e5%ae%89%e5%8d%93%e5%bc%80%e5%8f%91%e3%80%91-%e8%bf%99%e4%b8%aaapp%e6%96%87%e4%bb%b6%e5%a4%b9%e5%92%8c%e4%b8%8b%e9%9d%a2%e9%82%a3%e4%b8%aa%e5%b7%a5%e7%a8%8b%e7%9a%84%e6%96%87%e4%bb%b6","status":"publish","type":"post","link":"https:\/\/docs.pingcode.com\/ask\/172268.html","title":{"rendered":"\u3010\u5b89\u5353\u5f00\u53d1\u3011 \u8fd9\u4e2aapp\u6587\u4ef6\u5939\u548c\u4e0b\u9762\u90a3\u4e2a\u5de5\u7a0b\u7684\u6587\u4ef6\u5939\u7684\u533a\u522b\u662f\u5565"},"content":{"rendered":"<p style=\"text-align:center\"><img decoding=\"async\" src=\"https:\/\/cdn-kb.worktile.com\/kb\/wp-content\/uploads\/2024\/04\/27043821\/eadec1b7-6a02-4639-ae55-2f61ae5613bf.webp\" alt=\"\u3010\u5b89\u5353\u5f00\u53d1\u3011 \u8fd9\u4e2aapp\u6587\u4ef6\u5939\u548c\u4e0b\u9762\u90a3\u4e2a\u5de5\u7a0b\u7684\u6587\u4ef6\u5939\u7684\u533a\u522b\u662f\u5565\" \/><\/p>\n<p><p><strong>\u5b89\u5353\u5f00\u53d1\u4e2d\u7684app\u6587\u4ef6\u5939\u901a\u5e38\u4ee3\u8868\u5e94\u7528\u6a21\u5757\u3001\u5305\u542b\u672c\u5730\u4ee3\u7801\u548c\u8d44\u6e90<\/strong>\uff0c\u800c\u53e6\u4e00\u4e2a\u5de5\u7a0b\u7684\u6587\u4ef6\u5939\u53ef\u80fd\u662f\u6307\u6574\u4e2a\u5de5\u7a0b\u9879\u76ee\u7684\u76ee\u5f55\uff0c\u8fd9\u4e2a\u76ee\u5f55\u4e2d\u4e0d\u4ec5\u5305\u62ecapp\u6a21\u5757\uff0c\u8fd8\u53ef\u80fd\u5305\u62ec\u5e93\u6a21\u5757\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u811a\u672c\u7b49\u3002\u5177\u4f53\u800c\u8a00\uff0c<strong>app\u6587\u4ef6\u5939\u662f\u5de5\u7a0b\u76ee\u5f55\u7684\u4e00\u4e2a\u5b50\u96c6<\/strong>\uff0c\u8d1f\u8d23\u5b58\u653eapp\u7279\u6709\u7684\u6e90\u4ee3\u7801\u3001\u8d44\u6e90\u6587\u4ef6\u5982\u5e03\u5c40\uff08XML\uff09\u3001\u56fe\u7247\uff08PNG\u3001JPG\uff09\u3001\u97f3\u89c6\u9891\u7b49\uff0c\u4ee5\u53ca\u4e0eapp\u76f4\u63a5\u76f8\u5173\u7684\u6784\u5efa\u914d\u7f6e\u6587\u4ef6\uff0c\u6bd4\u5982 build.gradle \u6587\u4ef6\u3002<\/p>\n<\/p>\n<p><h3>\u4e00\u3001APP\u6587\u4ef6\u5939\u8be6\u89e3<\/h3>\n<\/p>\n<p><p>\u5728Android Studio\u4e2d\u521b\u5efa\u7684\u9879\u76ee\u901a\u5e38\u5177\u6709\u4e00\u4e2a\u6807\u51c6\u7684\u6587\u4ef6\u5939\u7ed3\u6784\u3002\u9879\u76ee\u7684\u4e3b\u8981\u90e8\u5206\u901a\u5e38\u5305\u542b\u5728\u4e00\u4e2a\u540d\u4e3a\u201capp\u201d\u7684\u6a21\u5757\u4e2d\uff0c\u8fd9\u4e2a\u6a21\u5757\u627f\u8f7d\u7740\u5e94\u7528\u7a0b\u5e8f\u7279\u5b9a\u7684\u5185\u5bb9\u3002<\/p>\n<\/p>\n<p><p><strong>\u6e90\u4ee3\u7801\u548c\u8d44\u6e90\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>src\/m<a href=\"https:\/\/docs.pingcode.com\/blog\/59162.html\" target=\"_blank\">AI<\/a>n\/java<\/strong>\uff1a\u5b58\u653eJava\u6e90\u4ee3\u7801\u6587\u4ef6\uff0c\u5305\u62ecactivity\u3001service\u7b49\u7ec4\u4ef6\u7684\u5b9e\u73b0\u4ee5\u53ca\u5176\u4ed6\u7c7b\u6587\u4ef6\u3002<\/li>\n<li><strong>src\/main\/res<\/strong>\uff1a\u5b58\u653e\u8d44\u6e90\u6587\u4ef6\uff0c\u5982\u5e03\u5c40\uff08layout\uff09XML\u6587\u4ef6\u3001\u56fe\u7247\uff08drawable\uff09\u3001\u5b57\u7b26\u4e32\uff08values\uff09\u7b49\u3002<\/li>\n<li><strong>src\/main\/AndroidManifest.xml<\/strong>\uff1aAndroid\u5e94\u7528\u7684\u914d\u7f6e\u6587\u4ef6\uff0c\u5b9a\u4e49\u4e86\u5e94\u7528\u7684\u5305\u540d\u3001\u7ec4\u4ef6\u58f0\u660e\u7b49\u3002<\/li>\n<\/ul>\n<p><p><strong>Gradle\u811a\u672c<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>build.gradle (Module: app)<\/strong>\uff1a\u8fd9\u4e2a\u6587\u4ef6\u5305\u542b\u4e86\u6a21\u5757\u7ea7\u522b\u7684\u6784\u5efa\u811a\u672c\uff0c\u5b9a\u4e49\u4e86\u5e94\u7528\u7684\u7f16\u8bd1\u548c\u6253\u5305\u8bbe\u7f6e\u3002<\/li>\n<\/ul>\n<p><h3>\u4e8c\u3001\u5de5\u7a0b\u6587\u4ef6\u5939\u6982\u8ff0<\/h3>\n<\/p>\n<p><p>\u800c\u5de5\u7a0b\u6587\u4ef6\u5939\u5219\u662f\u4e00\u4e2a\u66f4\u4e3a\u5b8f\u89c2\u7684\u6982\u5ff5\uff0c\u5b83\u901a\u5e38\u5305\u542bapp\u6587\u4ef6\u5939\u548c\u5176\u4ed6\u8bb8\u591a\u91cd\u8981\u7684\u7ec4\u6210\u90e8\u5206\u3002<\/p>\n<\/p>\n<p><p><strong>\u7b2c\u4e00\u5c42\u7ea7<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>app<\/strong>\uff1a\u5982\u4e0a\u6240\u8ff0\uff0c\u5305\u542b\u5e94\u7528\u6a21\u5757\u7684\u5185\u5bb9\u3002<\/li>\n<li><strong>gradle<\/strong>\uff1a\u5305\u542bGradle\u7684Wrapper\u811a\u672c\uff0c\u786e\u4fdd\u5f00\u53d1\u8005\u4e4b\u95f4\u4f7f\u7528\u76f8\u540c\u7684Gradle\u7248\u672c\u3002<\/li>\n<li><strong>libraries<\/strong>\uff08\u5982\u679c\u6709\u7684\u8bdd\uff09\uff1a\u5b58\u653e\u9879\u76ee\u4f7f\u7528\u7684\u5e93\u6587\u4ef6\u3002<\/li>\n<li><strong>.gradle<\/strong>\u3001<strong>.idea<\/strong>\uff1a\u542b\u6709\u9879\u76ee\u7684\u914d\u7f6e\u6587\u4ef6\u4ee5\u53caIDE\u7684\u7f13\u5b58\u6587\u4ef6\u3002<\/li>\n<\/ul>\n<p><p><strong>\u9879\u76ee\u6839\u76ee\u5f55\u7684\u914d\u7f6e\u6587\u4ef6<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>build.gradle (Project: YourProjectName)<\/strong>\uff1a\u9879\u76ee\u7ea7\u522b\u7684\u6784\u5efa\u811a\u672c\uff0c\u5b9a\u4e49\u4e86\u5168\u5c40\u7684\u6784\u5efa\u914d\u7f6e\u548c\u4f9d\u8d56\u5173\u7cfb\u3002<\/li>\n<li><strong>settings.gradle<\/strong>\uff1a\u7528\u4e8e\u5305\u542b\u9879\u76ee\u4e2d\u6240\u6709\u6a21\u5757\uff0c\u544a\u8bc9Gradle\u8fd9\u4e9b\u6a21\u5757\u662f\u9879\u76ee\u7684\u4e00\u90e8\u5206\u3002<\/li>\n<li><strong>gradlew<\/strong>\u548c<strong>gradlew.bat<\/strong>\uff1a\u7528\u4e8e\u5728\u547d\u4ee4\u884c\u4e2d\u542f\u52a8Gradle Wrapper\u3002<\/li>\n<\/ul>\n<p><p><strong>\u7248\u672c\u63a7\u5236\u6587\u4ef6\u5939<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>.git<\/strong>\u6216.svn\uff1a\u5982\u679c\u9879\u76ee\u4f7f\u7528Git\u6216Subversion\u8fdb\u884c\u7248\u672c\u63a7\u5236\uff0c\u8fd9\u4e9b\u6587\u4ef6\u5939\u4e2d\u5c06\u5b58\u653e\u76f8\u5173\u7684\u7248\u672c\u63a7\u5236\u4fe1\u606f\u3002<\/li>\n<\/ul>\n<p><h3>\u4e09\u3001\u6a21\u5757\u4e0e\u5de5\u7a0b\u7ed3\u6784\u5bf9\u6bd4<\/h3>\n<\/p>\n<p><p>\u5728\u5b9e\u9645\u64cd\u4f5c\u4e2d\uff0c\u5f00\u53d1\u8005\u901a\u5e38\u4f1a\u9047\u5230\u53ea\u5305\u542b\u5355\u4e00app\u6a21\u5757\u7684\u7b80\u5355\u9879\u76ee\uff0c\u4e5f\u53ef\u80fd\u9047\u5230\u5305\u542b\u591a\u4e2a\u6a21\u5757\u7684\u590d\u6742\u9879\u76ee\uff0c\u6bd4\u5982\uff1a<\/p>\n<\/p>\n<p><p><strong>\u5e94\u7528\u7a0b\u5e8f\u6a21\u5757\u4e0e\u5e93\u6a21\u5757<\/strong><\/p>\n<\/p>\n<ul>\n<li><strong>app<\/strong>\uff1a\u5e94\u7528\u7a0b\u5e8f\u672c\u8eab\u7684\u6a21\u5757\u3002<\/li>\n<li><strong>librarymodule<\/strong>\uff1a\u4f5c\u4e3a\u4f9d\u8d56\u88abapp\u6a21\u5757\u5f15\u7528\u7684\u81ea\u5b9a\u4e49\u5e93\u3002<\/li>\n<\/ul>\n<p><p>\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0c\u53ef\u4ee5\u6839\u636e\u5b9e\u9645\u9700\u6c42\u521b\u5efa\u591a\u4e2a\u6a21\u5757\uff0c\u6bcf\u4e2a\u6a21\u5757\u53ef\u4ee5\u88ab\u7f16\u8bd1\u6210apk\u6587\u4ef6\u6216\u8005aar\u5e93\u6587\u4ef6\uff0c\u4f7f\u5f97\u4ee3\u7801\u91cd\u7528\u548c\u6a21\u5757\u5316\u7ba1\u7406\u6210\u4e3a\u53ef\u80fd\u3002<\/p>\n<\/p>\n<p><h3>\u56db\u3001\u6587\u4ef6\u5939\u5bf9\u5f00\u53d1\u7684\u610f\u4e49<\/h3>\n<\/p>\n<p><p><strong>\u7ed3\u6784\u5316\u7ba1\u7406<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5de5\u7a0b\u7684\u6587\u4ef6\u5939\u7ed3\u6784\u4e3a\u4ee3\u7801\u548c\u8d44\u6e90\u7684\u7ec4\u7ec7\u63d0\u4f9b\u4e86\u6e05\u6670\u7684\u6846\u67b6\uff0c\u4fbf\u4e8e\u5f00\u53d1\u548c\u7ef4\u62a4\u3002<\/li>\n<\/ul>\n<p><p><strong>\u6a21\u5757\u5316\u7f16\u7a0b<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u5206\u79bbapp\u6a21\u5757\u548c\u5e93\u6a21\u5757\u6709\u52a9\u4e8e\u6a21\u5757\u5316\u7f16\u7a0b\uff0c\u63d0\u9ad8\u4ee3\u7801\u7684\u53ef\u590d\u7528\u6027\u3002<\/li>\n<\/ul>\n<p><p><strong>\u6784\u5efa\u4e0e\u914d\u7f6e<\/strong><\/p>\n<\/p>\n<ul>\n<li>\u4e0d\u540c\u6587\u4ef6\u5939\u7684\u6784\u5efa\u811a\u672c\u5141\u8bb8\u5bf9\u9879\u76ee\u8fdb\u884c\u7ec6\u7c92\u5ea6\u7684\u6784\u5efa\u548c\u914d\u7f6e\u3002<\/li>\n<\/ul>\n<p><p>\u603b\u4e4b\uff0c\u4e86\u89e3\u8fd9\u4e24\u79cd\u6587\u4ef6\u5939\u7684\u533a\u522b\u6709\u52a9\u4e8e\u66f4\u597d\u5730\u7ba1\u7406\u9879\u76ee\u7ed3\u6784\uff0c\u5bf9\u4e8e\u7ef4\u62a4\u5927\u578b\u9879\u76ee\u548c\u56e2\u961f\u5408\u4f5c\u5f00\u53d1\u5c24\u5176\u91cd\u8981\u3002\u901a\u8fc7\u6709\u6548\u5730\u7ec4\u7ec7\u4ee3\u7801\u548c\u8d44\u6e90\uff0c\u53ef\u4ee5\u63d0\u9ad8\u5f00\u53d1\u6548\u7387\uff0c\u7b80\u5316\u6784\u5efa\u548c\u90e8\u7f72\u6d41\u7a0b\u3002<\/p>\n<\/p>\n<h2><strong>\u76f8\u5173\u95ee\u7b54FAQs\uff1a<\/strong><\/h2>\n<p><strong>1. \u5b89\u5353\u5f00\u53d1\u4e2d\u7684app\u6587\u4ef6\u5939\u548c\u5de5\u7a0b\u6587\u4ef6\u5939\u6709\u4f55\u533a\u522b\uff1f<\/strong><\/p>\n<p>\u5728\u5b89\u5353\u5f00\u53d1\u4e2d\uff0capp\u6587\u4ef6\u5939\u548c\u5de5\u7a0b\u6587\u4ef6\u5939\u5728\u529f\u80fd\u548c\u7528\u9014\u4e0a\u6709\u4e00\u4e9b\u4e0d\u540c\u4e4b\u5904\u3002app\u6587\u4ef6\u5939\u662f\u4e00\u4e2a\u7279\u5b9a\u4e8e\u5e94\u7528\u7a0b\u5e8f\u7684\u6587\u4ef6\u5939\uff0c\u5305\u542b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u6e90\u4ee3\u7801\u3001\u8d44\u6e90\u6587\u4ef6\u3001\u5e03\u5c40\u6587\u4ef6\u4ee5\u53ca\u5176\u4ed6\u4e0e\u5e94\u7528\u7a0b\u5e8f\u76f8\u5173\u7684\u6587\u4ef6\u3002\u800c\u5de5\u7a0b\u6587\u4ef6\u5939\u5219\u662f\u6574\u4e2a\u5b89\u5353\u9879\u76ee\u7684\u6839\u76ee\u5f55\uff0c\u5305\u542b\u4e86\u591a\u4e2a\u6a21\u5757\u548c\u7ec4\u4ef6\uff0c\u5176\u4e2d\u5305\u62ec\u4e86app\u6587\u4ef6\u5939\u4ee5\u53ca\u5176\u4ed6\u652f\u6301\u5e93\u3001\u914d\u7f6e\u6587\u4ef6\u3001\u6587\u6863\u7b49\u3002<\/p>\n<p><strong>2. app\u6587\u4ef6\u5939\u548c\u5de5\u7a0b\u6587\u4ef6\u5939\u5728\u5b89\u5353\u5f00\u53d1\u4e2d\u7684\u4f5c\u7528\u5404\u662f\u4ec0\u4e48\uff1f<\/strong><\/p>\n<p>app\u6587\u4ef6\u5939\u662f\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u7684\u6838\u5fc3\u6587\u4ef6\u5939\uff0c\u5b83\u5305\u542b\u4e86\u5e94\u7528\u7a0b\u5e8f\u7684\u6240\u6709\u6e90\u4ee3\u7801\u548c\u8d44\u6e90\u6587\u4ef6\u3002\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5728\u8fd9\u4e2a\u6587\u4ef6\u5939\u4e2d\u7f16\u5199\u548c\u4fee\u6539\u5e94\u7528\u7a0b\u5e8f\u7684\u903b\u8f91\u4ee3\u7801\u3001\u5e03\u5c40\u6587\u4ef6\u3001\u56fe\u50cf\u8d44\u6e90\u7b49\u3002\u800c\u5de5\u7a0b\u6587\u4ef6\u5939\u5219\u662f\u7528\u6765\u7ba1\u7406\u6574\u4e2a\u5b89\u5353\u9879\u76ee\u7684\u6587\u4ef6\u5939\uff0c\u5176\u4e2d\u5305\u62ec\u4e86\u591a\u4e2a\u6a21\u5757\u548c\u7ec4\u4ef6\u3002\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5728\u5de5\u7a0b\u6587\u4ef6\u5939\u4e2d\u7ba1\u7406\u548c\u914d\u7f6e\u5404\u4e2a\u6a21\u5757\u3001\u5e93\u4ee5\u53ca\u5de5\u5177\u7b49\uff0c\u5e76\u4e14\u53ef\u4ee5\u8fdb\u884c\u6574\u4e2a\u9879\u76ee\u7684\u6784\u5efa\u548c\u7f16\u8bd1\u3002<\/p>\n<p><strong>3. app\u6587\u4ef6\u5939\u548c\u5de5\u7a0b\u6587\u4ef6\u5939\u5982\u4f55\u534f\u540c\u5de5\u4f5c\u5b8c\u6210\u5e94\u7528\u7a0b\u5e8f\u7684\u5f00\u53d1\uff1f<\/strong><\/p>\n<p>\u5728\u5b89\u5353\u5f00\u53d1\u8fc7\u7a0b\u4e2d\uff0capp\u6587\u4ef6\u5939\u548c\u5de5\u7a0b\u6587\u4ef6\u5939\u662f\u76f8\u4e92\u534f\u4f5c\u7684\u3002\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5728app\u6587\u4ef6\u5939\u4e2d\u4fee\u6539\u548c\u8c03\u8bd5\u5e94\u7528\u7a0b\u5e8f\u7684\u6e90\u4ee3\u7801\uff0c\u5e76\u5728\u5de5\u7a0b\u6587\u4ef6\u5939\u4e2d\u914d\u7f6e\u548c\u7ba1\u7406\u5404\u4e2a\u6a21\u5757\u548c\u4f9d\u8d56\u3002\u901a\u8fc7gradle\u6784\u5efa\u5de5\u5177\uff0c\u5f00\u53d1\u4eba\u5458\u53ef\u4ee5\u5c06\u5de5\u7a0b\u6587\u4ef6\u5939\u4e0b\u7684\u6240\u6709\u7ec4\u4ef6\u548c\u6a21\u5757\u6253\u5305\u6210\u4e00\u4e2a\u53ef\u6267\u884c\u7684apk\u6587\u4ef6\uff0c\u5e76\u5c06\u8be5\u6587\u4ef6\u90e8\u7f72\u5230\u5b89\u5353\u8bbe\u5907\u4e0a\u8fdb\u884c\u6d4b\u8bd5\u548c\u53d1\u5e03\u3002\u56e0\u6b64\uff0capp\u6587\u4ef6\u5939\u548c\u5de5\u7a0b\u6587\u4ef6\u5939\u7684\u6b63\u786e\u534f\u540c\u5de5\u4f5c\u662f\u5b9e\u73b0\u5b89\u5353\u5e94\u7528\u7a0b\u5e8f\u5f00\u53d1\u7684\u5173\u952e\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"\u5b89\u5353\u5f00\u53d1\u4e2d\u7684app\u6587\u4ef6\u5939\u901a\u5e38\u4ee3\u8868\u5e94\u7528\u6a21\u5757\u3001\u5305\u542b\u672c\u5730\u4ee3\u7801\u548c\u8d44\u6e90\uff0c\u800c\u53e6\u4e00\u4e2a\u5de5\u7a0b\u7684\u6587\u4ef6\u5939\u53ef\u80fd\u662f\u6307\u6574\u4e2a\u5de5\u7a0b\u9879\u76ee\u7684\u76ee\u5f55\uff0c [&hellip;]","protected":false},"author":3,"featured_media":172270,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[37],"tags":[],"acf":[],"_links":{"self":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/172268"}],"collection":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/users\/3"}],"replies":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/comments?post=172268"}],"version-history":[{"count":0,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/posts\/172268\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media\/172270"}],"wp:attachment":[{"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/media?parent=172268"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/categories?post=172268"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/docs.pingcode.com\/wp-json\/wp\/v2\/tags?post=172268"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}