-
Notifications
You must be signed in to change notification settings - Fork 71
chore: migrate Android example to AGP 9 #392
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
Merged
Merged
Changes from all commits
Commits
Show all changes
12 commits
Select commit
Hold shift + click to select a range
9feb790
chore: migrate example to AGP 9
marandaneto 978c897
address pr review feedback
marandaneto d5c264f
fix: guard kotlin compiler options for AGP 9
marandaneto 79fdc59
fix: align Kotlin JVM target for AGP 9
marandaneto f94acba
fix: enable built-in Kotlin for example
marandaneto 8f7acfb
fix: restore Flutter APK output path
marandaneto 05f53de
Merge branch 'main' into chore/agp9-example-migration
marandaneto 0f66c00
chore: add changeset for AGP 9 support
marandaneto 2f9661b
chore: align example with Flutter Android template
marandaneto 796a26c
chore: require AGP 8 for Android plugin
marandaneto b1b199b
docs: clarify built-in Kotlin default
marandaneto 54dfd2a
Apply suggestions from code review
marandaneto File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,5 @@ | ||
| --- | ||
| 'posthog_flutter': minor | ||
| --- | ||
|
|
||
| Support Android builds with AGP 9 built-in Kotlin while preserving compatibility with AGP 8. This release requires Android Gradle Plugin 8.0 or newer. |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,45 @@ | ||
| plugins { | ||
| id("com.android.application") | ||
| // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins. | ||
| id("dev.flutter.flutter-gradle-plugin") | ||
| // uncomment to upload mapping files to PostHog | ||
| // id("com.posthog.android") version "1.0.3" | ||
| } | ||
|
|
||
| android { | ||
| namespace = "com.example.flutter" | ||
| compileSdk = flutter.compileSdkVersion | ||
| ndkVersion = flutter.ndkVersion | ||
|
|
||
| compileOptions { | ||
| sourceCompatibility = JavaVersion.VERSION_17 | ||
| targetCompatibility = JavaVersion.VERSION_17 | ||
| } | ||
|
|
||
| defaultConfig { | ||
| applicationId = "com.example.flutter" | ||
| // You can update the following values to match your application needs. | ||
| // For more information, see: https://flutter.dev/to/review-gradle-config. | ||
| minSdk = flutter.minSdkVersion | ||
| targetSdk = flutter.targetSdkVersion | ||
| versionCode = flutter.versionCode | ||
| versionName = flutter.versionName | ||
| } | ||
|
|
||
| buildTypes { | ||
| release { | ||
| // Signing with the debug keys for now, so `flutter run --release` works. | ||
| signingConfig = signingConfigs.getByName("debug") | ||
| } | ||
| } | ||
| } | ||
|
|
||
| kotlin { | ||
| compilerOptions { | ||
| jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_17 | ||
| } | ||
| } | ||
|
|
||
| flutter { | ||
| source = "../.." | ||
| } |
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,24 @@ | ||
| allprojects { | ||
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| } | ||
| } | ||
|
|
||
| val newBuildDir: Directory = | ||
| rootProject.layout.buildDirectory | ||
| .dir("../../build") | ||
| .get() | ||
| rootProject.layout.buildDirectory.value(newBuildDir) | ||
|
|
||
| subprojects { | ||
| val newSubprojectBuildDir: Directory = newBuildDir.dir(project.name) | ||
| project.layout.buildDirectory.value(newSubprojectBuildDir) | ||
| } | ||
| subprojects { | ||
| project.evaluationDependsOn(":app") | ||
| } | ||
|
|
||
| tasks.register<Delete>("clean") { | ||
| delete(rootProject.layout.buildDirectory) | ||
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,6 @@ | ||
| org.gradle.jvmargs=-Xmx8G -XX:MaxMetaspaceSize=4G -XX:ReservedCodeCacheSize=512m -XX:+HeapDumpOnOutOfMemoryError | ||
| android.useAndroidX=true | ||
| # This newDsl flag was added by the Flutter template | ||
| android.newDsl=false | ||
| # This builtInKotlin flag was added by the Flutter template | ||
| android.builtInKotlin=false |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,26 @@ | ||
| pluginManagement { | ||
| val flutterSdkPath = | ||
| run { | ||
| val properties = java.util.Properties() | ||
| file("local.properties").inputStream().use { properties.load(it) } | ||
| val flutterSdkPath = properties.getProperty("flutter.sdk") | ||
| require(flutterSdkPath != null) { "flutter.sdk not set in local.properties" } | ||
| flutterSdkPath | ||
| } | ||
|
|
||
| includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") | ||
|
|
||
| repositories { | ||
| google() | ||
| mavenCentral() | ||
| gradlePluginPortal() | ||
| } | ||
| } | ||
|
|
||
| plugins { | ||
| id("dev.flutter.flutter-plugin-loader") version "1.0.0" | ||
| id("com.android.application") version "9.2.1" apply false | ||
| id("org.jetbrains.kotlin.android") version "2.3.20" apply false | ||
| } | ||
|
|
||
| include(":app") |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.