{"id":1138,"date":"2017-03-15T15:23:05","date_gmt":"2017-03-15T07:23:05","guid":{"rendered":"http:\/\/www.xttblog.com\/?p=1138"},"modified":"2017-03-15T15:23:05","modified_gmt":"2017-03-15T07:23:05","slug":"atlas-%e6%a1%86%e6%9e%b6%e5%bc%80%e5%8f%91%e5%b8%b8%e8%a7%81%e9%97%ae%e9%a2%98%e6%80%bb%e7%bb%93","status":"publish","type":"post","link":"https:\/\/www.xttblog.com\/?p=1138","title":{"rendered":"atlas \u6846\u67b6\u5f00\u53d1\u5e38\u89c1\u95ee\u9898\u603b\u7ed3"},"content":{"rendered":"<p>\n\t\u5c31\u5728\u6700\u8fd1\uff0c<a href=\"http:\/\/baike.baidu.com\/item\/\u963f\u91cc\u5df4\u5df4\u96c6\u56e2\/9087864\" name=\"\u963f\u91cc\u5df4\u5df4\u96c6\u56e2\" target=\"_blank\" title=\"\u963f\u91cc\u5df4\u5df4\u96c6\u56e2\">\u963f\u91cc\u5df4\u5df4<\/a>\u5ba3\u5e03<a href=\"https:\/\/github.com\/alibaba\/atlas\/\" name=\"atlas\" target=\"_blank\" title=\"atlas\">Atlas<\/a>\u5f00\u6e90\u3002Atlas\u6765\u81ea\u963f\u91cc\u5df4\u5df4\u7684\u624b\u6dd8\u90e8\u95e8\uff0c\u5728\u5b9e\u7528\u6027\uff0c\u53ef\u9760\u6027\u7b49\u5404\u65b9\u9762\u90fd\u7ecf\u8fc7\u7684\u6dd8\u5b9d\u7684\u5b9e\u8df5\u3002\u4eca\u5929\u5c31\u4e3a\u5927\u5bb6\u603b\u7ed3\u4e00\u4e0b\u5173\u4e8eAtlas\u5f00\u53d1\u5e38\u89c1\u7684\u95ee\u9898\uff01\n<\/p>\n<h2>\n\tAtlas \u7b80\u4ecb<br \/>\n<\/h2>\n<p>\n\tAtlas\u662f\u4f34\u968f\u7740\u624b\u673a\u6dd8\u5b9d\u7684\u4e0d\u65ad\u53d1\u5c55\u800c\u884d\u751f\u51fa\u6765\u7684\u4e00\u4e2a\u8fd0\u884c\u4e8e<a href=\"http:\/\/baike.baidu.com\/item\/Android\/60243\" name=\"Android \u7cfb\u7edf\" target=\"_blank\" title=\"Android \u7cfb\u7edf\">Android\u7cfb\u7edf<\/a>\u4e0a\u7684\u4e00\u4e2a\u5bb9\u5668\u5316\u6846\u67b6\uff0c\u6211\u4eec\u4e5f\u53eb\u52a8\u6001\u7ec4\u4ef6\u5316(Dynamic Bundle)\u6846\u67b6\u3002\u5b83\u4e3b\u8981\u63d0\u4f9b\u4e86\u89e3\u8026\u5316\u3001\u7ec4\u4ef6\u5316\u3001\u52a8\u6001\u6027\u7684\u652f\u6301\u3002\u8986\u76d6\u4e86\u5de5\u7a0b\u5e08\u7684\u5de5\u7a0b\u7f16\u7801\u671f\u3001Apk\u8fd0\u884c\u671f\u4ee5\u53ca\u540e\u7eed\u8fd0\u7ef4\u671f\u7684\u5404\u79cd\u95ee\u9898\u3002\n<\/p>\n<ul>\n<li>\n<p>\n\t\t\t\u5728\u5de5\u7a0b\u671f\uff0c\u5b9e\u73b0\u5de5\u7a0b\u72ec\u7acb\u5f00\u53d1\uff0c\u8c03\u8bd5\u7684\u529f\u80fd\uff0c\u5de5\u7a0b\u6a21\u5757\u53ef\u4ee5\u72ec\u7acb\u3002\n\t\t<\/p>\n<\/li>\n<li>\n<p>\n\t\t\t\u5728\u8fd0\u884c\u671f\uff0c\u5b9e\u73b0\u5b8c\u6574\u7684\u7ec4\u4ef6\u751f\u547d\u5468\u671f\u7684\u6620\u5c04\uff0c\u7c7b\u9694\u79bb\u7b49\u673a\u5236\u3002\n\t\t<\/p>\n<\/li>\n<li>\n<p>\n\t\t\t\u5728\u8fd0\u7ef4\u671f\uff0c\u63d0\u4f9b\u5feb\u901f\u589e\u91cf\u7684\u66f4\u65b0\u4fee\u590d\u80fd\u529b\uff0c\u5feb\u901f\u5347\u7ea7\u3002\n\t\t<\/p>\n<\/li>\n<\/ul>\n<p>\n\t<a href=\"http:\/\/atlas.taobao.org\/\" name=\"atlas \u5b98\u7f51\" target=\"_blank\" title=\"atlas \u5b98\u7f51\">Atlas<\/a>\u662f\u5de5\u7a0b\u671f\u548c\u8fd0\u884c\u671f\u5171\u540c\u8d77\u4f5c\u7528\u7684\u6846\u67b6\uff0c\u6211\u4eec\u5c3d\u91cf\u5c06\u4e00\u4e9b\u5de5\u4f5c\u653e\u5230\u5de5\u7a0b\u671f\uff0c\u8fd9\u6837\u4fdd\u8bc1\u8fd0\u884c\u671f\u66f4\u7b80\u5355\uff0c\u66f4\u7a33\u5b9a\u3002\n<\/p>\n<p>\n\t\u76f8\u6bd4multidex\uff0catlas\u5728\u89e3\u51b3\u4e86\u65b9\u6cd5\u6570\u9650\u5236\u7684\u540c\u65f6\u4ee5<a href=\"http:\/\/baike.baidu.com\/item\/OSGI\/16158\" name=\"OSGI\" target=\"_blank\" title=\"OSGI\">OSGI<\/a>\u4e3a\u53c2\u8003\uff0c\u660e\u786e\u4e86\u4e1a\u52a1\u5f00\u53d1\u7684\u8fb9\u754c\uff0c\u4f7f\u5f97\u4e1a\u52a1\u5728\u6ee1\u8db3\u5e76\u884c\u8fed\u4ee3\uff0c\u5feb\u901f\u5f00\u53d1\u7684\u540c\u65f6\uff0c\u80fd\u591f\u8fdb\u884c\u7075\u6d3b\u53d1\u5e03\uff0c\u52a8\u6001\u66f4\u65b0\u4ee5\u53ca\u63d0\u4f9b\u4e86\u7ebf\u4e0a\u6545\u969c\u5feb\u901f\u4fee\u590d\u7684\u80fd\u529b\u3002\n<\/p>\n<p>\n\t\u4e0e\u5916\u754c\u67d0\u4e9b\u63d2\u4ef6\u6846\u67b6\u4e0d\u540c\u7684\u662f\uff0catlas\u662f\u4e00\u4e2a\u7ec4\u4ef6\u6846\u67b6\uff0catlas\u4e0d\u662f\u4e00\u4e2a\u591a\u8fdb\u7a0b\u7684\u6846\u67b6\uff0c\u4ed6\u4e3b\u8981\u5b8c\u6210\u7684\u5c31\u662f\u5728\u8fd0\u884c\u73af\u5883\u4e2d\u6309\u9700\u5730\u53bb\u5b8c\u6210\u5404\u4e2a<a href=\"http:\/\/baike.baidu.com\/item\/bundle\" name=\"bundle\" target=\"_blank\" title=\"bundle\">bundle<\/a>\u7684\u5b89\u88c5\uff0c\u52a0\u8f7d\u7c7b\u548c\u8d44\u6e90\u3002\n<\/p>\n<p>\n\t\u4e0b\u9762\u603b\u7ed3\u4e00\u4e0bAtlas\u5728\u5f00\u53d1\u8fc7\u7a0b\u4e2d\u5e38\u89c1\u7684\u95ee\u9898\uff01\n<\/p>\n<h2>\n\t\u9700\u8981\u53bb\u9664\u7684\u539f\u751fmultidex\u521d\u59cb\u5316<br \/>\n<\/h2>\n<p>\n\tAtlas\u5bb9\u5668\u5185\u90e8\u96c6\u6210\u4e86multidex\u7684dex\u5b89\u88c5\u529f\u80fd\uff0c\u6240\u4ee5\u539f\u5148multidex\u7684\u521d\u59cb\u5316\u4ee3\u7801\u53ef\u4ee5\u7701\u7565\uff0c\u4e5f\u4e0d\u9700\u8981\u6dfb\u52a0multidex\u7684\u4e09\u65b9\u5e93\u4f9d\u8d56\uff0c\u9700\u8981\u4f7f\u7528multidex\u7684\u53ea\u9700\u8981build.gradle\u5185\u90e8\u5c06multidex\u7f6e\u4e3aenable\u5373\u53ef\uff08Atlas\u5185\u90e8\u96c6\u6210\u8be5\u5185\u5bb9\u4e00\u65b9\u9762\u662f\u4fbf\u4e8e\u548c\u5bb9\u5668\u7684\u517c\u5bb9\uff0c\u53e6\u4e00\u65b9\u9762\u540e\u7eed\u5bb9\u5668\u4f1a\u4f18\u5316\u539f\u751fmultidex\u5728<a href=\"http:\/\/baike.baidu.com\/item\/Dalvik\" name=\"Dalvik\" target=\"_blank\" title=\"Dalvik\">dalvik<\/a>\u4e0a\u9762\u7684\u6027\u80fd\uff09\n<\/p>\n<h2>\n\t<img decoding=\"async\" alt=\"Multidex installation failure\" src=\"http:\/\/img.bbs.csdn.net\/upload\/201703\/15\/1489561280_774174.png\" style=\"width: 1712px;height: 312px\" \/>Atlas \u62a5ClassNotFoundException\u5f02\u5e38<br \/>\n<\/h2>\n<p>\n\tBundle\u5982\u679c\u76f8\u4e92\u4f9d\u8d56\uff0c\u5219\u6784\u5efa\u8d77\u9700\u8981\u914d\u7f6edependency\uff0c\u5426\u5219\u8fd0\u884c\u671f\u4f1a\u65e0\u6cd5\u627e\u5230\u88ab\u4f9d\u8d56bundle\u5185\u7684class\uff0c\u4e14\u4e0d\u652f\u6301\u4e3a\u4e86\u67e5\u627e\u6027\u80fd\uff0c\u76ee\u524d\u4e0d\u652f\u6301\u4e8c\u7ea7\u4f9d\u8d56\uff1a\u6bd4\u5982A-&gt;B-&gt;C,\u5982\u679cA\u6ca1\u6709\u663e\u5f0f\u58f0\u660e\u4f9d\u8d56C\uff0c\u5219A bundle\u91cc\u9762\u65e0\u6cd5\u76f4\u63a5\u4f7f\u7528bundle C\u91cc\u9762\u7684Class\uff0c\u68c0\u67e5bundle\u4f9d\u8d56\u662f\u5426\u6210\u529f\u914d\u7f6e\u53ef\u4ee5\u901a\u8fc7\u53cd\u7f16\u8bd1Apk\u7684\u4e3bdex \u67e5\u770bandroid.taobao.atlas.framework.FrameworkProperties\u7684field bundleInfo\u7684\u5185\u5bb9\uff0c\u91cc\u9762\u8bb0\u5f55\u4e86\u6240\u6709bundle\u7684\u4f9d\u8d56\u5173\u7cfb &nbsp;2. \u901a\u8fc7LayoutInflater \u81a8\u5316xml\uff0c\u5219xml\u91cc\u9762\u5982\u679c\u6709richview\uff0c\u5219\u52a1\u5fc5\u786e\u4fddLayoutInflater\u6301\u6709\u7684context\u7684classloader\u53ef\u4ee5load\u5230\u8be5richview\uff0c\u5047\u8bbecontext\u6765\u81ea\u4e8eA bundle\u7684Activity\uff0c\u800cxml\u6765\u81ea\u4e8eB bundle\uff0c\u5982\u679cA\u548cB\u6ca1\u6709\u4f9d\u8d56\u5173\u7cfb\uff0c\u90a3\u4e48\u52a0\u8f7d\u4e5f\u80af\u5b9a\u5931\u8d25\n<\/p>\n<h2>\n\tAtlas \u62a5NoClassDefFoundError\u5f02\u5e38<br \/>\n<\/h2>\n<p>\n\t\u9020\u6210\u8be5\u95ee\u9898\u7684\u539f\u56e0\u6bd4\u8f83\u591a\uff0c\u6392\u67e5\u6b65\u9aa4\u7b2c\u4e00\u4e2a\u5148\u68c0\u67e5Exception\u7684\u6e90\u5934\u662f\u4e0d\u662fClassNotFoundException\uff0c\u7136\u540e\u53cd\u7f16\u8bd1\u6392\u67e5\u7c7b\u786e\u5b9e\u662f\u5426\u5b58\u5728\uff1b\n<\/p>\n<p>\n\t\u5982\u679c\u7c7b\u672c\u8eab\u5b58\u5728\uff0c\u9700\u8981\u5f80\u524d\u6392\u67e5\u7cfb\u7edf\u7684\u8b66\u544a\u4fe1\u606f\uff0c\u6bd4\u5982\u5728Art\u7684\u8bbe\u5907\u4e0a\u4f1a\u6709class\u88abreject\u7684warning\u4fe1\u606f\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"\u5728Art\u7684\u8bbe\u5907\u4e0a\u4f1a\u6709class\u88abreject\u7684warning\u4fe1\u606f\" src=\"http:\/\/img.bbs.csdn.net\/upload\/201703\/15\/1489561997_101178.png\" style=\"width: 860px;height: 245px\" \/>\n<\/p>\n<p>\n\t\u5728dalvik\u7684\u7cfb\u7edf\u4e0a\uff0c\u5219\u4f1a\u5e26\u6709VFY tag\u7684\u8b66\u544a\u4fe1\u606f\uff1a\n<\/p>\n<p>\n\t<img decoding=\"async\" alt=\"VFY tag\u7684\u8b66\u544a\u4fe1\u606f\" src=\"http:\/\/img.bbs.csdn.net\/upload\/201703\/15\/1489562063_943827.png\" style=\"width: 1245px;height: 359px\" \/>\n<\/p>\n<p>\n\t\u4e00\u822c\u6765\u8bf4\uff0c\u7531\u4e8eART\u8bbe\u5907\u8b66\u544a\u7684\u4fe1\u606f\u62a5\u5728dex2oat\u7684\u65f6\u5019\uff0c\u6240\u4ee5\u5f80\u5f80\u4e0e\u53d1\u751fcrash\u65f6\u7684Exception\u4fe1\u606f\u76f8\u9694\u6bd4\u8f83\u8fdc\uff0c\u6240\u4ee5\u901a\u5e38\u9047\u5230\u8be5\u7c7b\u95ee\u9898\uff0cdalivk\u7684\u8bbe\u5907\u62ff\u6765\u6392\u67e5\u53ef\u80fd\u66f4\u80fd\u53d1\u73b0\u95ee\u9898\u7684\u539f\u56e0\u3002\u53e6\u5916noclassdef\u9020\u6210\u7684\u539f\u6709\u63a5\u53e3\u7c7b\u627e\u4e0d\u5230\uff0c\u65b9\u6cd5\u4e22\u5931\uff0c\u65b9\u6cd5\u53c2\u6570\u4e0d\u5339\u914d\uff0c\u65b9\u6cd5\u5c5e\u6027\u53d8\u66f4\uff0c\u6df7\u6dc6\u7b49\uff0c\u6240\u4ee5\u5177\u4f53\u539f\u56e0\u9700\u8981\u5229\u7528\u4e0a\u8ff0warning\u4fe1\u606f\u5e76\u5bf9\u7167\u53cd\u7f16\u8bd1\u7684\u4ee3\u7801\u53bb\u6392\u67e5\u6839\u672c\u7684\u539f\u56e0<\/p>\n<!-- <audio autoplay=\"autoplay\" height=\"100\" width=\"100\" hidden=\"true\"><source src=\"https:\/\/c.coka.la\/orAvPR.mp3\" type=\"audio\/mp3\"\/><\/audio><img decoding=\"async\" src=\"https:\/\/images.weserv.nl\/?url=https:\/\/ws3.sinaimg.cn\/large\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/> --><p><!-- <img decoding=\"async\" src=\"https:\/\/raw.githubusercontent.com\/xmt1139057136\/xttblog\/master\/8fa5dcfcgy1g4em3rzar5j20ib089ae0.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/>--><img decoding=\"async\" src=\"https:\/\/saas.51autoparts.cn\/api\/admin\/sys-file\/oss\/file?fileName=84db51f8561e448f9a4fda2eff0811f9.jpg\" alt=\"\u4e1a\u4f59\u8349\u516c\u4f17\u53f7\"\/><\/p><p>\u6700\u540e\uff0c\u6b22\u8fce\u5173\u6ce8\u6211\u7684\u4e2a\u4eba\u5fae\u4fe1\u516c\u4f17\u53f7\uff1a\u4e1a\u4f59\u8349\uff08yyucao\uff09\uff01<b>\u53ef\u52a0\u4f5c\u8005\u5fae\u4fe1\u53f7\uff1a<font color=\"red\">xttblog2<\/font>\u3002\u5907\u6ce8\uff1a\u201c1\u201d\uff0c\u6dfb\u52a0\u535a\u4e3b\u5fae\u4fe1\u62c9\u4f60\u8fdb\u5fae\u4fe1\u7fa4\u3002\u5907\u6ce8\u9519\u8bef\u4e0d\u4f1a\u540c\u610f\u597d\u53cb\u7533\u8bf7\u3002<\/b>\u518d\u6b21\u611f\u8c22\u60a8\u7684\u5173\u6ce8\uff01\u540e\u7eed\u6709\u7cbe\u5f69\u5185\u5bb9\u4f1a\u7b2c\u4e00\u65f6\u95f4\u53d1\u7ed9\u60a8\uff01\u539f\u521b\u6587\u7ae0\u6295\u7a3f\u8bf7\u53d1\u9001\u81f3532009913@qq.com\u90ae\u7bb1\u3002\u5546\u52a1\u5408\u4f5c\u4e5f\u53ef\u6dfb\u52a0\u4f5c\u8005\u5fae\u4fe1\u8fdb\u884c\u8054\u7cfb\uff01<\/p><p>\u672c\u6587\u539f\u6587\u51fa\u5904\uff1a<a href=\"https:\/\/www.xttblog.com\">\u4e1a\u4f59\u8349<\/a>\uff1a &raquo; <a href=\"https:\/\/www.xttblog.com\/?p=1138\">atlas \u6846\u67b6\u5f00\u53d1\u5e38\u89c1\u95ee\u9898\u603b\u7ed3<\/a><\/p><!-- <div class=\"bd-reward-stl\"><button id=\"bdRewardBtn\"><span><\/span><\/button><\/div> -->","protected":false},"excerpt":{"rendered":"<p>\u5c31\u5728\u6700\u8fd1\uff0c\u963f\u91cc\u5df4\u5df4\u5ba3\u5e03Atlas\u5f00\u6e90\u3002Atlas\u6765\u81ea\u963f\u91cc\u5df4\u5df4\u7684\u624b\u6dd8\u90e8\u95e8\uff0c\u5728\u5b9e\u7528\u6027\uff0c\u53ef\u9760\u6027\u7b49\u5404\u65b9\u9762\u90fd\u7ecf\u8fc7\u7684\u6dd8\u5b9d\u7684 [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[891,890,893,69,892],"class_list":["post-1138","post","type-post","status-publish","format-standard","hentry","category-java","tag-android","tag-atlas","tag-bundle","tag-java","tag-892"],"_links":{"self":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1138","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=1138"}],"version-history":[{"count":1,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1138\/revisions"}],"predecessor-version":[{"id":1139,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=\/wp\/v2\/posts\/1138\/revisions\/1139"}],"wp:attachment":[{"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=1138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=1138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.xttblog.com\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=1138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}