Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for AGP 8+ #280

Closed
romtsn opened this issue Sep 27, 2022 · 10 comments
Closed

Support for AGP 8+ #280

romtsn opened this issue Sep 27, 2022 · 10 comments

Comments

@romtsn
Copy link

romtsn commented Sep 27, 2022

We're running tests for our Gradle plugin against AGP/Gradle matrix, and as part of that we've recently started to run our tests on AGP 8.0.0-alpha01. Unfortunately, proguard does not support this version yet, because the Transform API has been removed.

Are there any plans to support it anytime soon? AGP 8 is gonna become stable most likely by the end of the year, so that'd be great to have it supported.

Here's the exact error I got in my Gradle logs:

* What went wrong:
A problem occurred evaluating project ':examples:android-guardsquare-proguard'.
> Failed to apply plugin 'com.guardsquare.proguard'.
   > API 'android.registerTransform' is removed.
     
     For more information, see https://developer.android.com/studio/releases/gradle-plugin-api-updates#transform-api.
     To determine what is calling android.registerTransform, use -Pandroid.debug.obsoleteApi=true on the command line to display more information.
@gsprdev
Copy link

gsprdev commented Apr 7, 2023

This remains an issue today, with the latest versions.
The following two dependencies are incompatible, with the same error as above:

buildscript {
    dependencies {
        classpath("com.android.tools.build:gradle:8.0.0-rc01")
        classpath("com.guardsquare:proguard-gradle:7.3.2")
    }
}

@chrisjenx
Copy link

This is a P0 as this is completely broken now and stopping people upgrading

@jvdestefano
Copy link

Understood. We are currently evaluating the roadmap for ProGuard inclusive of AGP 8 support, and we will be able to provide more clarity in the coming weeks.

@vicizmax
Copy link

@jvdestefano would you happen to know if there is by any chance any further development on this?

@jvdestefano
Copy link

There has been no further development nor is it planned at this time.

@androidacy-user
Copy link

androidacy-user commented Sep 8, 2023

There has been no further development nor is it planned at this time.

So recent android studio releases require agp 8+, newer build features (anything related to features shipped in the past almost half year) depend on it, and ProGuard's official stance is "kindly f*** yourself" in regards to AGP 8? Seems very professional 👍🏾

It'd be one thing if the stance was "we're working on it, but no ETA" but to take a "sounds like a you problem" stance is very unbecoming.

@listvin
Copy link

listvin commented Nov 4, 2023

As far as I can see, targeting Android API 34 requires AGP 8.1.1+
So there is currently no way of using Proguard with new Android apps?
Kinda bummer =/
Is this still not planned?

@mrjameshamilton
Copy link
Collaborator

mrjameshamilton commented Nov 7, 2023

Since R8 is now the default Android shrinker, there is little need or demand for using ProGuard on Android apps. For this reason, we don't have any current plans for further support for AGP.

If there is a need or a use-case, one route for the community to take would be for AGP support to be implemented in a manner similar to the ProGuard Maven plugin: as a separate project that implements a ProGuard AGP plugin calling out to ProGuard.

R8 is compatible with ProGuard keep rules, so the manual and tools like the ProGuard Playground can be used with R8 configurations.

@mrjameshamilton mrjameshamilton closed this as not planned Won't fix, can't repro, duplicate, stale Nov 7, 2023
@peterdk
Copy link

peterdk commented Apr 2, 2024

I tested with latest R8, but it lacks in terms of optimization. My app (a piano app) has noticeable more latency, even though everything is profiled and optimized. So I do have a need for proguard in AGP 8+. Since you also make Dexguard (or does that not exist anymore), I would assume it's not that much work to also add proguard support? I am willing to invest in this, since the app makes a relevant amount of revenue. I'll send a email to discuss further.

@EchoEllet
Copy link
Contributor

EchoEllet commented May 30, 2024

Since R8 is now the default Android shrinker, there is little need or demand for using ProGuard on Android apps. For this reason, we don't have any current plans for further support for AGP.

Not directly related

image

Proguard still includes some things related to Android and R8 in the JAR

image

While it's not an issue, and in most cases, it's just naming, separating Android-specific components from Kotlin/JVM and regular JVM Java projects would help in maintaining clarity and avoid any potential confusion. This separation could enhance the focus and efficiency for developers who are working exclusively on non-Android projects.

Ultimately, it depends on one's perspective

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

10 participants