Skip to content

Commit f5bd1ad

Browse files
authored
Merge pull request #176 from hamzamirai/master
Update Flutter and Dependencies, Fix Gradle Issues
2 parents 201e4de + c168511 commit f5bd1ad

File tree

11 files changed

+213
-142
lines changed

11 files changed

+213
-142
lines changed

android/build.gradle

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,16 @@
1-
group 'com.pusher'
1+
group 'com.pusher.channels_flutter'
2+
//group 'com.pusher'
23
version '1.0-SNAPSHOT'
34

45
buildscript {
5-
ext.kotlin_version = '1.7.10'
6+
ext.kotlin_version = '1.9.10'
67
repositories {
78
google()
89
mavenCentral()
910
}
1011

1112
dependencies {
12-
classpath 'com.android.tools.build:gradle:7.3.0'
13+
classpath 'com.android.tools.build:gradle:8.7.0'
1314
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
1415
}
1516
}
@@ -25,15 +26,19 @@ apply plugin: 'com.android.library'
2526
apply plugin: 'kotlin-android'
2627

2728
android {
28-
compileSdkVersion 30
29+
if (project.android.hasProperty("namespace")) {
30+
namespace = "com.pusher.channels_flutter"
31+
}
32+
33+
compileSdkVersion 34
2934

3035
compileOptions {
31-
sourceCompatibility JavaVersion.VERSION_1_8
32-
targetCompatibility JavaVersion.VERSION_1_8
36+
sourceCompatibility JavaVersion.VERSION_11
37+
targetCompatibility JavaVersion.VERSION_11
3338
}
3439

3540
kotlinOptions {
36-
jvmTarget = '1.8'
41+
jvmTarget = '11'
3742
}
3843

3944
sourceSets {

android/gradle/wrapper/gradle-wrapper.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,4 @@ distributionBase=GRADLE_USER_HOME
22
distributionPath=wrapper/dists
33
zipStoreBase=GRADLE_USER_HOME
44
zipStorePath=wrapper/dists
5-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip

android/src/main/AndroidManifest.xml

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,2 @@
11
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.pusher.channels_flutter">
3-
</manifest>
2+
package="com.pusher.channels_flutter"></manifest>

example/android/app/build.gradle

Lines changed: 17 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,11 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
// The Flutter Gradle Plugin must be applied after the Android and Kotlin Gradle plugins.
5+
id "dev.flutter.flutter-gradle-plugin"
6+
}
7+
8+
19
def localProperties = new Properties()
210
def localPropertiesFile = rootProject.file('local.properties')
311
if (localPropertiesFile.exists()) {
@@ -21,12 +29,10 @@ if (flutterVersionName == null) {
2129
flutterVersionName = '1.0'
2230
}
2331

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2832
android {
29-
compileSdkVersion 31
33+
namespace = "com.pusher.channels_flutter_example"
34+
compileSdk = flutter.compileSdkVersion
35+
ndkVersion = "27.0.12077973"
3036

3137
compileOptions {
3238
sourceCompatibility JavaVersion.VERSION_11
@@ -43,26 +49,25 @@ android {
4349

4450
defaultConfig {
4551
applicationId "com.pusher.channels_flutter_example"
46-
minSdkVersion 16
47-
targetSdkVersion 31
48-
versionCode flutterVersionCode.toInteger()
49-
versionName flutterVersionName
52+
minSdk = flutter.minSdkVersion
53+
targetSdk = flutter.targetSdkVersion
54+
versionCode = flutter.versionCode
55+
versionName = flutter.versionName
5056
}
5157

5258
buildTypes {
5359
release {
54-
// TODO: Add your own signing config for the release build.
5560
// Signing with the debug keys for now, so `flutter run --release` works.
5661
signingConfig signingConfigs.debug
5762
}
5863
}
59-
buildToolsVersion '33.0.0'
64+
6065
}
6166

6267
flutter {
6368
source '../..'
6469
}
6570

6671
dependencies {
67-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
72+
6873
}

example/android/build.gradle

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,6 @@ subprojects {
2424
project.evaluationDependsOn(':app')
2525
}
2626

27-
task clean(type: Delete) {
27+
tasks.register("clean", Delete) {
2828
delete rootProject.buildDir
2929
}
Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
1-
#Tue Sep 20 09:27:18 CEST 2022
21
distributionBase=GRADLE_USER_HOME
3-
distributionUrl=https\://services.gradle.org/distributions/gradle-7.4-bin.zip
42
distributionPath=wrapper/dists
5-
zipStorePath=wrapper/dists
63
zipStoreBase=GRADLE_USER_HOME
4+
zipStorePath=wrapper/dists
5+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.9-all.zip

example/android/settings.gradle

Lines changed: 22 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,25 @@
1-
include ':app'
1+
pluginManagement {
2+
def flutterSdkPath = {
3+
def properties = new Properties()
4+
file("local.properties").withInputStream { properties.load(it) }
5+
def flutterSdkPath = properties.getProperty("flutter.sdk")
6+
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
7+
return flutterSdkPath
8+
}()
29

3-
def localPropertiesFile = new File(rootProject.projectDir, "local.properties")
4-
def properties = new Properties()
10+
includeBuild("$flutterSdkPath/packages/flutter_tools/gradle")
511

6-
assert localPropertiesFile.exists()
7-
localPropertiesFile.withReader("UTF-8") { reader -> properties.load(reader) }
12+
repositories {
13+
google()
14+
mavenCentral()
15+
gradlePluginPortal()
16+
}
17+
}
818

9-
def flutterSdkPath = properties.getProperty("flutter.sdk")
10-
assert flutterSdkPath != null, "flutter.sdk not set in local.properties"
11-
apply from: "$flutterSdkPath/packages/flutter_tools/gradle/app_plugin_loader.gradle"
19+
plugins {
20+
id "dev.flutter.flutter-plugin-loader" version "1.0.0"
21+
id "com.android.application" version '8.7.0' apply false
22+
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
23+
}
24+
25+
include ":app"

0 commit comments

Comments
 (0)