Issue with android.registerTransform Removal After Upgrading to Android AGP 8 When Using com.guardsquare.proguard

Description:

I encountered an issue while performing the AssembleRelease task after upgrading the Android Gradle Plugin (AGP) to version 8. Upon running the task, I received the following error:

What went wrong:
A problem occurred evaluating project ‘:app’.
Failed to apply plugin ‘com.guardsquare.proguard’.
API ‘android.registerTransform’ is removed.
For more information, see Android Gradle plugin API updates  |  Android Studio  |  Android Developers.
To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.

Project Configuration:

apply plugin: ‘com.guardsquare.proguard’
classpath ‘com.guardsquare:proguard-gradle:7.5.0’
classpath ‘com.android.tools.build:gradle:8.4.2’

It seems that android.registerTransform, which has been removed in AGP 8, is still being referenced by com.guardsquare.proguard.
I would appreciate any guidance on how to resolve this issue or updates on when this might be addressed in the proguard-gradle plugin.

Hi @Axita_Savani ! Since R8 is now the default shrinker in the Android build system, ProGuard no longer supports AGP beyond 7.x. R8 is is fully compatible with ProGuard rules though, so you will be able to use your existing rules.

1 Like

Hi, Thank you for quick response.
@james So, does it’s mean that I can now remove this Guardsqure and use the default Proguard which given by Android inbuild?
Please clarify.

Thank you!

1 Like

Yes, indeed. You can use the default described here but your existing keep rules can remain the same.

1 Like