diff --git a/.github/FUNDING.yml b/.github/FUNDING.yml
index cb2bfb1..b2e914f 100644
--- a/.github/FUNDING.yml
+++ b/.github/FUNDING.yml
@@ -1 +1 @@
-liberapay: lijy91
+github: lijy91
diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml
deleted file mode 100644
index 11cda0d..0000000
--- a/.github/workflows/test.yml
+++ /dev/null
@@ -1,21 +0,0 @@
-name: test
-
-on:
- push:
- branches: [main]
- pull_request:
- branches: [main]
-
-jobs:
- coverage:
- name: test
- runs-on: ubuntu-22.04
- steps:
- - uses: actions/checkout@v3
- - uses: subosito/flutter-action@v2
- with:
- channel: "stable"
- - run: flutter test --coverage
- - uses: codecov/codecov-action@v3
- with:
- token: ${{secrets.CODECOV_TOKEN}}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 9af5817..29f9874 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,3 +1,7 @@
+## 0.3.0
+
+* [android] Issue building with gradle version >= 8.x.x #16
+
## 0.2.1
* Updates minimum supported SDK version to Flutter 3.3/Dart 3.0.
diff --git a/analysis_options.yaml b/analysis_options.yaml
index 095b1d6..9033bb2 100644
--- a/analysis_options.yaml
+++ b/analysis_options.yaml
@@ -1 +1 @@
-include: package:mostly_reasonable_lints/flutter.yaml
+include: package:mostly_reasonable_lints/analysis_options.yaml
diff --git a/android/build.gradle b/android/build.gradle
index e82592b..4996271 100644
--- a/android/build.gradle
+++ b/android/build.gradle
@@ -25,6 +25,7 @@ apply plugin: 'com.android.library'
apply plugin: 'kotlin-android'
android {
+ namespace 'dev.leanflutter.plugins.clipboard_watcher'
compileSdkVersion 33
compileOptions {
diff --git a/android/src/main/AndroidManifest.xml b/android/src/main/AndroidManifest.xml
index e7c2f23..d527c75 100644
--- a/android/src/main/AndroidManifest.xml
+++ b/android/src/main/AndroidManifest.xml
@@ -1,2 +1,2 @@
-
+
diff --git a/example/.metadata b/example/.metadata
index 0a999ee..c689480 100644
--- a/example/.metadata
+++ b/example/.metadata
@@ -4,7 +4,27 @@
# This file should be version controlled and should not be manually edited.
version:
- revision: db747aa1331bd95bc9b3874c842261ca2d302cd5
- channel: stable
+ revision: "2663184aa79047d0a33a14a3b607954f8fdd8730"
+ channel: "stable"
project_type: app
+
+# Tracks metadata for the flutter migrate command
+migration:
+ platforms:
+ - platform: root
+ create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
+ base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
+ - platform: android
+ create_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
+ base_revision: 2663184aa79047d0a33a14a3b607954f8fdd8730
+
+ # User provided section
+
+ # List of Local paths (relative to this file) that should be
+ # ignored by the migrate tool.
+ #
+ # Files that are not part of the templates will be ignored by default.
+ unmanaged_files:
+ - 'lib/main.dart'
+ - 'ios/Runner.xcodeproj/project.pbxproj'
diff --git a/example/android/.gitignore b/example/android/.gitignore
index 6f56801..55afd91 100644
--- a/example/android/.gitignore
+++ b/example/android/.gitignore
@@ -7,7 +7,7 @@ gradle-wrapper.jar
GeneratedPluginRegistrant.java
# Remember to never publicly share your keystore.
-# See https://flutter.dev/docs/deployment/android#reference-the-keystore-from-the-app
+# See https://flutter.dev/to/reference-keystore
key.properties
**/*.keystore
**/*.jks
diff --git a/example/android/app/build.gradle b/example/android/app/build.gradle
index fc9f070..d63c2d0 100644
--- a/example/android/app/build.gradle
+++ b/example/android/app/build.gradle
@@ -1,71 +1,44 @@
-def localProperties = new Properties()
-def localPropertiesFile = rootProject.file('local.properties')
-if (localPropertiesFile.exists()) {
- localPropertiesFile.withReader('UTF-8') { reader ->
- localProperties.load(reader)
- }
-}
-
-def flutterRoot = localProperties.getProperty('flutter.sdk')
-if (flutterRoot == null) {
- throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
-}
-
-def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
-if (flutterVersionCode == null) {
- flutterVersionCode = '1'
-}
-
-def flutterVersionName = localProperties.getProperty('flutter.versionName')
-if (flutterVersionName == null) {
- flutterVersionName = '1.0'
+plugins {
+ id "com.android.application"
+ id "kotlin-android"
+ // The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
+ id "dev.flutter.flutter-gradle-plugin"
}
-apply plugin: 'com.android.application'
-apply plugin: 'kotlin-android'
-apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
-
android {
- compileSdkVersion 33
- ndkVersion flutter.ndkVersion
+ namespace = "com.example.clipboard_watcher_example"
+ compileSdk = flutter.compileSdkVersion
+ ndkVersion = flutter.ndkVersion
compileOptions {
- sourceCompatibility JavaVersion.VERSION_1_8
- targetCompatibility JavaVersion.VERSION_1_8
+ sourceCompatibility = JavaVersion.VERSION_1_8
+ targetCompatibility = JavaVersion.VERSION_1_8
}
kotlinOptions {
- jvmTarget = '1.8'
- }
-
- sourceSets {
- main.java.srcDirs += 'src/main/kotlin'
+ jvmTarget = JavaVersion.VERSION_1_8
}
defaultConfig {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
- applicationId "com.example.clipboard_watcher_example"
+ applicationId = "com.example.clipboard_watcher_example"
// You can update the following values to match your application needs.
- // For more information, see: https://docs.flutter.dev/deployment/android#reviewing-the-build-configuration.
- minSdkVersion flutter.minSdkVersion
- targetSdkVersion flutter.targetSdkVersion
- versionCode flutterVersionCode.toInteger()
- versionName flutterVersionName
+ // 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 {
// TODO: Add your own signing config for the release build.
// Signing with the debug keys for now, so `flutter run --release` works.
- signingConfig signingConfigs.debug
+ signingConfig = signingConfigs.debug
}
}
}
flutter {
- source '../..'
-}
-
-dependencies {
- implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
+ source = "../.."
}
diff --git a/example/android/app/src/debug/AndroidManifest.xml b/example/android/app/src/debug/AndroidManifest.xml
index 412c445..4fe6212 100644
--- a/example/android/app/src/debug/AndroidManifest.xml
+++ b/example/android/app/src/debug/AndroidManifest.xml
@@ -4,5 +4,5 @@
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
-
+
diff --git a/example/android/app/src/main/AndroidManifest.xml b/example/android/app/src/main/AndroidManifest.xml
index 43546d0..d9f2f24 100644
--- a/example/android/app/src/main/AndroidManifest.xml
+++ b/example/android/app/src/main/AndroidManifest.xml
@@ -1,28 +1,29 @@
-
+ android:icon="@mipmap/ic_launcher"
+ android:label="example">
+ android:name="io.flutter.embedding.android.NormalTheme"
+ android:resource="@style/NormalTheme" />
-
-
+
+
+
+
+
+
+
+
diff --git a/example/android/app/src/main/kotlin/com/example/clipboard_watcher_example/MainActivity.kt b/example/android/app/src/main/kotlin/com/example/clipboard_watcher_example/MainActivity.kt
index 680b285..52c84d0 100644
--- a/example/android/app/src/main/kotlin/com/example/clipboard_watcher_example/MainActivity.kt
+++ b/example/android/app/src/main/kotlin/com/example/clipboard_watcher_example/MainActivity.kt
@@ -2,5 +2,4 @@ package com.example.clipboard_watcher_example
import io.flutter.embedding.android.FlutterActivity
-class MainActivity: FlutterActivity() {
-}
+class MainActivity: FlutterActivity()
diff --git a/example/android/app/src/profile/AndroidManifest.xml b/example/android/app/src/profile/AndroidManifest.xml
index 412c445..4fe6212 100644
--- a/example/android/app/src/profile/AndroidManifest.xml
+++ b/example/android/app/src/profile/AndroidManifest.xml
@@ -4,5 +4,5 @@
the Flutter tool needs it to communicate with the running application
to allow setting breakpoints, to provide hot reload, etc.
-->
-
+
diff --git a/example/android/build.gradle b/example/android/build.gradle
index 3cdaac9..d2ffbff 100644
--- a/example/android/build.gradle
+++ b/example/android/build.gradle
@@ -1,16 +1,3 @@
-buildscript {
- ext.kotlin_version = '1.6.10'
- repositories {
- google()
- mavenCentral()
- }
-
- dependencies {
- classpath 'com.android.tools.build:gradle:7.1.2'
- classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
- }
-}
-
allprojects {
repositories {
google()
@@ -18,12 +5,12 @@ allprojects {
}
}
-rootProject.buildDir = '../build'
+rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
- project.evaluationDependsOn(':app')
+ project.evaluationDependsOn(":app")
}
tasks.register("clean", Delete) {
diff --git a/example/android/gradle.properties b/example/android/gradle.properties
index 94adc3a..2597170 100644
--- a/example/android/gradle.properties
+++ b/example/android/gradle.properties
@@ -1,3 +1,3 @@
-org.gradle.jvmargs=-Xmx1536M
+org.gradle.jvmargs=-Xmx4G -XX:MaxMetaspaceSize=2G -XX:+HeapDumpOnOutOfMemoryError
android.useAndroidX=true
android.enableJetifier=true
diff --git a/example/android/gradle/wrapper/gradle-wrapper.properties b/example/android/gradle/wrapper/gradle-wrapper.properties
index cb24abd..7bb2df6 100644
--- a/example/android/gradle/wrapper/gradle-wrapper.properties
+++ b/example/android/gradle/wrapper/gradle-wrapper.properties
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists
zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists
-distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-all.zip
+distributionUrl=https\://services.gradle.org/distributions/gradle-8.3-all.zip
diff --git a/example/android/settings.gradle b/example/android/settings.gradle
index 44e62bc..b9e43bd 100644
--- a/example/android/settings.gradle
+++ b/example/android/settings.gradle
@@ -1,11 +1,25 @@
-include ':app'
+pluginManagement {
+ def flutterSdkPath = {
+ def properties = new Properties()
+ file("local.properties").withInputStream { properties.load(it) }
+ def flutterSdkPath = properties.getProperty("flutter.sdk")
+ assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
+ return flutterSdkPath
+ }()
-def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
-def properties = new Properties()
+ includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
-assert localPropertiesFile.exists()
-localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
+ repositories {
+ google()
+ mavenCentral()
+ gradlePluginPortal()
+ }
+}
-def flutterSdkPath = properties.getProperty("flutter.sdk")
-assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
-apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
+plugins {
+ id "dev.flutter.flutter-plugin-loader" version "1.0.0"
+ id "com.android.application" version "8.1.0" apply false
+ id "org.jetbrains.kotlin.android" version "1.8.22" apply false
+}
+
+include ":app"
diff --git a/example/ios/Runner.xcodeproj/project.pbxproj b/example/ios/Runner.xcodeproj/project.pbxproj
index e149b28..4914a67 100644
--- a/example/ios/Runner.xcodeproj/project.pbxproj
+++ b/example/ios/Runner.xcodeproj/project.pbxproj
@@ -156,7 +156,7 @@
97C146E61CF9000F007C117D /* Project object */ = {
isa = PBXProject;
attributes = {
- LastUpgradeCheck = 1430;
+ LastUpgradeCheck = 1510;
ORGANIZATIONNAME = "";
TargetAttributes = {
97C146ED1CF9000F007C117D = {
diff --git a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
index a6b826d..5e31d3d 100644
--- a/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
+++ b/example/ios/Runner.xcodeproj/xcshareddata/xcschemes/Runner.xcscheme
@@ -1,6 +1,6 @@
=3.2.0-194.0.dev <4.0.0"
- flutter: ">=3.3.0"
+ dart: ">=3.3.0 <4.0.0"
+ flutter: ">=3.18.0-18.0.pre.54"
diff --git a/pubspec.yaml b/pubspec.yaml
index 6c7abb4..6d295e8 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -1,6 +1,6 @@
name: clipboard_watcher
description: This plugin allows Flutter apps to watch clipboard changes.
-version: 0.2.1
+version: 0.3.0
homepage: https://github.com/leanflutter/clipboard_watcher
platforms:
@@ -20,9 +20,9 @@ dependencies:
dev_dependencies:
dependency_validator: ^3.2.3
- flutter_test:
- sdk: flutter
- mostly_reasonable_lints: ^0.1.1
+ # flutter_test:
+ # sdk: flutter
+ mostly_reasonable_lints: ^0.1.2
flutter:
plugin: