Skip to content

Commit 18d6add

Browse files
authored
Release/4.0.0 beta3 (#20): Fix room dependency
## Fixed - Fix Database opening by upgrading Room library dependency
1 parent b986478 commit 18d6add

16 files changed

Lines changed: 150 additions & 162 deletions

File tree

app/build.gradle

Lines changed: 19 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,13 @@
11
apply plugin: 'com.android.application'
22
apply plugin: 'kotlin-android'
3+
apply plugin: "org.jetbrains.kotlin.plugin.compose"
34

45
def keystorePropertiesFile= project.file("keystore.properties")
56
def keystoreProperties = new Properties()
67
keystoreProperties.load(new FileInputStream(keystorePropertiesFile))
78

89
android {
9-
compileSdk 34
10+
compileSdk 36
1011
signingConfigs {
1112
release {
1213
keyAlias keystoreProperties['RELEASE_KEY_ALIAS']
@@ -26,7 +27,7 @@ android {
2627

2728
applicationId "com.abtasty.flagshipqa"
2829
minSdkVersion 21
29-
targetSdk 34
30+
targetSdk 36
3031
versionCode 1
3132
versionName "1.0"
3233
multiDexEnabled true
@@ -48,11 +49,11 @@ android {
4849
}
4950
}
5051
compileOptions {
51-
sourceCompatibility JavaVersion.VERSION_1_8
52-
targetCompatibility JavaVersion.VERSION_1_8
52+
sourceCompatibility JavaVersion.VERSION_17
53+
targetCompatibility JavaVersion.VERSION_17
5354
}
5455
kotlinOptions {
55-
jvmTarget = '1.8'
56+
jvmTarget = "17"
5657
}
5758

5859
namespace 'com.abtasty.flagshipqa'
@@ -70,29 +71,29 @@ dependencies {
7071
implementation fileTree(dir: "libs", include: ["*.jar"])
7172

7273
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
73-
implementation 'androidx.core:core-ktx:1.12.0'
74-
implementation 'androidx.appcompat:appcompat:1.6.1'
75-
implementation 'com.google.android.material:material:1.10.0'
76-
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
77-
implementation 'androidx.navigation:navigation-fragment-ktx:2.7.4'
78-
implementation 'androidx.navigation:navigation-ui-ktx:2.7.4'
74+
implementation 'androidx.core:core-ktx:1.17.0'
75+
implementation 'androidx.appcompat:appcompat:1.7.1'
76+
implementation 'com.google.android.material:material:1.13.0'
77+
implementation 'androidx.constraintlayout:constraintlayout:2.2.1'
78+
implementation 'androidx.navigation:navigation-fragment-ktx:2.9.4'
79+
implementation 'androidx.navigation:navigation-ui-ktx:2.9.4'
7980
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
80-
implementation "org.jetbrains.kotlin:kotlin-reflect:1.9.10"
81+
implementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
8182

8283
implementation project(path: ':flagship')
83-
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.8.7'
84-
implementation 'androidx.activity:activity-compose:1.8.0'
85-
implementation platform('androidx.compose:compose-bom:2024.04.01')
84+
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.9.4'
85+
implementation 'androidx.activity:activity-compose:1.11.0'
86+
implementation platform('androidx.compose:compose-bom:2025.09.00')
8687
implementation 'androidx.compose.ui:ui'
8788
implementation 'androidx.compose.ui:ui-graphics'
8889
implementation 'androidx.compose.ui:ui-tooling-preview'
8990
implementation 'androidx.compose.material3:material3'//Use local project
9091
// implementation 'com.abtasty:flagship-android:4.0.0' //Use remote maven repository
9192

9293
testImplementation 'junit:junit:4.13.2'
93-
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
94-
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
95-
androidTestImplementation platform('androidx.compose:compose-bom:2024.04.01')
94+
androidTestImplementation 'androidx.test.ext:junit:1.3.0'
95+
androidTestImplementation 'androidx.test.espresso:espresso-core:3.7.0'
96+
androidTestImplementation platform('androidx.compose:compose-bom:2025.09.00')
9697
androidTestImplementation 'androidx.compose.ui:ui-test-junit4'
9798
debugImplementation 'androidx.compose.ui:ui-tooling'
9899
debugImplementation 'androidx.compose.ui:ui-test-manifest'

app/src/main/java/com/abtasty/flagshipqa/MainActivity.kt

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,8 @@ import com.google.android.material.bottomnavigation.BottomNavigationView
1010

1111
class MainActivity : AppCompatActivity() {
1212

13+
var cnt = 0
14+
1315
override fun onCreate(savedInstanceState: Bundle?) {
1416
super.onCreate(savedInstanceState)
1517
setContentView(R.layout.activity_main)
@@ -34,7 +36,10 @@ class MainActivity : AppCompatActivity() {
3436

3537
override fun onResume() {
3638
super.onResume()
37-
// val intent = Intent(this, MainActivity3::class.java)
38-
// startActivity(intent)
39+
//// if (cnt % 2 == 0) {
40+
// val intent = Intent(this, MainActivity3::class.java)
41+
// startActivity(intent)
42+
// cnt++
43+
//// }
3944
}
4045
}

app/src/main/java/com/abtasty/flagshipqa/MainActivity3.kt

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,14 @@ import androidx.compose.ui.tooling.preview.Preview
3333
import com.abtasty.flagship.main.Flagship
3434
import com.abtasty.flagship.main.FlagshipConfig
3535
import com.abtasty.flagshipqa.ui.theme.FlagshipandroidTheme
36+
import kotlinx.coroutines.CancellationException
3637
import kotlinx.coroutines.CoroutineScope
3738
import kotlinx.coroutines.Dispatchers
3839
import kotlinx.coroutines.async
40+
import kotlinx.coroutines.cancel
3941
import kotlinx.coroutines.delay
42+
import kotlinx.coroutines.ensureActive
43+
import kotlinx.coroutines.isActive
4044

4145

4246
class MainActivity3 : ComponentActivity() {
@@ -49,16 +53,17 @@ class MainActivity3 : ComponentActivity() {
4953
val callbackWrapper: WindowCallback = WindowCallback(windowCallback)
5054
window.callback = callbackWrapper
5155

52-
// CoroutineScope(Dispatchers.Default).async {
53-
// delay(5000)
56+
CoroutineScope(Dispatchers.IO).async {
57+
println("isActive: ${this.isActive}")
5458
Flagship.start(
5559
application,
5660
"",
5761
"",
58-
FlagshipConfig.DecisionApi()
59-
)
60-
61-
// }
62+
FlagshipConfig.Bucketing()
63+
.withFlagshipStatusListener { status -> println("NEW STATUS = " + status) }
64+
).await()
65+
println("END OF START \$status = " + Flagship.getStatus())
66+
}
6267
enableEdgeToEdge()
6368
setContent {
6469
FlagshipandroidTheme {
@@ -76,8 +81,9 @@ class MainActivity3 : ComponentActivity() {
7681
super.onResume()
7782

7883
Flagship.runOnFlagshipIsInitialized {
79-
val visitor = Flagship.newVisitor("toto_89edfe742qesq", true).build()
84+
val visitor = Flagship.newVisitor("t9BKJZGJDIe62NKSCFs", true).build()
8085
visitor.collectEmotionsAIEvents(this@MainActivity3)
86+
visitor.fetchFlags()
8187
}
8288
}
8389
}

app/src/main/java/com/abtasty/flagshipqa/ui/modifications/ModificationViewModel.kt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@ package com.abtasty.flagshipqa.ui.modifications
22

33
import android.app.Application
44
import android.widget.Toast
5+
import androidx.compose.ui.text.intl.Locale
56
import androidx.lifecycle.AndroidViewModel
67
import androidx.lifecycle.MutableLiveData
78
import com.abtasty.flagship.main.Flagship
@@ -59,7 +60,7 @@ class ModificationViewModel(val appContext: Application) : AndroidViewModel(appC
5960
return when (type) {
6061
"Null" -> null
6162
"String" -> default
62-
"Boolean" -> default.toLowerCase().toBoolean()
63+
"Boolean" -> default.lowercase().toBoolean()
6364
"Number" -> {
6465
try {
6566
default.toInt()

build.gradle

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
buildscript {
22

33
ext {
4-
kotlin_version = '1.9.25'
4+
kotlin_version = '2.2.20'
55
maven_artifact_id = "flagship-android"
66
maven_repo = "flagship-android"
77
maven_group_id = "com.abtasty"
@@ -10,24 +10,24 @@ buildscript {
1010
if (!maven_variant.isEmpty()) {
1111
maven_artifact_id = maven_artifact_id + '-' + maven_variant
1212
}
13-
flagship_version_name = System.getenv('FLAGSHIP_VERSION_NAME') ?: "4.0.0-beta2"
14-
flagship_version_code = System.getenv('FLAGSHIP_VERSION_CODE') ?: 21
13+
flagship_version_name = System.getenv('FLAGSHIP_VERSION_NAME') ?: "4.0.0-beta3"
14+
flagship_version_code = System.getenv('FLAGSHIP_VERSION_CODE') ?: 24
1515
}
1616

1717
repositories {
1818
google()
1919
mavenCentral()
2020
}
2121
dependencies {
22-
classpath 'com.android.tools.build:gradle:8.5.2'
22+
classpath 'com.android.tools.build:gradle:8.12.3'
2323
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
24-
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.16"
25-
// classpath "io.github.gradle-nexus:publish-plugin:1.3.0"
24+
classpath "org.jetbrains.dokka:dokka-android-gradle-plugin:0.9.18"
25+
classpath "org.jetbrains.kotlin.plugin.compose:org.jetbrains.kotlin.plugin.compose.gradle.plugin:$kotlin_version"
2626
}
2727
}
2828

2929
plugins {
30-
id 'com.google.devtools.ksp' version '1.9.25-1.0.20' apply false
30+
id 'com.google.devtools.ksp' version '2.2.20-2.0.3' apply false
3131
id("io.github.gradle-nexus.publish-plugin") version "1.3.0"
3232
id 'org.jetbrains.kotlin.android' version "$kotlin_version" apply false
3333
}

flagship/build.gradle

Lines changed: 18 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -1,26 +1,25 @@
1-
import com.vanniktech.maven.publish.SonatypeHost
21

32
plugins {
43
id 'com.android.library'
54
id 'kotlin-android'
65
id 'kotlin-parcelize'
76
id 'com.google.devtools.ksp'
8-
id 'com.vanniktech.maven.publish' version "0.30.0"
7+
id 'com.vanniktech.maven.publish' version "0.34.0"
98
id 'jacoco'
109
}
1110

1211
kotlin {
13-
jvmToolchain(11)
12+
jvmToolchain(17)
1413
}
1514

1615
android {
1716
namespace 'com.abtasty.flagship'
18-
compileSdk 34
17+
compileSdk 36
1918

2019
defaultConfig {
2120
minSdkVersion 21
22-
compileSdk 34
23-
targetSdkVersion 34
21+
compileSdk 36
22+
targetSdkVersion 36
2423

2524
ksp {
2625
arg("room.schemaLocation", "$projectDir/schemas".toString())
@@ -60,11 +59,11 @@ android {
6059
}
6160

6261
compileOptions {
63-
sourceCompatibility = JavaVersion.VERSION_1_8
64-
targetCompatibility = JavaVersion.VERSION_1_8
62+
sourceCompatibility = JavaVersion.VERSION_17
63+
targetCompatibility = JavaVersion.VERSION_17
6564
}
6665
kotlinOptions {
67-
jvmTarget = '1.8'
66+
jvmTarget = '17'
6867
}
6968

7069
android.libraryVariants.configureEach { variant ->
@@ -81,21 +80,19 @@ android {
8180
dependencies {
8281
implementation fileTree(dir: 'libs', include: ['*.jar'])
8382
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
84-
implementation 'androidx.room:room-runtime:2.6.1'
85-
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.9.0")
86-
implementation 'androidx.appcompat:appcompat:1.7.0'
83+
implementation 'androidx.room:room-runtime:2.7.2'
84+
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.10.2")
85+
implementation 'androidx.appcompat:appcompat:1.7.1'
8786

8887
testImplementation 'junit:junit:4.13.2'
89-
testImplementation 'androidx.test:core:1.6.1'
90-
testImplementation 'org.robolectric:robolectric:4.14.1'
88+
testImplementation 'androidx.test:core:1.7.0'
89+
testImplementation 'org.robolectric:robolectric:4.16'
9190
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlin_version"
92-
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.9.0"
93-
91+
testImplementation "org.jetbrains.kotlinx:kotlinx-coroutines-test:1.10.2"
9492
implementation 'com.squareup.okhttp3:okhttp:4.12.0'
95-
implementation 'androidx.lifecycle:lifecycle-process:2.8.7'
96-
97-
annotationProcessor("androidx.room:room-compiler:2.6.1")
98-
ksp 'androidx.room:room-compiler:2.6.1'
93+
implementation 'androidx.lifecycle:lifecycle-process:2.9.4'
94+
annotationProcessor("androidx.room:room-compiler:2.7.2")
95+
ksp 'androidx.room:room-compiler:2.7.2'
9996
}
10097

10198

@@ -106,12 +103,10 @@ repositories {
106103

107104

108105
mavenPublishing {
109-
publishToMavenCentral(SonatypeHost.CENTRAL_PORTAL)
110106

107+
// publishToMavenCentral("CENTRAL_PORTAL")
111108
signAllPublications()
112-
113109
coordinates(maven_group_id, maven_artifact_id, flagship_version_name)
114-
115110
pom {
116111
name = maven_artifact_id
117112
description = 'Visit https://developers.flagship.io/ to get started with Flagship.'

flagship/src/main/java/com/abtasty/flagship/api/HttpManager.kt

Lines changed: 14 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,21 @@ object HttpManager {
6262
}
6363

6464
private fun initThreadPoolExecutor() {
65-
workers = Runtime.getRuntime().availableProcessors() * 2
66-
threadPoolExecutor = ThreadPoolExecutor(
67-
workers, workers,
68-
workerTimeout, workerTimeoutUnit,
69-
LinkedBlockingQueue<Runnable>()
70-
) { r: Runnable? ->
71-
val t = Thread(r, "Flagship Worker")
72-
t.isDaemon = true
73-
t
65+
try {
66+
workers = Runtime.getRuntime().availableProcessors() * 2
67+
threadPoolExecutor = ThreadPoolExecutor(
68+
workers, workers,
69+
workerTimeout, workerTimeoutUnit,
70+
LinkedBlockingQueue<Runnable>()
71+
) { r: Runnable? ->
72+
val t = Thread(r, "Flagship Worker")
73+
t.isDaemon = true
74+
t
75+
}
76+
threadPoolExecutor?.allowCoreThreadTimeOut(true)
77+
} catch (e: Exception) {
78+
FlagshipLogManager.exception(FlagshipConstants.Exceptions.Companion.FlagshipException(e))
7479
}
75-
threadPoolExecutor?.allowCoreThreadTimeOut(true)
7680
}
7781

7882
private fun getTrustManagerFactory(): TrustManagerFactory {

0 commit comments

Comments
 (0)