diff --git a/android/build.gradle b/android/build.gradle index ff1baa45..462db2d2 100644 --- a/android/build.gradle +++ b/android/build.gradle @@ -39,18 +39,14 @@ buildscript { ? rootProject.ext['kotlinVersion'] : rootProject.hasProperty('AsyncStorage_kotlinVersion') ? rootProject.properties['AsyncStorage_kotlinVersion'] - : '1.6.10' + : '1.8.10' repositories { mavenCentral() google() } dependencies { - def projectExampleDir = Paths.get(project.projectDir.getParent(), "example", "android").toString() - def rootProjectDir = rootProject.projectDir.getPath() - if (projectExampleDir == rootProjectDir) { - classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$asyncStorageKtVersion" - } + classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$asyncStorageKtVersion" } } @@ -78,10 +74,10 @@ if (useNextStorage) { } android { - compileSdkVersion safeExtGet('compileSdkVersion', 31) + compileSdkVersion safeExtGet('compileSdkVersion', 32) defaultConfig { - minSdkVersion safeExtGet('minSdkVersion', 21) - targetSdkVersion safeExtGet('targetSdkVersion', 31) + minSdkVersion safeExtGet('minSdkVersion', 23) + targetSdkVersion safeExtGet('targetSdkVersion', 32) buildConfigField "Long", "AsyncStorage_db_size", "${dbSizeInMB}L" buildConfigField "boolean", "AsyncStorage_useDedicatedExecutor", "${useDedicatedExecutor}" buildConfigField "boolean", "AsyncStorage_useNextStorage", "${useNextStorage}" @@ -112,9 +108,9 @@ repositories { dependencies { if (useNextStorage) { - def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.2') - def coroutines_version = "1.6.0" - def coroutinesTest_version = "1.6.0" + def room_version = getVersionOrDefault('AsyncStorage_next_roomVersion', '2.4.3') + def coroutines_version = "1.6.4" + def coroutinesTest_version = "1.6.4" // if we don't provide explicit dependency on reflection, kotlin plugin // would add one automatically, probably a version that is not compatible with // used kotlin diff --git a/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt b/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt index e8a0c419..c05f0181 100644 --- a/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt +++ b/android/src/main/java/com/reactnativecommunity/asyncstorage/next/StorageSupplier.kt @@ -105,7 +105,7 @@ private object MIGRATION_TO_NEXT : Migration(1, 2) { } } -@Database(entities = [Entry::class], version = DATABASE_VERSION, exportSchema = true) +@Database(entities = [Entry::class], version = DATABASE_VERSION, exportSchema = false) internal abstract class StorageDb : RoomDatabase() { abstract fun storage(): StorageDao diff --git a/example/android/gradle.properties b/example/android/gradle.properties index 6b1dc5a2..bc71f40c 100644 --- a/example/android/gradle.properties +++ b/example/android/gradle.properties @@ -42,7 +42,7 @@ android.enableJetifier=true #ANDROID_NDK_VERSION=21.4.7075529 # Version of Kotlin to build against. -KOTLIN_VERSION=1.6.21 +KOTLIN_VERSION=1.8.10 # This is an example of how you can change default DB size (6MB) to 10MB #AsyncStorage_db_size_in_MB=10 diff --git a/website/docs/advanced/Next.md b/website/docs/advanced/Next.md index b711c86f..b8d1b240 100644 --- a/website/docs/advanced/Next.md +++ b/website/docs/advanced/Next.md @@ -38,27 +38,7 @@ When you enable the feature again, the new database is **not** recreated, becaus ### Enable -See [Configuration](#configuration) section below to learn more about setting different versions of Kotlin or Room. - -1. In your project's `android` directory, locate root `build.gradle` file. Add Kotlin dependency to the `buildscript`: - -```diff -buildscript { - ext { - // other extensions -+ kotlinVersion = '1.6.10' - } - - dependencies { - // other dependencies -+ classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion" - } -} - -``` - -2. In the same directory (normally `android`) locate `gradle.properties` file (if it does not exist, create one) and add the line: - +In your project's `android` directory, locate `gradle.properties` file (if it does not exist, create one) and add the line: ```groovy AsyncStorage_useNextStorage=true ``` @@ -67,28 +47,28 @@ AsyncStorage_useNextStorage=true **Kotlin version** -Next storage is tested against Kotlin version `1.6.10`. +Next storage is tested against Kotlin version `1.8.10`. You can specify different version, in one of two ways: - add `kotlinVersion` extension to the `rootProject`: ```groovy -rootProject.ext.kotlinVersion = '1.6.10' +rootProject.ext.kotlinVersion = '1.8.10' ``` - specify `AsyncStorage_kotlinVersion` in `gradle.properties`: ```groovy -AsyncStorage_kotlinVersion=1.6.10 +AsyncStorage_kotlinVersion=1.8.10 ``` **Room** Next AsyncStorage uses [Room persistence library](https://developer.android.com/jetpack/androidx/releases/room) to store data. -Currently, tested version is `2.4.2`. You can specify different version, by adding a flag to `gradle.properties`: +Currently, tested version is `2.4.3`. You can specify different version, by adding a flag to `gradle.properties`: ```groovy -AsyncStorage_next_roomVersion=2.4.2 +AsyncStorage_next_roomVersion=2.4.3 ``` ### Notable changes