Skip to content
This repository has been archived by the owner on Feb 20, 2023. It is now read-only.

The number of method references in a .dex file cannot exceed 64K. #583

Open
MickeyMouse623 opened this issue Nov 20, 2020 · 0 comments
Open

Comments

@MickeyMouse623
Copy link

环境

 "react": "16.13.1",
 "react-native": "0.63.3",
 "react-native-wechat": "^1.9.12"

集成操作

在执行 yarn run android 命令后,编译环境报错,关键信息如下

The number of method references in a .dex file cannot exceed 64K.

解决方式

打开 android/app/build.gradle 文件

android {
    defaultConfig {
        ...
        multiDexEnabled true  // 增加这一行
    }
}

dependencies {
  implementation 'com.android.support:multidex:1.0.3' // 增加这一行
}

重新执行 yarn run android 命令即可编译通过。

错误无论在 'RN' 或者 'Flutter' 中遇到都可使用上述方式解决

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant