{"id":473,"date":"2022-12-06T10:13:45","date_gmt":"2022-12-06T02:13:45","guid":{"rendered":"https:\/\/iichen.cn\/?p=473"},"modified":"2022-12-06T10:13:45","modified_gmt":"2022-12-06T02:13:45","slug":"android-5-0%e4%bb%a5%e4%b8%8bmultidex%e5%8a%a0%e8%bd%bd%e6%97%b6%e9%97%b4%e4%bc%98%e5%8c%96","status":"publish","type":"post","link":"https:\/\/iichen.cn\/?p=473","title":{"rendered":"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316"},"content":{"rendered":"<h5>1. \u601d\u8def<\/h5>\n<ul>\n<li>\u5c06MultiDex\u52a0\u8f7d\u591adex\u5408\u5e76\u7684\u8017\u65f6\u64cd\u4f5c\u653e\u5728\u4e00\u4e2a\u65b0\u7684\u8fdb\u7a0b\u8fdb\u884c\u52a0\u8f7d\u3002\u65b0\u5efa\u8fdb\u7a0b\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u6587\u4ef6tempFile,\u52a0\u8f7d\u5b8c\u6210\u540e\u5220\u9664\u8fd9\u4e2a\u6587\u4ef6\u5e76\u7ed3\u675f\u5f53\u524d\u65b0\u5efa\u8fdb\u7a0b\u3002\u4e3b\u8fdb\u7a0b\u8f6e\u8be2\u5224\u65adtempFile\u662f\u5426\u5b58\u5728-\u4e0d\u5b58\u5728\u8bf4\u660e\u52a0\u8f7d\u5b8c\u6210\uff0c\u8fdb\u884c\u540e\u7eed\u7684\u6b65\u9aa4\u3002<\/p>\n<\/li>\n<li>\n<p>MultiDex \u4f1a\u5c06apk\u8f6c\u4e3azip\uff0c\u5e76\u904d\u5386zip\u83b7\u53d6\u6bcf\u4e2adex \u5e76\u4e5f\u8f6c\u4e3azip (\u6839\u636eDexPathList\u6e90\u7801 \u6587\u4ef6\u540e\u7f00\u5224\u65ad\uff0c\u8fd9\u4e9b\u8f6c\u6362\u5e76\u65e0\u5fc5\u8981\u3002)<\/p>\n<\/li>\n<\/ul>\n<pre><code class=\"language-java line-numbers\">private static final class V19 {\n    private V19() {\n    }\n\n    static void install(ClassLoader loader, List&lt;? extends File&gt; additionalClassPathEntries, File optimizedDirectory) throws IllegalArgumentException, IllegalAccessException, NoSuchFieldException, InvocationTargetException, NoSuchMethodException, IOException {\n        \/\/1 \u53cd\u5c04ClassLoader \u7684 pathList \u5b57\u6bb5\n        Field pathListField = MultiDex.findField(loader, \"pathList\");\n        Object dexPathList = pathListField.get(loader);\n        ArrayList&lt;IOException&gt; suppressedExceptions = new ArrayList();\n        \/\/ 2 \u6269\u5c55\u6570\u7ec4 \u5c31\u662f\u5c06dex2 dex3\u4e00\u8d77\u52a0\u5230dexElements\u6570\u7ec4\u5185\uff0cTinker\u70ed\u4fee\u590d\u539f\u7406\u5c31\u662f\u8fd9\u4e2a\n        MultiDex.expandFieldArray(dexPathList, \"dexElements\", makeDexElements(dexPathList, new ArrayList(additionalClassPathEntries), optimizedDirectory, suppressedExceptions));\n        ...\n        }\n\n    private static Object[] makeDexElements(Object dexPathList, ArrayList&lt;File&gt; files, File optimizedDirectory, ArrayList&lt;IOException&gt; suppressedExceptions) throws IllegalAccessException, InvocationTargetException, NoSuchMethodException {\n        Method makeDexElements = MultiDex.findMethod(dexPathList, \"makeDexElements\", ArrayList.class, File.class, ArrayList.class);\n        return (Object[])((Object[])makeDexElements.invoke(dexPathList, files, optimizedDirectory, suppressedExceptions));\n    }\n}\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image\"><div class='fancybox-wrapper lazyload-container-unload' data-fancybox='post-images' href='https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image'><img class=\"lazyload lazyload-style-11\" src=\"data:image\/svg+xml;base64,PCEtLUFyZ29uTG9hZGluZy0tPgo8c3ZnIHdpZHRoPSIxIiBoZWlnaHQ9IjEiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyIgc3Ryb2tlPSIjZmZmZmZmMDAiPjxnPjwvZz4KPC9zdmc+\"  decoding=\"async\" data-original=\"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image\" src=\"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAAXNSR0IArs4c6QAAAARnQU1BAACxjwv8YQUAAAAJcEhZcwAADsQAAA7EAZUrDhsAAAANSURBVBhXYzh8+PB\/AAffA0nNPuCLAAAAAElFTkSuQmCC\" alt=\"\" \/><\/div><\/a><\/p>\n<ul>\n<li>BaseDexClassLoader\u5185\u7684\u6210\u5458\u53d8\u91cfDexPathList<\/p>\n<\/li>\n<li>\n<p>DexPathList\u5185\u7684 Element[] dexElements;<\/p>\n<\/li>\n<li>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/androidxref.com\/4.4.4_r1\/xref\/libcore\/dalvik\/src\/main\/java\/dalvik\/system\/BaseDexClassLoader.java\" title=\"BaseDexClassLoader\">BaseDexClassLoader<\/a><\/p>\n<\/li>\n<li><a class=\"wp-editor-md-post-content-link\" href=\"http:\/\/androidxref.com\/4.4.4_r1\/xref\/libcore\/dalvik\/src\/main\/java\/dalvik\/system\/DexPathList.java\" title=\"DexPathList\">DexPathList<\/a><\/li>\n<\/ul>\n<h5>2. Application<\/h5>\n<blockquote>\n<p>\u5bf9\u8c61\u7b2c\u4e00\u6b21\u521b\u5efa\u7684\u65f6\u5019\uff0cjava\u865a\u62df\u673a\u9996\u5148\u68c0\u67e5\u7c7b\u5bf9\u5e94\u7684Class \u5bf9\u8c61\u662f\u5426\u5df2\u7ecf\u52a0\u8f7d\u3002\u5982\u679c\u6ca1\u6709\u52a0\u8f7d\uff0cjvm\u4f1a\u6839\u636e\u7c7b\u540d\u67e5\u627e.class\u6587\u4ef6\uff0c\u5c06\u5176Class\u5bf9\u8c61\u8f7d\u5165\u3002\u540c\u4e00\u4e2a\u7c7b\u7b2c\u4e8c\u6b21new\u7684\u65f6\u5019\u5c31\u4e0d\u9700\u8981\u52a0\u8f7d\u7c7b\u5bf9\u8c61\uff0c\u800c\u662f\u76f4\u63a5\u5b9e\u4f8b\u5316\uff0c\u521b\u5efa\u65f6\u95f4\u5c31\u7f29\u77ed\u4e86\u3002\n<\/p><\/blockquote>\n<pre><code class=\"language-java line-numbers\">public class MyApplication extends Application {\n    private static final String TAG = \"lxb-MyApplication\";\n    @Override\n    protected void attachBaseContext(Context base) {\n        super.attachBaseContext(base);\n\n        Log.d(TAG, \"attachBaseContext-getPackageName: \" + base.getPackageName());\n        Log.d(TAG, \"attachBaseContext-getProcessName: \" + SystemUtil.getProcessName(base));\n\n        boolean isMainProcess = isMainProcess(base);\n        Log.d(TAG, \"attachBaseContext-isMainProcess: \" + isMainProcess);\n\n        \/\/\u4e3b\u8fdb\u7a0b\u5e76\u4e14vm\u4e0d\u652f\u6301\u591adex\u7684\u60c5\u51b5\u4e0b\u624d\u4f7f\u7528 MultiDex\n        if (isMainProcess &amp;&amp; !SystemUtil.isVMMultidexCapable()){\n            loadMultiDex(base);\n        }\n    }\n\n    private boolean isMainProcess(Context context) {\n        return context.getPackageName().equals(SystemUtil.getProcessName(context));\n    }\n\n    @Override\n    public void onCreate() {\n        super.onCreate();\n        if (!isMainProcess(this)){\n            Log.d(TAG, \"onCreate: \u975e\u4e3b\u8fdb\u7a0b\uff0creturn\");\n            return;\n        }\n        Log.d(TAG, \"\u4e3b\u8fdb\u7a0b onCreate: \u4e00\u4e9b\u521d\u59cb\u5316\u64cd\u4f5c\");\n    }\n\n    private void loadMultiDex(Context context) {\n        newTempFile(context); \/\/\u521b\u5efa\u4e34\u65f6\u6587\u4ef6\n\n        \/\/\u542f\u52a8\u53e6\u4e00\u4e2a\u8fdb\u7a0b\u53bb\u52a0\u8f7dMultiDex\n        Intent intent = new Intent(context, LoadMultiDexActivity.class);\n        intent.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);\n        context.startActivity(intent);\n\n        \/\/\u68c0\u67e5MultiDex\u662f\u5426\u5b89\u88c5\u5b8c\uff08\u5b89\u88c5\u5b8c\u4f1a\u5220\u9664\u4e34\u65f6\u6587\u4ef6\uff09\n        checkUntilLoadDexSuccess(context);\n\n        \/\/\u53e6\u4e00\u4e2a\u8fdb\u7a0b\u4ee5\u53ca\u52a0\u8f7d MultiDex\uff0c\u6709\u7f13\u5b58\u4e86\uff0c\u6240\u4ee5\u4e3b\u8fdb\u7a0b\u518d\u52a0\u8f7d\u5c31\u5f88\u5feb\u4e86\u3002\n        \/\/\u4e3a\u4ec0\u4e48\u4e3b\u8fdb\u7a0b\u8981\u518d\u52a0\u8f7d\uff0c\u56e0\u4e3a\u6bcf\u4e2a\u8fdb\u7a0b\u90fd\u6709\u4e00\u4e2aClassLoader\n        long startTime = System.currentTimeMillis();\n        MultiDex.install(context);\n        Log.d(TAG, \"\u7b2c\u4e8c\u6b21 MultiDex.install \u7ed3\u675f\uff0c\u8017\u65f6: \" + (System.currentTimeMillis() - startTime));\n        \/\/ \u4f18\u5316\u70b9-\u63d0\u524dnew Activity,\u540e\u7eed\u52a0\u8f7d\u5c31\u5f88\u5feb\u4e86\uff0c\u6d89\u53ca\u5230\u7c7b\u52a0\u8f7d\u673a\u5236\n        preNewActivity();\n    }\n\n    private void preNewActivity() {\n        long startTime = System.currentTimeMillis();\n        MainActivity mainActivity = new MainActivity();\n        Log.d(TAG, \"preNewActivity \u8017\u65f6: \" + (System.currentTimeMillis() - startTime));\n    }\n\n    \/\/\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u6587\u4ef6\uff0cMultiDex install \u6210\u529f\u540e\u5220\u9664\n    private void newTempFile(Context context) {\n        try {\n            File file = new File(context.getCacheDir().getAbsolutePath(), \"load_dex.tmp\");\n            if (!file.exists()) {\n                Log.d(TAG, \"newTempFile: \");\n                file.createNewFile();\n            }\n        } catch (Throwable th) {\n            th.printStackTrace();\n        }\n    }\n\n    \/**\n     * \u68c0\u67e5MultiDex\u662f\u5426\u5b89\u88c5\u5b8c,\u901a\u8fc7\u5224\u65ad\u4e34\u65f6\u6587\u4ef6\u662f\u5426\u88ab\u5220\u9664\n     * @param context\n     * @return\n     *\/\n    private void checkUntilLoadDexSuccess(Context context) {\n        File file = new File(context.getCacheDir().getAbsolutePath(), \"load_dex.tmp\");\n        int i = 0;\n        int waitTime = 100; \/\/\u7761\u7720\u65f6\u95f4\n        try {\n            Log.d(TAG, \"checkUntilLoadDexSuccess: &gt;&gt;&gt; \");\n            while (file.exists()) {\n                Thread.sleep(waitTime);\n                Log.d(TAG, \"checkUntilLoadDexSuccess: sleep count = \" + ++i);\n                if (i &gt; 40) {\n                    Log.d(TAG, \"checkUntilLoadDexSuccess: \u8d85\u65f6\uff0c\u7b49\u5f85\u65f6\u95f4\uff1a \" + (waitTime * i));\n                    break;\n                }\n            }\n\n            Log.d(TAG, \"checkUntilLoadDexSuccess: \u8f6e\u5faa\u7ed3\u675f\uff0c\u7b49\u5f85\u65f6\u95f4 \" +(waitTime * i));\n\n        }catch (Exception e){\n            e.printStackTrace();\n        }\n    }\n}\n<\/code><\/pre>\n<h5>3. \u65b0\u8fdb\u7a0bActivity<\/h5>\n<pre><code class=\"language-java line-numbers\">&lt;activity android:name=\"com.lanshifu.launchtest.LoadMultiDexActivity\"\n     android:process=\":multi_dex\"\n         android:launchMode=\"singleTask\"\n             android:excludeFromRecents=\"true\"\n                 &gt;&lt;\/activity&gt;\n<\/code><\/pre>\n<pre><code class=\"language-java line-numbers\">public class LoadMultiDexActivity extends Activity {\n    private static final String TAG = \"lxb-LoadMultiDexActivity\";\n\n    @Override\n    protected void onCreate(Bundle savedInstanceState) {\n        super.onCreate(savedInstanceState);\n        setContentView(R.layout.activity_load_multi_dex);\n\n        Thread thread = new Thread() {\n            @Override\n            public void run() {\n                loadMultiDex();\n            }\n        };\n        thread.setName(\"multi_dex\");\n        thread.start();\n\n        showLoadingDialog();\n    }\n\n    private void loadMultiDex(){\n        Log.d(TAG, \"MultiDex.install \u5f00\u59cb: \");\n        long startTime = System.currentTimeMillis();\n        MultiDex.install(LoadMultiDexActivity.this);\n        Log.d(TAG, \"MultiDex.install \u7ed3\u675f\uff0c\u8017\u65f6: \" + (System.currentTimeMillis() - startTime));\n\n        try {\n            \/\/\u6a21\u62dfMultiDex\u8017\u65f6\u5f88\u4e45\u7684\u60c5\u51b5\n            Thread.sleep(3000);\n        } catch (InterruptedException e) {\n            e.printStackTrace();\n        }\n\n        aftetMultiDex();\n    }\n\n    private void aftetMultiDex() {\n        deleteTempFile(this);\n\n        \/\/\u5c06\u8fd9\u4e2a\u8fdb\u7a0b\u6740\u6b7b\n        Log.d(TAG, \"aftetMultiDex: \");\n        finish();\n        Process.killProcess(Process.myPid());\n    }\n\n    private void deleteTempFile(Context context) {\n        try {\n            File file = new File(context.getCacheDir().getAbsolutePath(), \"load_dex.tmp\");\n            if (file.exists()) {\n                file.delete();\n                Log.d(TAG, \"deleteTempFile: \");\n            }\n        } catch (Throwable th) {\n            th.printStackTrace();\n        }\n    }\n\n    private void showLoadingDialog(){\n        new AlertDialog.Builder(this)\n                .setMessage(\"\u52a0\u8f7d\u4e2d\uff0c\u8bf7\u7a0d\u540e...\")\n                .show();\n    }\n}\n<\/code><\/pre>\n<h5>4. Utils<\/h5>\n<pre><code class=\"language-java line-numbers\">public class SystemUtil {\n    public static String getProcessName(Context context){\n        ActivityManager activityManager = (ActivityManager) context\n                .getSystemService(Context.ACTIVITY_SERVICE);\n        List&lt;ActivityManager.RunningAppProcessInfo&gt; appProcesses = activityManager\n                .getRunningAppProcesses();\n\n        int myPid = Process.myPid();\n\n        if(appProcesses == null || appProcesses.size() == 0){\n            return null;\n        }\n\n        for (ActivityManager.RunningAppProcessInfo appProcess : appProcesses) {\n            if (appProcess.processName.equals(context.getPackageName())) {\n                if (appProcess.pid == myPid){\n                    return appProcess.processName;\n                }\n            }\n        }\n        return null;\n    }\n\n    public static boolean isVMMultidexCapable(){\n        return isVMMultidexCapable(System.getProperty(\"java.vm.version\"));\n    }\n\n    \/\/MultiDex \u62f7\u51fa\u6765\u7684\u7684\u65b9\u6cd5\uff0c\u5224\u65adVM\u662f\u5426\u652f\u6301\u591adex\n    public static boolean isVMMultidexCapable(String versionString) {\n        boolean isMultidexCapable = false;\n        if (versionString != null) {\n            Matcher matcher = Pattern.compile(\"(\\\\d+)\\\\.(\\\\d+)(\\\\.\\\\d+)?\").matcher(versionString);\n            if (matcher.matches()) {\n                try {\n                    int major = Integer.parseInt(matcher.group(1));\n                    int minor = Integer.parseInt(matcher.group(2));\n                    isMultidexCapable = major &gt; 2 || major == 2 &amp;&amp; minor &gt;= 1;\n                } catch (NumberFormatException var5) {\n                }\n            }\n        }\n\n        Log.i(\"MultiDex\", \"VM with version \" + versionString + (isMultidexCapable ? \" has multidex support\" : \" does not have multidex support\"));\n        return isMultidexCapable;\n    }\n}\n<\/code><\/pre>\n<p><a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/juejin.cn\/post\/6844903958113157128\" title=\"\u539f\u6587\u7ae0\u94fe\u63a5\">\u539f\u6587\u7ae0\u94fe\u63a5<\/a><br \/>\n<a class=\"wp-editor-md-post-content-link\" href=\"https:\/\/github.com\/18805699674\/MultiDexTest.git\" title=\"\u6e90\u7801fork\u5730\u5740\">\u6e90\u7801fork\u5730\u5740<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>1. \u601d\u8def \u5c06MultiDex\u52a0\u8f7d\u591adex\u5408\u5e76\u7684\u8017\u65f6\u64cd\u4f5c\u653e\u5728\u4e00\u4e2a\u65b0\u7684\u8fdb\u7a0b\u8fdb\u884c\u52a0\u8f7d\u3002\u65b0\u5efa\u8fdb\u7a0b\u521b\u5efa\u4e00\u4e2a\u4e34\u65f6\u6587\u4ef6te [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[11,8],"tags":[],"class_list":["post-473","post","type-post","status-publish","format-standard","hentry","category-android","category-8"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v24.4 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316 - IIchen<\/title>\n<meta name=\"description\" content=\"MultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/iichen.cn\/?p=473\" \/>\n<meta property=\"og:locale\" content=\"zh_CN\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316 - IIchen\" \/>\n<meta property=\"og:description\" content=\"MultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316\" \/>\n<meta property=\"og:url\" content=\"https:\/\/iichen.cn\/?p=473\" \/>\n<meta property=\"og:site_name\" content=\"IIchen\" \/>\n<meta property=\"article:published_time\" content=\"2022-12-06T02:13:45+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image\" \/>\n<meta name=\"author\" content=\"iichen\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"\u4f5c\u8005\" \/>\n\t<meta name=\"twitter:data1\" content=\"iichen\" \/>\n\t<meta name=\"twitter:label2\" content=\"\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 \u5206\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/iichen.cn\/?p=473#article\",\"isPartOf\":{\"@id\":\"https:\/\/iichen.cn\/?p=473\"},\"author\":{\"name\":\"iichen\",\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\"},\"headline\":\"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316\",\"datePublished\":\"2022-12-06T02:13:45+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/iichen.cn\/?p=473\"},\"wordCount\":31,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\"},\"image\":{\"@id\":\"https:\/\/iichen.cn\/?p=473#primaryimage\"},\"thumbnailUrl\":\"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image\",\"articleSection\":[\"Android\",\"\u7b14\u8bb0\"],\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/iichen.cn\/?p=473#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/iichen.cn\/?p=473\",\"url\":\"https:\/\/iichen.cn\/?p=473\",\"name\":\"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316 - IIchen\",\"isPartOf\":{\"@id\":\"https:\/\/iichen.cn\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\/\/iichen.cn\/?p=473#primaryimage\"},\"image\":{\"@id\":\"https:\/\/iichen.cn\/?p=473#primaryimage\"},\"thumbnailUrl\":\"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image\",\"datePublished\":\"2022-12-06T02:13:45+00:00\",\"description\":\"MultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316\",\"breadcrumb\":{\"@id\":\"https:\/\/iichen.cn\/?p=473#breadcrumb\"},\"inLanguage\":\"zh-Hans\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/iichen.cn\/?p=473\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/iichen.cn\/?p=473#primaryimage\",\"url\":\"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image\",\"contentUrl\":\"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image\"},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/iichen.cn\/?p=473#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"\u9996\u9875\",\"item\":\"https:\/\/iichen.cn\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/iichen.cn\/#website\",\"url\":\"https:\/\/iichen.cn\/\",\"name\":\"IIchen\",\"description\":\"Just do it!\",\"publisher\":{\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/iichen.cn\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"zh-Hans\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c\",\"name\":\"iichen\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"zh-Hans\",\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg\",\"contentUrl\":\"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg\",\"width\":940,\"height\":940,\"caption\":\"iichen\"},\"logo\":{\"@id\":\"https:\/\/iichen.cn\/#\/schema\/person\/image\/\"},\"sameAs\":[\"https:\/\/www.iichen.cn\"],\"url\":\"https:\/\/iichen.cn\/?author=1\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316 - IIchen","description":"MultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/iichen.cn\/?p=473","og_locale":"zh_CN","og_type":"article","og_title":"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316 - IIchen","og_description":"MultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316","og_url":"https:\/\/iichen.cn\/?p=473","og_site_name":"IIchen","article_published_time":"2022-12-06T02:13:45+00:00","og_image":[{"url":"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image","type":"","width":"","height":""}],"author":"iichen","twitter_card":"summary_large_image","twitter_misc":{"\u4f5c\u8005":"iichen","\u9884\u8ba1\u9605\u8bfb\u65f6\u95f4":"4 \u5206"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/iichen.cn\/?p=473#article","isPartOf":{"@id":"https:\/\/iichen.cn\/?p=473"},"author":{"name":"iichen","@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c"},"headline":"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316","datePublished":"2022-12-06T02:13:45+00:00","mainEntityOfPage":{"@id":"https:\/\/iichen.cn\/?p=473"},"wordCount":31,"commentCount":0,"publisher":{"@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c"},"image":{"@id":"https:\/\/iichen.cn\/?p=473#primaryimage"},"thumbnailUrl":"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image","articleSection":["Android","\u7b14\u8bb0"],"inLanguage":"zh-Hans","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/iichen.cn\/?p=473#respond"]}]},{"@type":"WebPage","@id":"https:\/\/iichen.cn\/?p=473","url":"https:\/\/iichen.cn\/?p=473","name":"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316 - IIchen","isPartOf":{"@id":"https:\/\/iichen.cn\/#website"},"primaryImageOfPage":{"@id":"https:\/\/iichen.cn\/?p=473#primaryimage"},"image":{"@id":"https:\/\/iichen.cn\/?p=473#primaryimage"},"thumbnailUrl":"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image","datePublished":"2022-12-06T02:13:45+00:00","description":"MultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316","breadcrumb":{"@id":"https:\/\/iichen.cn\/?p=473#breadcrumb"},"inLanguage":"zh-Hans","potentialAction":[{"@type":"ReadAction","target":["https:\/\/iichen.cn\/?p=473"]}]},{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/iichen.cn\/?p=473#primaryimage","url":"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image","contentUrl":"https:\/\/p1-jj.byteimg.com\/tos-cn-i-t2oaga2asx\/gold-user-assets\/2019\/10\/7\/16da4e5aaceaef08~tplv-t2oaga2asx-zoom-in-crop-mark:4536:0:0:0.image"},{"@type":"BreadcrumbList","@id":"https:\/\/iichen.cn\/?p=473#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"\u9996\u9875","item":"https:\/\/iichen.cn\/"},{"@type":"ListItem","position":2,"name":"Android-5.0\u4ee5\u4e0bMultiDex\u52a0\u8f7d\u65f6\u95f4\u4f18\u5316"}]},{"@type":"WebSite","@id":"https:\/\/iichen.cn\/#website","url":"https:\/\/iichen.cn\/","name":"IIchen","description":"Just do it!","publisher":{"@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/iichen.cn\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"zh-Hans"},{"@type":["Person","Organization"],"@id":"https:\/\/iichen.cn\/#\/schema\/person\/4a47edf85ab49841df9e8f6aee40b77c","name":"iichen","image":{"@type":"ImageObject","inLanguage":"zh-Hans","@id":"https:\/\/iichen.cn\/#\/schema\/person\/image\/","url":"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg","contentUrl":"https:\/\/iichen.cn\/wp-content\/uploads\/2025\/01\/avatar.jpg","width":940,"height":940,"caption":"iichen"},"logo":{"@id":"https:\/\/iichen.cn\/#\/schema\/person\/image\/"},"sameAs":["https:\/\/www.iichen.cn"],"url":"https:\/\/iichen.cn\/?author=1"}]}},"_links":{"self":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/posts\/473","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=473"}],"version-history":[{"count":0,"href":"https:\/\/iichen.cn\/index.php?rest_route=\/wp\/v2\/posts\/473\/revisions"}],"wp:attachment":[{"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=473"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=473"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/iichen.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=473"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}