From 68d88c3eb888836128344dd6dd84b87d73548230 Mon Sep 17 00:00:00 2001 From: Deepak Date: Tue, 1 Sep 2026 20:32:21 +0530 Subject: [PATCH] Apply Kotlin Gradle Plugin only when AGP built-in Kotlin is inactive. Lets host apps on AGP 9 build whether they use built-in Kotlin or Flutter's android.builtInKotlin=false default, without raising the minimum Flutter version. Co-authored-by: Cursor --- intercom_flutter/CHANGELOG.md | 4 ++++ intercom_flutter/android/build.gradle | 15 ++++++++++++--- intercom_flutter/pubspec.yaml | 2 +- 3 files changed, 17 insertions(+), 4 deletions(-) diff --git a/intercom_flutter/CHANGELOG.md b/intercom_flutter/CHANGELOG.md index c954332..bd1c385 100755 --- a/intercom_flutter/CHANGELOG.md +++ b/intercom_flutter/CHANGELOG.md @@ -1,5 +1,9 @@ # Changelog +## 9.6.25 + +* Android: apply the Kotlin Gradle Plugin only when AGP built-in Kotlin is not active. + ## 9.6.24 * Bump Intercom Android SDK version to [18.9.1](https://github.com/intercom/intercom-android/releases/tag/18.9.1) diff --git a/intercom_flutter/android/build.gradle b/intercom_flutter/android/build.gradle index 0474d88..21b082a 100644 --- a/intercom_flutter/android/build.gradle +++ b/intercom_flutter/android/build.gradle @@ -22,7 +22,13 @@ rootProject.allprojects { } apply plugin: 'com.android.library' -apply plugin: 'kotlin-android' + +def agpMajor = com.android.Version.ANDROID_GRADLE_PLUGIN_VERSION.tokenize('.')[0] as int +def builtInKotlin = agpMajor >= 9 && + project.findProperty('android.builtInKotlin')?.toString() != 'false' +if (!builtInKotlin) { + apply plugin: 'kotlin-android' +} android { compileSdk 36 @@ -43,8 +49,11 @@ android { sourceCompatibility JavaVersion.VERSION_1_8 targetCompatibility JavaVersion.VERSION_1_8 } - kotlinOptions { - jvmTarget = '1.8' +} + +kotlin { + compilerOptions { + jvmTarget = org.jetbrains.kotlin.gradle.dsl.JvmTarget.JVM_1_8 } } diff --git a/intercom_flutter/pubspec.yaml b/intercom_flutter/pubspec.yaml index 12e1ac6..8de4e8f 100644 --- a/intercom_flutter/pubspec.yaml +++ b/intercom_flutter/pubspec.yaml @@ -1,7 +1,7 @@ name: intercom_flutter description: Flutter plugin for Intercom integration. Provides in-app messaging and help-center Intercom services -version: 9.6.24 +version: 9.6.25 homepage: https://github.com/v3rm0n/intercom_flutter dependencies: