Skip to content

Update Android example app build tools and pubspec path reference#59

Open
KeeganBeuthin wants to merge 2 commits intokinde-oss:mainfrom
KeeganBeuthin:fix/android-versioning
Open

Update Android example app build tools and pubspec path reference#59
KeeganBeuthin wants to merge 2 commits intokinde-oss:mainfrom
KeeganBeuthin:fix/android-versioning

Conversation

@KeeganBeuthin
Copy link
Contributor

Changes:

  • Fix path reference in example pubspec.yaml for local SDK dependency
  • Update Android build tools: AGP 8.7.3→8.9.1, Kotlin 1.9.24→2.1.0, Gradle 8.9→8.11.1 for android compatibility

@KeeganBeuthin KeeganBeuthin requested a review from a team as a code owner December 17, 2025 19:36
@coderabbitai
Copy link
Contributor

coderabbitai bot commented Dec 17, 2025

Walkthrough

Updated Android example project build configuration: Gradle wrapper updated to 8.11.1, Android and Kotlin plugin versions bumped, and JVM/Gradle memory and JVM options increased in gradle.properties (Jetifier flag removed).

Changes

Cohort / File(s) Summary
Gradle wrapper
example/android/gradle/wrapper/gradle-wrapper.properties
Updated Gradle distribution URL from gradle-8.9-bin.zip to gradle-8.11.1-bin.zip.
Plugin versions
example/android/settings.gradle
Bumped com.android.application from 8.7.38.9.1 and org.jetbrains.kotlin.android from 1.9.242.1.0 (both apply false unchanged).
Gradle JVM / properties
example/android/gradle.properties
Increased JVM heap and related options (e.g., -Xmx1536M-Xmx8G, added -XX:MaxMetaspaceSize=4G, -XX:ReservedCodeCacheSize=512m, -XX:+HeapDumpOnOutOfMemoryError); removed android.enableJetifier=true; kept android.useAndroidX=true.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Pre-merge checks

✅ Passed checks (3 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately reflects the main changes: updating Android build tools and pubspec path reference, which aligns with the actual modifications to gradle wrapper, plugin versions, and gradle properties.
Description check ✅ Passed The description is directly related to the changeset, mentioning path reference fixes and all three major build tool updates (AGP, Kotlin, Gradle versions) that are reflected in the modified files.
Docstring Coverage ✅ Passed No functions found in the changed files to evaluate docstring coverage. Skipping docstring coverage check.

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 1fbd3e1 and aec28c3.

⛔ Files ignored due to path filters (1)
  • example/pubspec.yaml is excluded by !**/*.yaml
📒 Files selected for processing (2)
  • example/android/gradle/wrapper/gradle-wrapper.properties (1 hunks)
  • example/android/settings.gradle (1 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kartuli98
Repo: kinde-oss/kinde-flutter-sdk PR: 27
File: example/lib/state/app_state_manager.dart:110-124
Timestamp: 2025-06-20T10:43:27.820Z
Learning: The PR #27 for the Flutter starter kit example app is designed to work with Kinde Flutter SDK version 1.0.4, where the register() method will return a token if registration is successful. The current build errors are expected since the code targets a future SDK version.
🔇 Additional comments (2)
example/android/settings.gradle (1)

21-21: LGTM: AGP version update is appropriate.

The Android Gradle plugin 8.9 supports API level 35 and represents a minor version update from 8.7.3. The update aligns with the Gradle 8.11.1 upgrade.

example/android/gradle/wrapper/gradle-wrapper.properties (1)

5-5: Gradle 8.11.1 is beyond the officially tested range for Kotlin 2.1.0.

Kotlin 2.1.0–2.1.10 are fully compatible with Gradle up to 8.6. Gradle versions 8.7–8.10 are also supported, with only one exception: If you use the Kotlin Multiplatform Gradle plugin, you may see deprecation warnings in your multiplatform projects calling the withJava() function in the JVM target. You can also use Gradle and AGP versions up to the latest releases, but if you do, keep in mind that you might encounter deprecation warnings or some new features might not work. Ensure thorough testing of the example app build with Gradle 8.11.1 to verify compatibility.

Copy link
Member

@victoreronmosele victoreronmosele left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved.

Before merging, can we update the content of the gradle.properties file (not currently included in this PR) to this:

org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true

I wasn't able to build on my system without adding these changes.

These are the updated gradle.properties settings for latest Flutter projects.

@KeeganBeuthin
Copy link
Contributor Author

@victoreronmosele Thank you, I have added in the change as you have requested as well, now need to get kinde giants to also approve some of the outstanding prs we have currently

coderabbitai[bot]
coderabbitai bot previously requested changes Dec 30, 2025
Copy link
Contributor

@coderabbitai coderabbitai bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 1

📜 Review details

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between aec28c3 and c133449.

📒 Files selected for processing (1)
  • example/android/gradle.properties
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: kartuli98
Repo: kinde-oss/kinde-flutter-sdk PR: 27
File: example/lib/state/app_state_manager.dart:110-124
Timestamp: 2025-06-20T10:43:27.820Z
Learning: The PR #27 for the Flutter starter kit example app is designed to work with Kinde Flutter SDK version 1.0.4, where the register() method will return a token if registration is successful. The current build errors are expected since the code targets a future SDK version.
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
  • GitHub Check: GitGuardian Security Checks
🔇 Additional comments (1)
example/android/gradle.properties (1)

1-2: gradle.properties was newly created, not upgraded.

The gradle.properties file is a new addition and was not modified from a previous state. It was intentionally created with only android.useAndroidX=true enabled; there is no android.enableJetifier property to remove. With AGP 8.9.1 and Kotlin 2.1.0, this AndroidX-only configuration is appropriate for modern dependency management.

Likely an incorrect or invalid review comment.

@@ -1,3 +1,2 @@
org.gradle.jvmargs=-Xmx1536M
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
Copy link
Contributor

@coderabbitai coderabbitai bot Dec 30, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

⚠️ Potential issue | 🟠 Major

Reduce excessive heap allocation.

The 8GB heap allocation is extremely high for an example app and may prevent builds on machines with limited RAM (e.g., 8-16GB total). While newer AGP/Gradle versions require more memory, 4GB is typically sufficient for most Android projects.

🔎 Recommended configuration with more conservative memory settings
-org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
+org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=1G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=1G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError
🤖 Prompt for AI Agents
In example/android/gradle.properties around line 1, the JVM heap setting is set
to -Xmx8G which is excessive for an example app and may fail on machines with
limited RAM; change it to a more conservative value (e.g., -Xmx4G) and
optionally reduce other memory flags (MaxMetaspaceSize, ReservedCodeCacheSize)
to reasonable defaults so the build can run on typical developer machines,
update the line to use -Xmx4G and adjust related sizes accordingly.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is not an issue. This is the default gradle properties for newer Flutter projects.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🧩 Analysis chain

🌐 Web query:

Flutter default gradle.properties JVM heap size Xmx8G

💡 Result:

Short answer: Many Flutter Android templates (and Flutter's repo integration tests) set org.gradle.jvmargs=-Xmx8G in gradle.properties; that's intentional to avoid Gradle JVM OOMs on large Android/AGP builds. See Flutter source examples and guidance to raise/lower JVM heap in Gradle docs/Android docs. [1][2][3]

What to do

  • To change it, edit android/gradle.properties (or ~/.gradle/gradle.properties) and set, for example:
    org.gradle.jvmargs=-Xmx2048m -XX:MaxMetaspaceSize=512m -Dfile.encoding=UTF-8
  • Android's docs recommend testing 4/6/8 GB if GC dominates build time and note you must set MaxMetaspaceSize when changing defaults. [2]
  • Gradle's docs show the default and how to configure org.gradle.jvmargs. [3]

References

  • Example Flutter gradle.properties containing -Xmx8G (Flutter repo/integration tests). [1]
  • Android Studio / Android build guidance on increasing JVM heap for Gradle (recommend 4/6/8g and MaxMetaspaceSize note). [2]
  • Gradle documentation on org.gradle.jvmargs and configuring JVM memory. [3]

@victoreronmosele, you're absolutely right, and thank you for the clarification! I've verified that Flutter's own templates and integration tests do use -Xmx8G as the default JVM heap setting for gradle.properties, and Android's official documentation recommends testing with 4GB, 6GB, or 8GB heap sizes for large Android/AGP builds to avoid out-of-memory errors during Gradle builds.

I apologize for the incorrect suggestion. The configuration in this PR is appropriate for newer Flutter projects.


✏️ Learnings added
Learnt from: victoreronmosele
Repo: kinde-oss/kinde-flutter-sdk PR: 59
File: example/android/gradle.properties:1-1
Timestamp: 2025-12-30T13:26:59.783Z
Learning: In Flutter Android projects, the default gradle.properties JVM heap setting is -Xmx8G with additional memory flags like -XX:MaxMetaspaceSize=4G. This is the standard configuration in newer Flutter project templates and Flutter's own repository to prevent Gradle JVM out-of-memory errors during Android builds.

Note: Learnings are effective only in the context of similar code segments. To apply general coding guidelines, please configure review instructions. You can manage existing learnings in the app.


🧠 Learnings used
Learnt from: kartuli98
Repo: kinde-oss/kinde-flutter-sdk PR: 27
File: example/windows/runner/win32_window.h:15-19
Timestamp: 2025-04-27T22:03:28.459Z
Learning: Files in the example/windows/runner/ directory are auto-generated by the "flutter create ." command and should generally not be modified as they may be overwritten during framework updates.

Learnt from: kartuli98
Repo: kinde-oss/kinde-flutter-sdk PR: 27
File: example/lib/state/app_state_manager.dart:110-124
Timestamp: 2025-06-20T10:43:27.820Z
Learning: The PR #27 for the Flutter starter kit example app is designed to work with Kinde Flutter SDK version 1.0.4, where the register() method will return a token if registration is successful. The current build errors are expected since the code targets a future SDK version.

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

Successfully merging this pull request may close these issues.

2 participants