Skip to content

Commit 5e108e8

Browse files
authored
Merge pull request #107 from GetStream/fix/update-imessage-example
Update iMessage example
2 parents 90edc85 + 7b61bfd commit 5e108e8

File tree

14 files changed

+186
-141
lines changed

14 files changed

+186
-141
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@ gradlew.bat
3535
gradle-wrapper.jar
3636
.flutter-plugins-dependencies
3737
*.iml
38+
**/android/app/.cxx/
3839

3940
generated_plugin_registrant.dart
4041
GeneratedPluginRegistrant.h
Lines changed: 18 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
1+
plugins {
2+
id "com.android.application"
3+
id "kotlin-android"
4+
id "dev.flutter.flutter-gradle-plugin"
5+
}
6+
17
def localProperties = new Properties()
28
def localPropertiesFile = rootProject.file('local.properties')
39
if (localPropertiesFile.exists()) {
@@ -6,11 +12,6 @@ if (localPropertiesFile.exists()) {
612
}
713
}
814

9-
def flutterRoot = localProperties.getProperty('flutter.sdk')
10-
if (flutterRoot == null) {
11-
throw new GradleException("Flutter SDK not found. Define location with flutter.sdk in the local.properties file.")
12-
}
13-
1415
def flutterVersionCode = localProperties.getProperty('flutter.versionCode')
1516
if (flutterVersionCode == null) {
1617
flutterVersionCode = '1'
@@ -21,12 +22,17 @@ if (flutterVersionName == null) {
2122
flutterVersionName = '1.0'
2223
}
2324

24-
apply plugin: 'com.android.application'
25-
apply plugin: 'kotlin-android'
26-
apply from: "$flutterRoot/packages/flutter_tools/gradle/flutter.gradle"
27-
2825
android {
29-
compileSdkVersion 30
26+
namespace "com.example.imessage"
27+
compileSdkVersion 35
28+
29+
compileOptions {
30+
sourceCompatibility JavaVersion.VERSION_17
31+
targetCompatibility JavaVersion.VERSION_17
32+
}
33+
kotlinOptions {
34+
jvmTarget = '17'
35+
}
3036

3137
sourceSets {
3238
main.java.srcDirs += 'src/main/kotlin'
@@ -36,7 +42,7 @@ android {
3642
// TODO: Specify your own unique Application ID (https://developer.android.com/studio/build/application-id.html).
3743
applicationId "com.example.imessage"
3844
minSdkVersion 21
39-
targetSdkVersion 30
45+
targetSdkVersion 35
4046
versionCode flutterVersionCode.toInteger()
4147
versionName flutterVersionName
4248
}
@@ -52,8 +58,4 @@ android {
5258

5359
flutter {
5460
source '../..'
55-
}
56-
57-
dependencies {
58-
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
59-
}
61+
}

packages/imessage/android/app/src/main/AndroidManifest.xml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
1-
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
2-
package="com.example.imessage">
1+
<manifest xmlns:android="http://schemas.android.com/apk/res/android">
32
<application
43
android:label="imessage"
54
android:icon="@mipmap/ic_launcher">
@@ -9,6 +8,7 @@
98
android:theme="@style/LaunchTheme"
109
android:configChanges="orientation|keyboardHidden|keyboard|screenSize|smallestScreenSize|locale|layoutDirection|fontScale|screenLayout|density|uiMode"
1110
android:hardwareAccelerated="true"
11+
android:exported="true"
1212
android:windowSoftInputMode="adjustResize">
1313
<!-- Specifies an Android theme to apply to this Activity as soon as
1414
the Android process has started. This theme is visible to the user
Lines changed: 2 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,3 @@
1-
buildscript {
2-
ext.kotlin_version = '1.5.20'
3-
repositories {
4-
google()
5-
jcenter()
6-
}
7-
8-
dependencies {
9-
classpath 'com.android.tools.build:gradle:4.1.0'
10-
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
11-
}
12-
}
13-
141
allprojects {
152
repositories {
163
google()
@@ -26,6 +13,6 @@ subprojects {
2613
project.evaluationDependsOn(':app')
2714
}
2815

29-
task clean(type: Delete) {
30-
delete rootProject.buildDir
16+
tasks.register("clean", Delete) {
17+
delete rootProject.layout.buildDirectory
3118
}
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,3 @@
11
org.gradle.jvmargs=-Xmx1536M
22
android.useAndroidX=true
33
android.enableJetifier=true
4-
android.enableR8=true
Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
#Fri Jun 23 08:50:38 CEST 2017
1+
#Fri Feb 21 14:17:43 CET 2025
22
distributionBase=GRADLE_USER_HOME
33
distributionPath=wrapper/dists
4+
distributionUrl=https\://services.gradle.org/distributions/gradle-8.10.2-all.zip
45
zipStoreBase=GRADLE_USER_HOME
56
zipStorePath=wrapper/dists
6-
distributionUrl=https\://services.gradle.org/distributions/gradle-6.7-all.zip
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.8.1" apply false
22+
id "org.jetbrains.kotlin.android" version "1.9.10" apply false
23+
}
24+
25+
include ":app"

0 commit comments

Comments
 (0)