diff --git a/android/app/build.gradle b/android/app/build.gradle index 708cd4416..85c96b8f2 100644 --- a/android/app/build.gradle +++ b/android/app/build.gradle @@ -1,3 +1,9 @@ +plugins { + id "com.android.application" + id "kotlin-android" + id "dev.flutter.flutter-gradle-plugin" +} + def localProperties = new Properties() def localPropertiesFile = rootProject.file('local.properties') if (localPropertiesFile.exists()) { @@ -6,12 +12,6 @@ if (localPropertiesFile.exists()) { } } -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' @@ -22,10 +22,6 @@ if (flutterVersionName == null) { flutterVersionName = '1.0' } -apply plugin: 'com.android.application' -apply plugin: 'kotlin-android' -apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle" - def keystorePropertiesFile = rootProject.file("app/key.properties") def keystoreProperties = new Properties() keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) @@ -33,10 +29,6 @@ keystoreProperties.load(new FileInputStream(keystorePropertiesFile)) android { compileSdkVersion 34 - lintOptions { - disable 'InvalidPackage' - } - defaultConfig { applicationId "com.weilu.deer" minSdkVersion 21 @@ -73,8 +65,12 @@ android { } compileOptions { - sourceCompatibility JavaVersion.VERSION_11 - targetCompatibility JavaVersion.VERSION_11 + sourceCompatibility JavaVersion.VERSION_17 + targetCompatibility JavaVersion.VERSION_17 + } + namespace 'com.weilu.deer' + lint { + disable 'InvalidPackage' } } @@ -83,5 +79,5 @@ flutter { } dependencies { - implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version" + implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:1.8.20" } diff --git a/android/app/src/debug/AndroidManifest.xml b/android/app/src/debug/AndroidManifest.xml index a0b1e604d..f880684a6 100644 --- a/android/app/src/debug/AndroidManifest.xml +++ b/android/app/src/debug/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/main/AndroidManifest.xml b/android/app/src/main/AndroidManifest.xml index 5be7b7226..c8c9a64bc 100644 --- a/android/app/src/main/AndroidManifest.xml +++ b/android/app/src/main/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/app/src/profile/AndroidManifest.xml b/android/app/src/profile/AndroidManifest.xml index a0b1e604d..f880684a6 100644 --- a/android/app/src/profile/AndroidManifest.xml +++ b/android/app/src/profile/AndroidManifest.xml @@ -1,5 +1,4 @@ - + diff --git a/android/build.gradle b/android/build.gradle index 0803b627b..97cc06256 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -1,21 +1,3 @@ -buildscript { - ext.kotlin_version = '1.7.0' - repositories { - maven { url 'https://maven.aliyun.com/repository/public' }//jcenter - maven { url 'https://maven.aliyun.com/repository/gradle-plugin' }//gradle-plugin - maven { url 'https://maven.aliyun.com/repository/central' }//central - maven { url 'https://maven.aliyun.com/repository/google' }//google - google() - mavenCentral() - maven { url 'https://jitpack.io' } - } - - dependencies { - classpath 'com.android.tools.build:gradle:7.4.2' - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version" - } -} - allprojects { repositories { maven { url 'https://maven.aliyun.com/repository/public' } diff --git a/android/gradle.properties b/android/gradle.properties index 1d37174d4..9e2da5c9f 100644 --- a/android/gradle.properties +++ b/android/gradle.properties @@ -15,4 +15,7 @@ kotlin.incremental=true kotlin.incremental.java=true kotlin.incremental.js=true kotlin.caching.enabled=true -kotlin.parallel.tasks.in.project=true \ No newline at end of file +kotlin.parallel.tasks.in.project=true +android.defaults.buildfeatures.buildconfig=true +android.nonTransitiveRClass=false +android.nonFinalResIds=false \ No newline at end of file diff --git a/android/gradle/wrapper/gradle-wrapper.properties b/android/gradle/wrapper/gradle-wrapper.properties index 5f1c90e67..a54cb9990 100644 --- a/android/gradle/wrapper/gradle-wrapper.properties +++ b/android/gradle/wrapper/gradle-wrapper.properties @@ -1,6 +1,6 @@ -#Sun Sep 13 21:08:20 CST 2020 +#Sat Nov 23 15:18:48 CST 2024 distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists +distributionUrl=https\://services.gradle.org/distributions/gradle-8.5-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.5-bin.zip diff --git a/android/settings.gradle b/android/settings.gradle index 5a2f14fb1..eb5952e55 100644 --- a/android/settings.gradle +++ b/android/settings.gradle @@ -1,15 +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 flutterProjectRoot = rootProject.projectDir.parentFile.toPath() + includeBuild("$flutterSdkPath/packages/flutter_tools/gradle") -def plugins = new Properties() -def pluginsFile = new File(flutterProjectRoot.toFile(), '.flutter-plugins') -if (pluginsFile.exists()) { - pluginsFile.withReader('UTF-8') { reader -> plugins.load(reader) } + repositories { + google() + mavenCentral() + gradlePluginPortal() + } } -plugins.each { name, path -> - def pluginDirectory = flutterProjectRoot.resolve(path).resolve('android').toFile() - include ":$name" - project(":$name").projectDir = pluginDirectory +plugins { + id "dev.flutter.flutter-plugin-loader" version "1.0.0" + id "com.android.application" version "8.3.1" apply false + id "org.jetbrains.kotlin.android" version "1.8.20" apply false } + +include ":app" \ No newline at end of file diff --git a/pubspec.yaml b/pubspec.yaml index b5ae63ce5..be74a1833 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -54,30 +54,30 @@ dependencies: # 状态管理 https://github.com/rrousselGit/provider provider: ^6.1.2 # 扫码 https://github.com/juliuscanute/qr_code_scanner - qr_code_scanner: 1.0.0 - # git: - # url: https://github.com/xeinebiu/qr_code_scanner.git - # ref: fix_break_changes_platform + qr_code_scanner: + git: + url: 'https://github.com/NeverOvO/qr_code_scanner.git' + ref: '3fe7b88' # App Shortcuts https://github.com/flutter/packages/tree/main/packages/quick_actions quick_actions: 1.0.7 # 振动 https://github.com/benjamindean/flutter_vibration vibration: 2.0.0 vibration_web: 1.6.8 # 获取当前设备信息 https://github.com/fluttercommunity/plus_plugins/tree/main/packages/device_info_plus - device_info_plus: 10.0.1 + device_info_plus: 11.1.1 # 桌面应用调整窗口的大小和位置 https://github.com/leanflutter/window_manager window_manager: 0.4.0 # 高德2D地图插件(支持Web) https://github.com/simplezhli/flutter_2d_amap flutter_2d_amap: git: - ref: '3850a4dc' + ref: '0105ceae' url: 'https://github.com/simplezhli/flutter_2d_amap.git' # demo 用到的库 # 刮刮卡 https://github.com/vintage/scratcher scratcher: ^2.5.0 # 动画效果 https://github.com/xvrh/lottie-flutter lottie: ^3.1.2 - win32: 5.5.1 + win32: 5.5.3 # https://github.com/simplezhli/flutter_deer/issues/187 dependency_overrides: