Superclass androidx.core.app.f of androidx.activity.ComponentActivity is declared final

Viewed 1998

I wanted to update the version of the application in the Play Store, but in the tests I started getting this error.

Superclass androidx.core.app.f of androidx.activity.ComponentActivity is declared final

According to the google issues tracker this is new, maybe someone has a solution to this problem.

7 Answers

I added

-keep class androidx.core.app.** { *; }

In the proguard rules to solve the issue.

Edit: minus sign (-) needs to be before the line

On 27.07.2022 Google team members posted that the bug has been fixed. and on 09.08.2022 they added some explanation that you can find in this link.

In two words: In pre-launch testing app-crawler apk and the app apk generated different ‘keep rules’ for shrunk. This will cause ‘no such method’ or ‘superclass will be declared final’.

You try update implementation 'com.google.android.gms' in build.gradle to lastest version

I had the same issue with Flutter. I remove Firebase from build.gradle

// implementation platform('com.google.firebase:firebase-bom:29.0.4')

also downgrading firebase to 29.0.2 is working too.

I added this line into gradle.properties

android.enableR8.fullMode=true

I hope it will help you too

For builds made before August 2022

If your APK/App Boundle was created before August 2022, the issue might be related to an internal issue by Google.

See this issue tracker: https://issuetracker.google.com/issues/237785592?pli=1

For me it was enough to build a new release on my machine (increasing version number at least by 1!) and upload it... Afterwards, the problem was gone.

Related