Skip to content
23 changes: 14 additions & 9 deletions pay_android/android/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -13,19 +13,20 @@
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import org.jetbrains.kotlin.gradle.dsl.JvmTarget

group 'io.flutter.plugins.pay_android'
version '1.0-SNAPSHOT'

buildscript {
ext.kotlin_version = '1.8.21'
ext.kotlin_version = '2.2.10'
repositories {
google()
mavenCentral()
}

dependencies {
classpath 'com.android.tools.build:gradle:7.4.2'
classpath 'com.android.tools.build:gradle:8.13.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
}
}
Expand All @@ -40,15 +41,19 @@ rootProject.allprojects {
apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
// Conditional for compatibility with AGP <4.2.
if (project.android.hasProperty("namespace")) {
namespace 'io.flutter.plugins.pay_android'
kotlin {
compilerOptions {
jvmTarget = JvmTarget.fromTarget("17")
}
compileSdk 34
}

android {
namespace = 'io.flutter.plugins.pay_android'
compileSdk = flutter.compileSdkVersion

kotlinOptions {
jvmTarget = '1.8'
compileOptions {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
}

sourceSets {
Expand Down