More than 65k of Android methods, resolving more than 65536 Dex methods

Source: Internet
Author: User
Recently a friend asked me, why I added a class/a library suddenly can't get up.

How to Troubleshoot:

1、确认你的代码/引用没有问题2、检查是否是65k问题

Today is mainly to solve the troubleshooting Method 2 steps, this is mainly because your apk package method is too large.

Now it's convenient to solve this:

方式一(繁琐):程序分包,这个比较繁琐;需要对jvm加载Class的方式有足够的了解方式二(快速,使用AS):    1、使用google提供的分包库    implementation ‘com.android.support:multidex:1.0.2‘    implementation ‘com.android.support:multidex-instrumentation:1.0.2‘    2、在主项目的build.gradle文件里设置 multiDexEnabled true

    3、如果项目有自定义的Application类,那就在它的onCreate方法里加入  MultiDex.install(this);

    4、如果3不满足,你需要在主项目的manifest文件里添加application标签的name属性为:    android.support.multidex.MultiDexApplication

More than 65k of Android methods, resolving more than 65536 Dex methods

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.