I'm trying to check out the declarative gradle EAP...
# declarative-gradle
m
I'm trying to check out the declarative gradle EAP. After getting the basic sample to run, I tried on my own fresh project. I converted my
settings.gradle.kts
to
settings.gradle.dcl
and everything still works fine. However, I get a sync error when I try to add a
default
for a software type in my
setting.gradle.dcl
. I get the following exception:
Copy code
Failures in resolution:
    19:1: unresolved function call signature for 'defaults'
Where it's pointing to the
defaults
block:
Copy code
defaults {
    androidApplication {
        compileSdk = 34
}
If I remove the above block, everything works fine. I've not converted any other files thus far.
p
Hi, What version of Gradle wrapper are you using?
I recommend using the same as the samples or higher. All this is very much in flux.
m
Alright,
Mine:
Copy code
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-bin.zip
The declarative sample
Copy code
distributionUrl=https\://services.gradle.org/distributions-snapshots/gradle-8.12-20241024175615+0000-bin.zip
I'll give the same wrapper version a go 👍
p
Yeah 8.9 did not have support for defaults in settings
m
Wouldn't have thought to check that one, I'm not that well versed with Gradle. Thanks for the help 👍 E: That did resolve the issue
p
You thought of asking 😉 Great you got it working!
m
Curiously now my project is building from the terminal, even though the sync from AS fails in the following way:
The project is using an incompatible version (AGP 8.7.1) of the Android Gradle plugin. Latest supported version is AGP 8.7.0-alpha03
I guess 8.7.0-alpha03 is the maximum for
Android Studio Ladybug | 2024.1.3 Nightly 2024-07-26
? I tried a newer nightly, but it didn't have the declarative configuration option under Studio Flags. I am guessing AGP
8.7.1.
is pulled from the
androidApplication
software type?
p
Mmm, yeah currently all this requires a narrow set of versions to work. What version of ecosystem plugins are you using in settings? Are they the same as the sample?
m
I tried
0.1.15
,
.19
and some versions >
.20
. Is there a table or another way to decipher which versions work together? Or which version does the plugin apply?
So,
Copy code
id("org.gradle.experimental.android-ecosystem").version("0.1.17")
->
Unsupported method: Variant.getExperimentalProperties().
And after
0.1.18
its the same as above, incompatible AGP
p
It seems the samples
main
branch https://github.com/gradle/declarative-samples-android-app requires a more recent build of Studio. Gimme a moment
Dang, it will take a little while for us to make a more recent build of Studio available
m
Got it 👍 thanks for letting me know so I don't bang my head on the exceptions 😄 I'd be happy to continue trying it out once there's a a set of working versions available (gradle + AS + AGP + android-ecosystem plugin)
p
I'll make sure to notify this channel when done
🙌 1
m
Hey again, any updates on this by any chance?
p
We will have an update later Today
m
Great to hear! Thanks 👍
p
This should be merged pretty soon to the documentation but if you want to try now here are the new download links: • macOS Apple SiliconmacOS IntelWindowsLinux
Yeah I know .. GDrive ... This is a temporary solution until we have full CI/CD for this, which should happen shortly.
m
Thanks! I think I'll be able to give it a spin next week 👍