website
website copied to clipboard
Set Android settings.gradle migration doc references to acceptable values
https://docs.flutter.dev/release/breaking-changes/flutter-gradle-plugin-apply
Specficially https://github.com/flutter/website/blob/b9d43e2d0c5d6fb0b16e65112cd41acc4f9c58e1/src/release/breaking-changes/flutter-gradle-plugin-apply.md?plain=1#L36
The project I'm working on has no previous values for these. I've tried copying the values from another project that does work and it seems to work, although now I get Java heap space errors from Gradle .... which I know how to fix or did at one point :)
@reidbaker fyi, since this applies to Android and Gradle.
@bartekpacia fyi
My guess is heap errors are either that your Java and gradle versions are not compatible or are because you need to increase your grade heap size. I think most of our flutter projects set it to 4g.
My guess is heap errors are either that your Java and gradle versions are not compatible or are because you need to increase your grade heap size. I think most of our flutter projects set it to 4g.
Yes, I'm on an old project where the default was 1536mb, putting it to 4g worked.
The project I'm working on has no previous values for these.
I understand missing dependency on Kotlin (project was Java-only), but missing dependency on AGP? How did it work?
of course I'm happy to update the migration docs but I'd like to know more
Re heap errors: I'll update migration guide with this info as well, thanks
I don't know where an AGP version was defined at all in the project. What string should I be looking for?
android/build.gradle > buildscript {} block > look for classpath 'com.android.tools.build:gradle.
For example in the following android/build.gradle:
buildscript {
ext.kotlin_version = '1.7.10'
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:7.3.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
// omitted more code
the AGP (Android Gradle Plugin) version is 7.3.0
In this issue I gathered how Gradle buildscripts look like in all recent Flutter versions. You probably want to migrate from the "Flutter 3.10" to "Flutter 3.16/Flutter master".
We could also link to this
@dnfield : What change do you want made to the docs? That is unclear from this thread. Can you summarize?
@dnfield : What change do you want made to the docs? That is unclear from this thread. Can you summarize?
How to determine the value to put in {agpVersion}. I think what @bartekpacia wrote is probably the right way.