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

7

29

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.

Oran answered 4/7, 2022 at 8:39 Comment(1)
This seems to be only happening in pre-launch.Witenagemot
O
2

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’.

Oran answered 10/8, 2022 at 6:21 Comment(0)
P
8

I added

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

In the proguard rules to solve the issue.

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

Paleolith answered 5/7, 2022 at 14:7 Comment(3)
Have you understood what the problem is exactly? Is it a specific version of an AndroidX library?Associative
I'm following this thread issuetracker.google.com/issues/237785592Paleolith
Wouldn't -keep class androidx.core.app.ComponentActivity { *; } be enough in that case?Winy
O
2

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’.

Oran answered 10/8, 2022 at 6:21 Comment(0)
W
1

Did you upgrade some libraries in your build.gradle?

Coroutines maybe?

We have this exception reported too and it has the same stack trace as an older exception we had before, so possibly equally related to the Kotlin coroutines lib version:

java.lang.VerifyError: Verifier rejected class. Code working fine in debug mode, but not throwing this error in release mode

Winy answered 5/7, 2022 at 0:46 Comment(1)
HI, not I didn't update gradle or coroutines. On all local devices it works fine, but on google test devices it crashes. Also according to firebase-crashlytics it crashed several times while google testing.Oran
K
1

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

Klara answered 6/7, 2022 at 2:49 Comment(1)
Hi, it's the last version and also I didn't make any changes to it in the last release.Oran
B
1

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.

Badenpowell answered 7/7, 2022 at 13:18 Comment(1)
My project currently uses 26.0.0, so it's not the caseOran
T
1

I added this line into gradle.properties

android.enableR8.fullMode=true

I hope it will help you too

Thorne answered 22/7, 2022 at 5:55 Comment(0)
M
0

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.

Mornay answered 4/8, 2022 at 14:45 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.