gpt4 book ai didi

android - 错误 : Cannot fit requested classes in a single dex file (# methods: 67593 > 65536)

转载 作者:太空狗 更新时间:2023-10-29 13:03:02 26 4
gpt4 key购买 nike

如何解决我在 Android Studio 中遇到的这个错误:

Error: Cannot fit requested classes in a single dex file (# methods: 67593 > 65536)

现在无法构建我的项目

最佳答案

执行此4步骤

1:将这个库添加到应用程序 build.gradle 的依赖项中:

实现 'com.android.support:multidex:1.0.3'

2:在app build.gradle的defaultConfig中添加:

defaultConfig {
//other configs
multiDexEnabled true //add this line
}

3:像这样创建新的 Java 类:

public class ApplicationClass extends MultiDexApplication {
@Override
public void onCreate() {
super.onCreate();
}
}

4:将此添加到您的 list 中(在应用程序标记中):

<application
android:name=".ApplicationClass"
android:icon="@mipmap/ic_launcher"
android:label="@string/app_name">

关于android - 错误 : Cannot fit requested classes in a single dex file (# methods: 67593 > 65536),我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52801386/

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