liujiakuoyx / leak_detector

flutter memory leak detector.
BSD 2-Clause "Simplified" License
133 stars 24 forks source link

Upgrade kotlin:kotlin-gradle-plugin #13

Closed selena775 closed 1 year ago

selena775 commented 1 year ago

I've tried to add this beautiful and needed library to our project but encountered following error.

FAILURE: Build failed with an exception.
* What went wrong:
The Android Gradle plugin supports only Kotlin Gradle plugin version 1.5.20 and higher.
The following dependencies do not satisfy the required version:
project ':leak_detector' -> org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50

Would it be possible to upgrade this project to use Kotlin Gradle plugin version 1.5.20 and higher? Thank you so much.

DaemonChoejur commented 1 year ago

anyone working on this?

XERZES27 commented 1 year ago

@selena775 @DaemonChoejur @ you can add this to your pubspec.yaml

leak_detector:
    git:
      url: https://github.com/XERZES27/leak_detector.git

Or simply fork the project and modify the build.gradle as such

group 'com.ljk.leak_detector'
version '1.0-SNAPSHOT'

buildscript {
    ext.kotlin_version = '1.7.10'
    repositories {
        google()
        jcenter()
    }

    dependencies {
        classpath 'com.android.tools.build:gradle:7.3.0'
        classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
    }
}

rootProject.allprojects {
    repositories {
        google()
        jcenter()
    }
}

allprojects {
    gradle.projectsEvaluated {
        tasks.withType(JavaCompile) {
            options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
        }
    }
}

apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'

android {
    compileSdkVersion 31

    sourceSets {
        main.java.srcDirs += 'src/main/kotlin'
    }
    defaultConfig {
        minSdkVersion 16
    }
    lintOptions {
        disable 'InvalidPackage'
    }
}

dependencies {
    implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
}
liujiakuoyx commented 1 year ago

Please use the latest version 1.1.0 or 'https://github.com/XERZES27/leak_detector.git'