For my android project, I was building release apk(s) till now and the generated apk(s) successfully opened when launched. Today suddenly, I started getting the following exception on building the release apk after making a small change to the app. Here is the exception:
Fatal Exception: java.lang.AssertionError: impossible
at java.lang.Enum$1.create(Enum.java:45)
at java.lang.Enum$1.create(Enum.java:35)
at libcore.util.BasicLruCache.get(BasicLruCache.java:54)
at java.lang.Enum.getSharedConstants(Enum.java:211)
at java.util.EnumSet.noneOf(EnumSet.java:48)
at java.util.EnumSet.allOf(EnumSet.java:66)
at com.facebook.internal.SmartLoginOption.(SmartLoginOption.java:29)
at com.facebook.internal.FetchedAppSettingsManager.parseAppSettingsFromJSON(FetchedAppSettingsManager.java:225)
at com.facebook.internal.FetchedAppSettingsManager.access$000(FetchedAppSettingsManager.java:53)
at com.facebook.internal.FetchedAppSettingsManager$1.run(FetchedAppSettingsManager.java:143)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:818)
I read a few posts (this and this) regarding this crash and some of them pointed to check if the proguard-android.txt
(inside <myhome>/Library/Android/sdk/tools/proguard
) is properly getting read or not. So, I wrote some random sentence at the top of this file and re-ran the code. But, it successfully ran. I tried cleaning cache as well. Finally, I decided to reinstall Android Studio. And after a clean install of Android studio as well (link), I still face the same issue. I am stuck here for almost 5 hours now and want some help. If anyone has any pointers, please do help me.
The code snippet from my gradle file is:
....
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
debug {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
....