Skip to content

Commit

Permalink
update gradle support 3.19
Browse files Browse the repository at this point in the history
  • Loading branch information
CarGuo committed Mar 5, 2024
1 parent 69dfe7e commit 1adf2a4
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 60 deletions.
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@

## 编译运行流程

1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.16**),可参阅 [【搭建环境】](https://flutterchina.club)
1、配置好Flutter开发环境(目前Flutter SDK 版本 **3.19**),可参阅 [【搭建环境】](https://flutterchina.club)

2、clone代码,执行`Packages get`安装第三方包。(因为某些不可抗力原因,国内可能需要设置代理: [代理环境变量](https://flutterchina.club/setup-windows/))

Expand All @@ -109,7 +109,7 @@

### 5、运行之前请注意下

>### 1、本地 Flutter SDK 版本 3.16 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)
>### 1、本地 Flutter SDK 版本 3.19 ; 2、是否执行过 `flutter pub get`;3、 网络等问题参考: [如果出现登陆失败或者请求失败 ](https://github.com/CarGuo/gsy_github_app_flutter/issues/643)

### 下载
Expand Down Expand Up @@ -153,7 +153,7 @@

### 第三方框架

>当前 Flutter SDK 版本 3.16
>当前 Flutter SDK 版本 3.19
|| 功能 |
| -------------------------- | -------------- |
Expand Down
6 changes: 3 additions & 3 deletions README_EN.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ With the use and feedback of the project, will user experience and function opti

### Operation instructions

1. Configure the Flutter development environment (Tag of the current version of Flutter SDK **3.16** ).
1. Configure the Flutter development environment (Tag of the current version of Flutter SDK **3.19** ).

2. Clone code, execute `Packages get'to install third-party packages.

Expand All @@ -68,7 +68,7 @@ With the use and feedback of the project, will user experience and function opti

4、Be careful

>### Local Flutter SDK version 3.16 or more. 2. Does the third-party package version in pubspec. yaml correspond to the third-party package version in pubspec. lock?
>### Local Flutter SDK version 3.19 or more. 2. Does the third-party package version in pubspec. yaml correspond to the third-party package version in pubspec. lock?
### Download

Expand Down Expand Up @@ -107,7 +107,7 @@ With the use and feedback of the project, will user experience and function opti

### Third-party framework

>Current Flutter SDK version **3.16**
>Current Flutter SDK version **3.19**
|| 功能 |
| -------------------------- | -------------- |
Expand Down
25 changes: 9 additions & 16 deletions android/app/build.gradle
Original file line number Diff line number Diff line change
@@ -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()) {
Expand All @@ -6,14 +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.")
}

apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
apply from: "exported.gradle"

android {
Expand All @@ -31,9 +29,9 @@ android {
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
applicationId "com.shuyu.gsygithub.gsygithubappflutter"
minSdkVersion 21
targetSdkVersion 31
targetSdkVersion 33
versionCode 54
versionName "4.0.1"
versionName "5.0.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}

Expand Down Expand Up @@ -70,9 +68,4 @@ flutter {
source '../..'
}

dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
}
dependencies {}
13 changes: 0 additions & 13 deletions android/build.gradle
Original file line number Diff line number Diff line change
@@ -1,16 +1,3 @@
buildscript {
ext.kotlin_version = '1.8.10'
repositories {
google()
jcenter()
}

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

allprojects {
repositories {
google()
Expand Down
30 changes: 20 additions & 10 deletions android/settings.gradle
Original file line number Diff line number Diff line change
@@ -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 "7.0.3" apply false
id "org.jetbrains.kotlin.android" version "1.8.10" apply false
}

include ":app"
22 changes: 7 additions & 15 deletions pubspec.lock
Original file line number Diff line number Diff line change
Expand Up @@ -557,18 +557,18 @@ packages:
dependency: transitive
description:
name: material_color_utilities
sha256: "9528f2f296073ff54cb9fee677df673ace1218163c3bc7628093e7eed5203d41"
sha256: "0e0a020085b65b6083975e499759762399b4475f766c21668c4ecca34ea74e5a"
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.5.0"
version: "0.8.0"
meta:
dependency: transitive
description:
name: meta
sha256: a6e590c838b18133bb482a2745ad77c5bb7715fb0451209e1a7567d416678b8e
sha256: d584fa6707a52763a52446f02cc621b077888fb63b93bbcb1143a7be5a0c0c04
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.10.0"
version: "1.11.0"
mime:
dependency: transitive
description:
Expand Down Expand Up @@ -629,10 +629,10 @@ packages:
dependency: transitive
description:
name: path
sha256: "8829d8a55c13fc0e37127c29fedf290c102f4e40ae94ada574091fe0ff96c917"
sha256: "087ce49c3f0dc39180befefc60fdb4acd8f8620e5682fe2476afd0b3688bb4af"
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.8.3"
version: "1.9.0"
path_parsing:
dependency: transitive
description:
Expand Down Expand Up @@ -1166,14 +1166,6 @@ packages:
url: "https://pub.flutter-io.cn"
source: hosted
version: "1.0.1"
web:
dependency: transitive
description:
name: web
sha256: afe077240a270dcfd2aafe77602b4113645af95d0ad31128cc02bce5ac5d5152
url: "https://pub.flutter-io.cn"
source: hosted
version: "0.3.0"
web_socket_channel:
dependency: transitive
description:
Expand Down Expand Up @@ -1255,5 +1247,5 @@ packages:
source: hosted
version: "3.1.0"
sdks:
dart: ">=3.2.0-194.0.dev <4.0.0"
dart: ">=3.2.0-0 <4.0.0"
flutter: ">=3.13.0"

0 comments on commit 1adf2a4

Please sign in to comment.