Translate

Sunday, May 24, 2020

Cannot fit requested classes in a single dex file (# methods: ) in Android app


While anyone getting the following errors while building/running the Android app. Please try following solutions to resolve the issues .

Logcat Errors :
Cannot fit requested classes in a single dex file (# methods: 71636 > 65536)

Java  Compiler Error :
Caused by: com.android.tools.r8.CompilationFailedException: Compilation failed to complete
Caused by: com.android.tools.r8.utils.AbortException: Error: null, Cannot fit requested classes in a single dex file (# methods: 71636 > 65536)



Solution to Resolve:

a) Add dependency in build.gradle file:
implementation 'com.android.support:multidex:1.0.3'
b) Add multiDexEnabled In build.gradle's defaultConfig section:
multiDexEnabled true



No comments:

Post a Comment

Could not identify launch activity: Default activity not found : Error while Launching activity

Problem : I got this Error , When I tried to create an application without any Activity . Basically like to develop an Android Headless appl...