firebase/firebase-android-sdk

Firebase Perf Plugin does not work with latest AGP 9 alpha

Closed this issue ยท 16 comments

Testing AGP 9.0.0-alpha02, I am running into the following error during the configuration phase:

* What went wrong:
An exception occurred applying plugin request [id: 'com.google.firebase.firebase-perf', version: '2.0.1']
> Failed to apply plugin 'com.google.firebase.firebase-perf'.
   > Could not create plugin of type 'FirebasePerfPlugin'.
      > Could not generate a decorated class for type FirebasePerfPlugin.
         > com/android/build/api/transform/Transform

Seems that AGP 9 will introduce some breaking change that isn't handled by the perf plugin.

I found a few problems with this issue:

  • I couldn't figure out how to label this issue, so I've labeled it for a human to triage. Hang tight.
  • This issue does not seem to follow the issue template. Make sure you provide all the required information.

Hi @pablobaxter, thank you for reaching out. I was able to reproduce the issue. This might be related to the removal of the API mentioned here

Android Gradle plugin 9.0 removes: The deprecated and disabled BaseExtension.registerTransform APIs, which only remained to allow compiling against the latest AGP version while targeting running on AGP 4.2 or lower.

I'll raise this to our engineers and see what we can do here.

Not to nag, but wondering if there is any update on this issue? I'm hoping to do some performance testing on builds using AGP 9 without needing to remove this plugin at some point before AGP 9 is released.

I fixed the specific issue you have here, but the next AGP alpha broke something else so we didn't release it unfortunately

I will update here when we know more

I fixed the specific issue you have here, but the next AGP alpha broke something else so we didn't release it unfortunately

I will update here when we know more

Can you provide details on what exactly broke, so I can check if there is a workaround and update the public tracker I have?

Let me know if there's anything I can do to help push this along. This is the last plugin blocking my testing of AGP 9, and I wouldn't mind testing a nightly if this plugin as well.

Hi @pablobaxter. We are actively working on this, and expect it to be fixed in the release near the end of this month.

The Android Gradle plugin team is also tracking Gradle plugins with compatibility issues, and are aware of this. So this will be resolved before AGP 9 becomes stable.

I am curious why you need AGP 9 alpha? If you can give us some insight into your use case, we might be able to provide you with a workaround for now.

I wouldn't mind testing a nightly if this plugin as well.

We will provide you with a pre-release as soon as it's ready!

I am curious why you need AGP 9 alpha? If you can give us some insight into your use case, we might be able to provide you with a workaround for now.

It's mainly for the build test harness I have around the project I work on. Right now, I have to do extra tweaks just to remove the performance plugin rather than just changing the AGP version used during tests, which isn't ideal. I have no need for AGP 9 alpha, but I try to make it a point to test the latest pre-release of core build frameworks I use to help catch bugs early on.

Also, I'm doing what I can to help track issues in other plugins that would break with AGP 9, as there's lots of changes that affect these plugins. Most have workarounds, but this is one of the few plugins that is a full blocker if used with AGP 9: https://agp-status.frybits.com/agp-9.0.0/

Question for you all: why isn't the performance Gradle plugin open source?

We're working on open sourcing the gradle plugin - and will likely have it so by EOY.

For the AGP 9 issue - we have a fix - and can share it with you to EAP it ASAP. If interested, please ๐Ÿ‘ this comment.

Here's an EAP build: m2repository.zip

To use it:

After using it, please ๐Ÿ˜„ this comment if it works as expected. If there's issues, please share more details if possible. Thanks!

I'm able to sync with the plugin on AGP 9 and was able to build an app without issue. I haven't had a chance to see if the transformations are working as expected.

This has been fixed in the Firebase Performance Gradle plugin 2.0.2. I'll be closing this ticket now. Let us know if there's any issue. Thanks!

Pulling this latest version to the app I work on. Will report any new issues in another ticket and reference this issue. Thanks for getting this out!