gpt4 book ai didi

android - 如何将 MultiDex 与自定义应用程序类一起使用?

转载 作者:塔克拉玛干 更新时间:2023-11-02 20:46:32 27 4
gpt4 key购买 nike

好的,所以我正在制作一个使用 .App 类静态获取 Context 的应用程序,除非放在 list 中,否则该类不起作用 <application android:name=.App但问题是我的时钟是 65k,所以我有 multiDex,MultiDex 也需要在 <application android:name=.MultiDex 下的 list 中否则我的应用程序将无法运行,我如何才能在不影响 multidex 的情况下解决这个问题,这是我最担心的事情,看看我为了让它工作而经历了多少麻烦?

最佳答案

查看 this page :

Note: If your app uses extends the Application class, you can override the attachBaseContext() method and call MultiDex.install(this) to enable multidex. For more information, see the MultiDexApplication reference documentation.

换句话说,使用您自己的 App 类,但添加以下内容:

@Override
protected void attachBaseContext(Context base) {
super.attachBaseContext(base);
MultiDex.install(this);
}

关于android - 如何将 MultiDex 与自定义应用程序类一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33590009/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com