It gives these errors when I try to run the app. Can anybody help me please?
Asked
Active
Viewed 75 times
0

Federico klez Culloca
- 26,308
- 17
- 56
- 95

Yusuf Duman
- 3
- 2
-
2To help others help you better, please post the error as text, not an image. – Bink Apr 04 '21 at 18:07
1 Answers
1
The total number of methods that can be referenced within a single DEX file is limited. That's why you should enable Multidex.
Make the following changes in your module-level build.gradle
file:
android {
....
defaultConfig {
...
multiDexEnabled true
}
dependencies {
...
implementation "androidx.multidex:multidex:2.0.1" // if you're using AndroidX
implementation 'com.android.support:multidex:1.0.3' // or add this one if you don't use AndroidX
}
You might also need to change your application class file:
- If you don't use your own Application class, add the following line to your
AndroidManifest.xml
file:
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.yourapp">
<application
...
android:name="androidx.multidex.MultiDexApplication" >
...
</application>
</manifest>
- If you override the
Application
class, make sure your class extendsMultiDexApplication
:
public class MyApplication extends MultiDexApplication {
// your app code
}
More details about Multidex you can find here.

OLezhko
- 150
- 3