Kotlin Asynchronous Bluetooth Low-Energy

Overview

badge badge badge badge Slack

Kable

Kotlin Asynchronous Bluetooth Low Energy provides a simple Coroutines-powered API for interacting with Bluetooth Low Energy devices.

Usage is demonstrated with the SensorTag sample app.

Scanning

To scan for nearby peripherals, the Scanner provides an advertisements Flow which is a stream of Advertisement objects representing advertisements seen from nearby peripherals. Advertisement objects contain information such as the peripheral's name and RSSI (signal strength).

Scanning begins when the advertisements Flow is collected and stops when the Flow collection is terminated. A Flow terminal operator (such as first) may be used to scan until an advertisement is found that matches a desired predicate.

val advertisement = Scanner()
    .advertisements
    .first { it.name?.startsWith("Example") }

JavaScript: Scanning for nearby peripherals is supported, but only available on Chrome 79+ with "Experimental Web Platform features" enabled via: chrome://flags/#enable-experimental-web-platform-features

Peripheral

Once an Advertisement is obtained, it can be converted to a Peripheral via the CoroutineScope.peripheral extension function. Peripheral objects represent actions that can be performed against a remote peripheral, such as connection handling and I/O operations.

val peripheral = scope.peripheral(advertisement)

To configure a peripheral, options may be set in the builder lambda:

val peripheral = scope.peripheral(advertisement) {
    // Set peripheral configuration.
}

All platforms support an onServicesDiscovered action (that is executed after service discovery but before observations are wired up):

val peripheral = scope.peripheral(advertisement) {
    onServicesDiscovered {
        // Perform any desired I/O operations.
    }
}

Exceptions thrown in onServicesDiscovered are propagated to the Peripheral's connect call.

Android

On Android targets, additional configuration options are available (all configuration directives are optional):

val peripheral = scope.peripheral(advertisement) {
    onServicesDiscovered {
        requestMtu(...)
    }
    transport = Transport.Le // default
    phy = Phy.Le1M // default
}

JavaScript

On JavaScript, rather than processing a stream of advertisements, a specific peripheral can be requested using the CoroutineScope.requestPeripheral extension function. Criteria (Options) such as expected service UUIDs on the peripheral and/or the peripheral's name may be specified. When requestPeripheral is called with the specified options, the browser shows the user a list of peripherals matching the criteria. The peripheral chosen by the user is then returned (as a Peripheral object).

val options = Options(
    optionalServices = arrayOf(
        "f000aa80-0451-4000-b000-000000000000",
        "f000aa81-0451-4000-b000-000000000000"
    ),
    filters = arrayOf(
        NamePrefix("Example")
    )
)
val peripheral = scope.requestPeripheral(options).await()

Connectivity

Once a Peripheral object is acquired, a connection can be established via the connect function. The connect method suspends until a connection is established and ready (or a failure occurs). A connection is considered ready when connected, services have been discovered, and observations (if any) have been re-wired. Service discovery occurs automatically upon connection.

Multiple concurrent calls to connect will all suspend until connection is ready.

peripheral.connect()

To disconnect, the disconnect function will disconnect an active connection, or cancel an in-flight connection attempt. The disconnect function suspends until the peripheral has settled on a disconnected state.

peripheral.disconnect()

If the underlying subsystem fails to deliver the disconnected state then the disconnect call could potentially stall indefinitely. To prevent this (and ensure underlying resources are cleaned up in a timely manner) it is recommended that disconnect be wrapped with a timeout, for example:

// Allow 5 seconds for graceful disconnect before forcefully closing `Peripheral`.
withTimeoutOrNull(5_000L) {
    peripheral.disconnect()
}

State

The connection state of a Peripheral can be monitored via its state Flow.

peripheral.state.collect { state ->
    // Display and/or process the connection state.
}

The state will typically transition through the following States:

Connection states

Disconnecting state only occurs on Android platform. JavaScript and Apple-based platforms transition directly from Connected to Disconnected (upon calling disconnect function, or when a connection is dropped).

I/O

Bluetooth Low Energy devices are organized into a tree-like structure of services, characteristics and descriptors; whereas characteristics and descriptors have the capability of being read from, or written to.

For example, a peripheral might have the following structure:

  • Service S1 (00001815-0000-1000-8000-00805f9b34fb)
    • Characteristic C1
      • Descriptor D1
      • Descriptor D2
    • Characteristic C2 (00002a56-0000-1000-8000-00805f9b34fb)
      • Descriptor D3 (00002902-0000-1000-8000-00805f9b34fb)
  • Service S2
    • Characteristic C3

To access a characteristic or descriptor, use the charactisticOf or descriptorOf functions, respectively.

In the above example, to access "Descriptor D3":

val descriptor = descriptorOf(
    service = "00001815-0000-1000-8000-00805f9b34fb",
    characteristic = "00002a56-0000-1000-8000-00805f9b34fb",
    descriptor = "00002902-0000-1000-8000-00805f9b34fb"
)

Once connected, data can be read from, or written to, characteristics and/or descriptors via read and write functions.

The read and write functions throw NotReadyException until a connection is established.

val data = peripheral.read(characteristic)

peripheral.write(descriptor, byteArrayOf(1, 2, 3))

Observation

Bluetooth Low Energy provides the capability of subscribing to characteristic changes by means of notifications and/or indications, whereas a characteristic change on a connected peripheral is "pushed" to the central via a characteristic notification and/or indication which carries the new value of the characteristic.

Characteristic change notifications/indications can be observed/subscribed to via the observe function which returns a Flow of the new characteristic data.

val observation = peripheral.observe(characteristic)
observation.collect { data ->
    // Process data.
}

The observe function can be called (and its returned Flow can be collected) prior to a connection being established. Once a connection is established then characteristic changes will stream from the Flow. If the connection drops, the Flow will remain active, and upon reconnecting it will resume streaming characteristic changes.

Failures related to notifications/indications are propagated via the observe Flow, for example, if the associated characteristic is invalid or cannot be found, then a NoSuchElementException is propagated via the observe Flow.

In scenarios where an I/O operation needs to be performed upon subscribing to the observe Flow, an onSubscribe action may be specified:

val observation = peripheral.observe(characteristic) {
    // Perform desired I/O operations upon collecting from the `observe` Flow, for example:
    peripheral.write(descriptor, "ping".toByteArray())
}
observation.collect { data ->
    // Process data.
}

In the above example, "ping" will be written to the descriptor when:

  • Connection is established (while the returned Flow is active); and
  • After the observation is spun up (i.e. after enabling notifications or indications)

The onSubscription action is useful in situations where an initial operation is needed when starting an observation (such as writing a configuration to the peripheral and expecting the response to come back in the form of a characteristic change).

Structured Concurrency

Peripheral objects/connections are scoped to a Coroutine scope. When creating a Peripheral, the CoroutineScope.peripheral extension function is used, which scopes the returned Peripheral to the CoroutineScope receiver. If the CoroutineScope receiver is cancelled then the Peripheral will disconnect and be disposed.

Scanner()
    .advertisements
    .filter { advertisement -> advertisement.name?.startsWith("Example") }
    .map { advertisement -> scope.peripheral(advertisement) }
    .onEach { peripheral -> peripheral.connect() }
    .launchIn(scope)

delay(60_000L)
scope.cancel() // All `peripherals` will implicitly disconnect and be disposed.

Peripheral.disconnect is the preferred method of disconnecting peripherals, but disposal via Coroutine scope cancellation is provided to prevent connection leaks.

Setup

Gradle

Maven Central

Kable can be configured via Gradle Kotlin DSL as follows:

Multiplatform

plugins {
    id("com.android.application") // or id("com.android.library")
    kotlin("multiplatform")
}

repositories {
    mavenCentral()
}

kotlin {
    android()
    js().browser() // and/or js().node()
    macosX64()
    iosX64()
    iosArm64()

    sourceSets {
        val commonMain by getting {
            dependencies {
                implementation("com.juul.kable:core:$version")
            }
        }
    }
}

android {
    // ...
}

Note that Apple-based targets (e.g. macosX64) require Coroutines with multithread support for Kotlin/Native (more specifically: Coroutines library artifacts that are suffixed with -native-mt). Kable is configured to use -native-mt as a transitive dependency for Apple-based targets.

Platform-specific

repositories {
    mavenCentral()
}

dependencies {
    implementation("com.juul.kable:core:$version")
}

License

Copyright 2020 JUUL Labs, Inc.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
Comments
  • `write` suspends indefinitely on subsequent calls when `WithoutResponse` is used

    `write` suspends indefinitely on subsequent calls when `WithoutResponse` is used

    I’m attempting to send a write command sequentially. This approach works over android Bluetooth API, but in iOS I’m receiving the notification that the characteristics change only for the first command.

    For the iOS write command, I'm using the write without response. In another way, If I set to write with the response, I'm receiving the error for the write permission.

    bug apple 
    opened by renatosmf 38
  • Peripheral.observe has not been notified with a characteristic without descriptor

    Peripheral.observe has not been notified with a characteristic without descriptor

    We are trying to make a proof of concept of our app using Kable library (0.5.0) for connecting with the devices. Right now, we have devices with different bluetooth modules and of course, different services/characteristics/descriptors.

    In our devices with a characteristic which contains a descriptor, if the device notify a response, we are able to receive the response in the "peripheral.observe" method.

    On other hand, we have some old devices which not have a descriptor for each characteristic and we are not able to receive the response in the "peripheral.observe" method. I was taking a look to the issues and I found an issue from December that says that you implemented a piece of code to automatically detect if the characteristic contains a descriptor or not and act in consequence.

    We were wondering if we need to have something in consideration to solve this or if exist any impediment.

    opened by nspeeD 31
  • peripheral.observe(readCharacteristic) doesn't provide a form to know when is safe to write

    peripheral.observe(readCharacteristic) doesn't provide a form to know when is safe to write

    Hello there!

    I'm trying to migrate a project to kable. The ble device (and others I worked with...) uses some opcode communication where you write to a writeCharacteristic and all the data is received on the readCharacteristic subscribed to notify. After notify is subscribed I can enqueue calls to get a first response as soon as posible.

    Enter kable, the peripheral.observe(readCharacteristic) provides a flow with the data, but cant signal when it is actually able to receive data. So i can't just enqueue a write to the descriptor as doing it "on the next line" because the first response will be missed as the observe isn't really ready. I can workaround that doing a delay(2000) for example between the .observe and the write.

    Maybe i've missed something but can't seem to find a method or param that handles that. Could it be possible to set the notify/observe on the new (0.6) connect params? or maybe provide a param to the observe to set an initial write?

    Keep the good work, awesome library!

    opened by Devinete 27
  • Add Apple Silicon support

    Add Apple Silicon support

    Since Kotlin 1.5.30 added support for Apple Silicon it's now possible to build KMM projects on M1 without Rosetta. However it does require that all dependencies also support it explicitly.

    This change should add Apple Silicon support for Kable as well. Unfortunately I haven't been able to test it locally since I'm not sure how to get the whole build working locally.

    apple 
    opened by lammertw 22
  • Force disconnecting peripheral causes crash by ConnectionLostException

    Force disconnecting peripheral causes crash by ConnectionLostException

    Steps to reproduce: Start connecting to peripheral by method peripheral.connect and quickly stop Bluetooth server on the peripheral side.

    Stack trace: com.juul.kable.ConnectionLostException at com.juul.kable.PeripheralKt$suspendUntilConnected$2.invokeSuspend(Peripheral.kt:220) at com.juul.kable.PeripheralKt$suspendUntilConnected$2.invoke(Unknown Source:10) at kotlinx.coroutines.flow.FlowKt__TransformKt$onEach$$inlined$unsafeTransform$1$2.emit(Collect.kt:134) at kotlinx.coroutines.flow.StateFlowImpl.collect(StateFlow.kt:348) at kotlinx.coroutines.flow.StateFlowImpl$collect$1.invokeSuspend(Unknown Source:12) at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106) at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678) at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)

    opened by kostya29-strikersoft 22
  • AbortFlowException crash on repeated connect/disconnect calls

    AbortFlowException crash on repeated connect/disconnect calls

    @twyatt yes I could not reproduce this crash but I have found another crash when does connect/disconnect a lot of times in raw. kotlinx.coroutines.flow.internal.AbortFlowException: Flow was aborted, no more elements needed Unfortunately that there are not other lines of the stack trace. It happens just after call method connect.

    kotlinx.coroutines.flow.internal.AbortFlowException: Flow was aborted, no more elements needed 2020-12-29 12:39:45.027 6461-6511/com.xx D/BluetoothGatt: connect() - device: 43:95:9A:31:C7:6C, auto: false 2020-12-29 12:39:45.028 6461-6511/com.xx D/BluetoothAdapter: isSecureModeEnabled 2020-12-29 12:39:45.029 6461-6511/com.xx D/BluetoothGatt: registerApp() 2020-12-29 12:39:45.030 6461-6511/com.xx D/BluetoothGatt: registerApp() - UUID=1228b816-0f28-48f8-a49d-ef4c752b9027 2020-12-29 12:39:45.034 6461-6476/com.xx D/BluetoothGatt: onClientRegistered() - status=0 clientIf=10

    Originally posted by @kostya29-strikersoft in https://github.com/JuulLabs/kable/issues/44#issuecomment-752030738

    opened by twyatt 19
  • Android - observer.collect throws NoSuchElementException

    Android - observer.collect throws NoSuchElementException

    I'm trying to read some data of a UART Service that provides a "write without response" and a "notify" characteristic. I can write to it fine using cable but Kable but get the following error when using observer.collect { ... } to subscribe to notifications.

    java.util.NoSuchElementException: Collection contains no element matching the predicate.

    The characteristic works fine to read using other apps and sends out data about once a second. As probably will be apparent from my sample code below I'm fairly new to Kotlin but as far as I understand after reading up and digging through the source code I can't see why this error is produced.

    I looked at issue 38 but since I go through the steps to get the characteristic I get this error even if it is discovered. Or did i misunderstand the cause of that issue?

    The characteristic and observer objects looks fine to me, what I can notice is that the

    Sample code

    bluetoothScope.launch {
                val peripheral: Peripheral? = getPeripheral() // Get Peripheral using Scanner()
                if (peripheral != null) {
                    peripheral.connect()
                    val characteristic = peripheral.services
                            ?.first { service -> service.serviceUuid == UUID.fromString(UART_SERVICE)}
                            ?.characteristics?.first { characteristic ->
                                characteristic.characteristicUuid == UUID.fromString(RX_CHARACTERISTIC_UUID)
                            }
                    if (characteristic != null ) {
                        val observer = peripheral.observe(characteristic)
                                    try {
                                        observer.collect { data ->
                                            Log.d(TAG, data)
                                        }
                                    } catch (e: NoSuchElementException) {
                                        Log.d(TAG, "Error: $e")
                                    }
                    }
                    peripheral.state?.collect { state ->
                        when (state) {
                            State.Connected -> {
                                Log.d(TAG, "Connected")
                            }
                            else -> Log.d(TAG, "Not Connected")
                        }
                    }
                }
    
            }
        }
    

    Scan result

    DiscoveredService(serviceUuid=6e400001-b5a3-f393-e0a9-e50e24dcca9e, 
    characteristics=[
        DiscoveredCharacteristic(
            serviceUuid=6e400001-b5a3-f393-e0a9-e50e24dcca9e,
            characteristicUuid=6e400003-b5a3-f393-e0a9-e50e24dcca9e, 
            descriptors=[]), 
        DiscoveredCharacteristic(
            serviceUuid=6e400001-b5a3-f393-e0a9-e50e24dcca9e, 
            characteristicUuid=6e400002-b5a3-f393-e0a9-e50e24dcca9e, 
            descriptors=[])]
    )]
    
    opened by axelinternet 15
  • Services with the same UUIDs

    Services with the same UUIDs

    Thanks a lot for you work. The library is awesome.

    I have BLE device with this strange firmware. There are two services with the same UUIDs and with identical sets of characteristics. The only difference is in one of descriptors. So, there are two services S1 and S2, they both have characteristic C, and value of a descriptor D differs. All uuids are the same.

    S1.uuid == S2.uuid S1.C.uuid == S2.C.uuid S1.C.D.uuid == S2.C.D.uuid S1.C.D.value != S1.C.D.value.

    This way I should distinct those 2 services.

    So after services are discovered I do a loop over them and for every service S1 and S2 I read that descriptor. Unfortunately I always get the same value, as in both cases I read only descriptor of the service S1. readDescriptor function searches for descriptor through all services and always return the first one found. Is there a way to read identical descriptors (and characteristics) of two different services?

    opened by Shakenbeer 14
  • Add ability to create peripheral from identifier

    Add ability to create peripheral from identifier

    This PR adds the ability to create a peripheral from a public identifier as mentioned in issue #66 .
    Exposed the previously private "identifier" property in peripheral and added the ability to connect via a uuid in IOS and via a mac address in Android.

    As a note, the API is not the same between android and IOS. Android will return a peripheral for any Mac address passed. IOS will return an empty list if there are no devices which have the same uuid identified in the system, so this is returned as null in this implementation. Im not familiar enough with web bluetooth to know if there is equivalent functionality.

    android apple 
    opened by burnhamd 11
  • Finding characteristic by UUID + required property

    Finding characteristic by UUID + required property

    This allows to find an appropriate characteristic when there are duplicating two characteristics by UUID (but with different property). So for writing we use the charactertistic with WRITE or WRITE_NO_RESPONSE property, for observing we use only property with NOTIFY or INDICATE.

    BTW, what is the easiest way to test this locally for me? How can I use my modified library in my local project?

    opened by solvek 11
  • Set transport flag to BluetoothDevice.TRANSPORT_LE by default

    Set transport flag to BluetoothDevice.TRANSPORT_LE by default

    Hello there :)

    Currently I am still using able, or better: I am using a slightly customised version of it where I set the transport flag of the connectGatt method to BluetoothDevice.TRANSPORT_LE.

    I was wondering what the reasoning behind this decision is. Using BluetoothDevice.TRANSPORT_LE might reduce the appearances of the infamous 133 error. Other then anecdotal once I sadly have no proof to back up this claim.

    I saw that you want to make this a customisable parameter, still I am wondering why in Able you didn't use the flag and here you use TRANSPORT_AUTO.

    Also: Great library, really looking forward to incorporating Kable at one point :)

    opened by degill 11
  • Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.19.0

    Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.19.0

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | org.jetbrains.kotlinx:atomicfu-jvm | dependencies | minor | 0.18.5 -> 0.19.0 |


    ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the logs for more information.


    Release Notes

    Kotlin/kotlinx.atomicfu

    v0.19.0

    Compare Source

    • Update Kotlin to 1.8.0.
    • Update LV to 1.8 (#​270).
    • Prepare atomicfu for including to the Kotlin Aggregate build (#​265).

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    đŸšĻ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    â™ģ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Renovate Bot.

    renovate 
    opened by juul-mobile-bot 0
  • Support `autoConnect` on Android

    Support `autoConnect` on Android

    As was mentioned in https://github.com/JuulLabs/kable/issues/365#issuecomment-1243022280, for some users having autoConnect hardcoded as false may cause connection troubles (specifically, GATT 133 errors).

    Kable should provide an option to connect with autoConnect as true.

    android 
    opened by twyatt 0
  • Update dependency org.jetbrains.kotlin.multiplatform to v1.8.0

    Update dependency org.jetbrains.kotlin.multiplatform to v1.8.0

    This PR contains the following updates:

    | Package | Type | Update | Change | |---|---|---|---| | org.jetbrains.kotlin.multiplatform (source) | plugin | minor | 1.7.20 -> 1.8.0 |


    ⚠ Dependency Lookup Warnings ⚠

    Warnings were logged while processing this repo. Please check the logs for more information.


    Release Notes

    JetBrains/kotlin

    v1.8.0

    Analysis API
    • KT-50255 Analysis API: Implement standalone mode for the Analysis API
    Analysis API. FIR
    • KT-54292 Symbol Light classes: implement PsiVariable.computeConstantValue for light field
    • KT-54293 Analysis API: fix constructor symbol creation when its accessed via type alias
    Android
    • KT-53342 TCS: New AndroidSourceSet layout for multiplatform
    • KT-53013 Increase AGP compile version in KGP to 4.1.3
    • KT-54013 Report error when using deprecated Kotlin Android Extensions compiler plugin
    • KT-53709 MPP, Android SSL2: Conflicting warnings for androidTest/kotlin source set folder
    Backend. Native. Debug
    • KT-53561 Invalid LLVM module: "inlinable function call in a function with debug info must have a !dbg location"
    Compiler
    New Features
    • KT-52817 Add @JvmSerializableLambda annotation to keep old behavior of non-invokedynamic lambdas
    • KT-54460 Implementation of non-local break and continue
    • KT-53916 Support Xcode 14 and new Objective-C frameworks in Kotlin/Native compiler
    • KT-32208 Generate method annotations into bytecode for suspend lambdas (on invokeSuspend)
    • KT-53438 Introduce a way to get SourceDebugExtension attribute value via JVMTI for profiler and coverage
    Performance Improvements
    • KT-53347 Get rid of excess allocations in parser
    • KT-53689 JVM: Optimize equality on class literals
    • KT-53119 Improve String Concatenation Lowering
    Fixes
    • KT-53465 Unnecessary checkcast to array of reified type is not optimized since Kotlin 1.6.20
    • KT-49658 NI: False negative TYPE_MISMATCH on nullable type with when
    • KT-48162 NON_VARARG_SPREAD isn't reported on *toTypedArray() call
    • KT-43493 NI: False negative: no compilation error "Operator '==' cannot be applied to 'Long' and 'Int'" is reported in builder inference lambdas
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-55357 IllegalStateException when reading a class that delegates to a Java class with a definitely-not-null type with a flexible upper bound
    • KT-55068 Kotlin Gradle DSL: No mapping for symbol: VALUE_PARAMETER SCRIPT_IMPLICIT_RECEIVER on JVM IR backend
    • KT-51284 SAM conversion doesn't work if method has context receivers
    • KT-48532 Remove old JVM backend
    • KT-55065 Kotlin Gradle DSL: Reflection cannot find class data for lambda, produced by JVM IR backend
    • KT-53270 K1: implement synthetic Enum.entries property
    • KT-52823 Cannot access class Thread.State after upgrading to 1.7 from 1.6.1 using -Xjdk-release=1.8
    • KT-55108 IR interpreter: Error occurred while optimizing an expression: VARARG
    • KT-53547 Missing fun IrBuilderWithScope.irFunctionReference
    • KT-54884 "StackOverflowError: null" caused by Enum constant name in constructor of the same Enum constant
    • KT-47475 "IncompatibleClassChangeError: disagree on InnerClasses attribute": cross-module inlined WhenMappings has mismatched InnerClasses
    • KT-55013 State checker use-after-free with XCode 14.1
    • KT-54802 "VerifyError: Bad type on operand stack" for inline functions on arrays
    • KT-54707 "VerifyError: Bad type on operand stack" in inline call chain on a nullable array value
    • KT-48678 Coroutine debugger: disable "was optimised out" compiler feature
    • KT-54745 Restore KtToken constructors without tokenId parameter to preserve back compatibility
    • KT-54650 Binary incompatible ABI change in Kotlin 1.7.20
    • KT-52786 Frontend / K2: IndexOutOfBoundsException when opting in to K2
    • KT-54004 Builder type inference does not work correctly with variable assignment and breaks run-time
    • KT-54581 JVM: "VerifyError: Bad type on operand stack" with generic inline function and when inside try-catch block
    • KT-53794 IAE "Unknown visibility: protected/protected and package/" on callable reference to protected member of Java superclass
    • KT-54600 NPE on passing nullable Kotlin lambda as Java's generic SAM interface with super type bound
    • KT-54463 Delegating to a field with a platform type causes java.lang.NoSuchFieldError: value$delegate
    • KT-54509 Ir Interpreter: unable to evaluate string concatenation with "this" as argument
    • KT-54615 JVM: Internal error in file lowering: java.lang.AssertionError: Error occurred while optimizing an expression
    • KT-53146 JVM IR: unnecessary checkcast of null leads to NoClassDefFoundError if the type isn't available at runtime
    • KT-53712 Add mode to prevent generating JVM 1.8+ annotation targets (TYPE_USE, TYPE_PARAMETER)
    • KT-54366 K2: no JVM BE specific diagnostics (in particular CONFLICTING_JVM_DECLARATIONS) in 1.8
    • KT-35187 NullPointerException on compiling suspend inline fun with typealias to suspend function type
    • KT-54275 K2: "IllegalArgumentException: KtParameter is not a subtype of class KtAnnotationEntry for factory REPEATED_ANNOTATION"
    • KT-53656 "IllegalStateException: typeParameters == null for SimpleFunctionDescriptorImpl" with recursive generic type parameters
    • KT-46727 Report warning on contravariant usages of star projected argument from Java
    • KT-53197 K2: 'init' hides member of supertype 'UIComponent' and needs 'override' modifier
    • KT-53867 K2: @JvmRecord does not compile to a java record
    • KT-53964 K2 is unable to work with Java records
    • KT-53349 K2: TYPE_MISMATCH caused by non-local return
    • KT-54100 "Type variable TypeVariable(P) should not be fixed" crash in code with errors
    • KT-54212 K2: cannot calculate implicit property type
    • KT-53699 K2: Exception during IR lowering in code with coroutines
    • KT-54192 Warn about unsupported feature on generic inline class parameters
    • KT-53723 Friend modules aren't getting passed to cache build during box tests
    • KT-53873 K2: Duplicated diagnostics reported from user type ref checkers
    • KT-50909 "VerifyError: Bad type on operand stack" caused by smartcasting for nullable inline class property in class
    • KT-54115 Restore Psi2IrTranslator constructor from 1.7.20
    • KT-53908 K2: Self-referencing generics in Java class causes New Inference Error (IE: class Foo<T extends Foo>)
    • KT-53193 K2: compile error on project that compiles fine with normal 1.7.10
    • KT-54062 K2 Invalid serialization for type-aliased suspend function type with extension receiver
    • KT-53953 Forbid usages of super or super if in fact it accesses an abstract member
    • KT-47473 NI: Missed UPPER_BOUND_VIOLATED diagnostics if use type aliases with type parameters
    • KT-54049 K2: false positive MANY_IMPL_MEMBER_NOT_IMPLEMENTED
    • KT-30054 Wrong approximation if nullable anonymous object with implemented interface is used
    • KT-53751 Postpone IgnoreNullabilityForErasedValueParameters feature
    • KT-53324 Implement Enum.entries lowering on K/N
    • KT-44441 K2: report redeclaration error if there is a Java class with the same name as the Kotlin class
    • KT-53807 No warning about declaringClass on an enum value
    • KT-53493 K2: val on function parameter counts as just warning
    • KT-53435 K2: "IllegalArgumentException: class KtValueArgument is not a subtype of class KtExpression for factory ANNOTATION_ARGUMENT_MUST_BE_CONST" if string in nested annotation is concatenated
    • KT-52927 AssertionError: LambdaKotlinCallArgumentImpl
    • KT-53922 Make Enum.entries unstable feature to poison binaries
    • KT-53783 Exception during psi2ir when declaring expect data object
    • KT-53622 [OVERLOAD_RESOLUTION_AMBIGUITY] when enum entry called 'entries' is present in K2
    • KT-41670 JVM IR: AbstractMethodError when using inheritance for fun interfaces
    • KT-53178 K2: implement diagnostics for serialization plugin
    • KT-53804 Restore old and incorrect logic of generating InnerClasses attributes for kotlin-stdlib
    • KT-52970 Default value constant in companion object works on JVM and JS, but fails on native
    • KT-51114 FIR: Support DNN checks
    • KT-27936 Write InnerClasses attribute for all class names used in a class file
    • KT-53719 Parsing regression on function call with type arguments and labeled lambda
    • KT-53261 Evaluate effect from inline for primitive types
    • KT-53706 K2: Context receivers are not resolved on properties during type resolution stage
    • KT-39492 Kotlin.Metadata's packageName field cannot be an empty string
    • KT-53664 Ir Interpreter: unable to evaluate name of function reference marked with JvmStatic from another module
    • KT-52478 [Native] Partial linkage: Building native binary from cached KLIBs fails if one library depends on removed nested callable member from another one
    • KT-48822 CompilationException: Back-end (JVM) Internal error: Failed to generate expression: KtProperty - ConcurrentModificationException
    • KT-50281 IllegalStateException: unsupported call of reified inlined function
    • KT-50083 Different error messages in android and JVM (Intrinsics.checkNotNullParameter).
    • KT-53236 Support Enum.entries codegen on JVM/IR BE
    • KT-41017 FIR: should we support smartcast after null check
    • KT-53202 "ISE: Descriptor can be left only if it is last" after direct invoke optimization on a capturing lambda
    • KT-46969 @BuilderInference with nested DSL scopes cause false-positive scope violation in Kotlin 1.5
    • KT-53257 FIR: Improper context receiver argument is chosen when there are two extension receiver candidates
    • KT-53090 Anonymous function and extension function literals are generated as classes even with -Xlambdas=indy
    • KT-53208 K2: Cannot get annotation for default interface method parameter when compiled with -Xuse-k2
    • KT-53184 K2: NoSuchMethodError on KProperty1.get() referenced via nullable typealias
    • KT-53198 K2: Return type mismatch: expected kotlin/Unit, actual kotlin/Unit?
    • KT-53100 Optimization needed: (CONSTANT_PRIMITIVE(x: T?)) => x
    • KT-49875 [FIR] Support infering PRIVATE_TO_THIS visibility
    • KT-53024 Refactor FIR renderer to composable architecture
    • KT-50995 [FIR] Support SAM with receiver plugin
    • KT-53148 K1: introduce warning for inline virtual member in enum
    • KT-49847 Devirtualization fails to eliminate boxing in function reference context
    • KT-52875 Extension function literal creation with -Xlambdas=indy fails with incorrect arguments
    • KT-53072 INVALID_IF_AS_EXPRESSION error isn't shown in the IDE (LV 1.8)
    • KT-52985 Native: a function with type T? returned a kotlin.Unit instead of null
    • KT-52020 FIR warning message includes internal rendering
    • KT-48778 -Xtype-enhancement-improvements-strict-mode not respecting @NonNull annotation for property accesses?
    IDE
    Fixes
    • KTIJ-22357 CCE “class org.jetbrains.kotlin.fir.types.impl.FirImplicitTypeRefImpl cannot be cast to class org.jetbrains.kotlin.fir.types.FirResolvedTypeRef” in K2
    • KT-55150 Argument for @NotNull parameter 'scope' of org/jetbrains/kotlin/resolve/AnnotationResolverImpl.resolveAnnotationType must not be null
    • KTIJ-22165 IDE notification to promote users to migrate to the new Kotlin/JS toolchain
    • KTIJ-22166 IDE notification (or something else) about JPS and Maven support for Kotlin/JS is deprecated
    • KT-53543 Rework light classes for file facade
    • KT-48773 Investigate the possibility of removing dependency on old JVM backend in light classes
    • KTIJ-19699 IDE: False positive type mismatch in Java code for Kotlin nested class non-direct inheritor from external library
    • KT-51101 FIR IDE: Exception on "Show Type Info" action
    • KTIJ-22295 MPP, IDE: False positive UPPER_BOUND_VIOLATED when JVM module implements the generic interface from MPP module and the type parameter is not equal to itself.
    • KT-51656 FIR IDE: ProgressCancelled exception is masked in the compiler during resolve
    • KT-51315 FIR IDE: move out base modules from fe10 plugin to reuse in k2 plugin
    • KTIJ-22323 K2: ISE during resolve of stdlib calls from the stdlib
    • KTIJ-21391 Generate -> Override methods : don't delegate to abstract methods
    • KT-53097 Extract common part of light classes to another module
    • KTIJ-22354 FIR LC: annotation owner is always null
    • KTIJ-22157 Kotlin call resolver leaks user code when reporting exception
    IDE. Completion
    • KTIJ-22552 Kotlin: 'for loop' postfix completion doesn't work - "Fe10SuggestVariableNameMacro must be not requested from main classloader"
    • KTIJ-22503 Support code completion for data objects
    IDE. Debugger
    • KT-51755 Compilation exception with scripting compilation during debug session
    • KTIJ-21963 Debugger / IR: Expression evaluation of the debugger doesn't work
    IDE. Decompiler, Indexing, Stubs
    • KTIJ-22750 Initialize Kotlin stub element types lazily
    • KTIJ-18094 IDE: "AssertionError: Stub count doesn't match stubbed node length" with minified Android AAR library
    • KTIJ-17632 IndexOutOfBoundsException: Cannot decompile a class located in minified AAR
    IDE. Gradle Integration
    • KT-48135 In the IDE import, reuse dependency granular source set KLIBs across multi-project build to avoid duplicate external libraries
    • KTIJ-22345 False positive unresolved reference for members of subclasses of expect classes.
    • KT-53514 HMPP: False positive for None of the following functions can be called with the arguments supplied. with Enum in common module
    • KT-51583 Gradle 7.4+ | SamplesVariantRule interference: Could not resolve all files for configuration ':kotlinKlibCommonizerClasspath'
    • KTIJ-21077 Dependency matrix does not work with Jetpack compose / multiplatform projects
    IDE. Inspections and Intentions
    • KTIJ-19531 Adapt changes about new rules for method implementation requirements
    • KTIJ-22087 Support IDE inspections for upcoming data objects
    • KTIJ-20510 Quick fix to implement and call correct super method in case of inheritance with defaults
    • KTIJ-20170 Provide quickfix for deprecated resolution to private constructor of sealed class
    • KTIJ-22630 FIR IDE: Lazy resolve exception after invocation of Override members action on value class
    • KT-49643 Intentions: "Implement members" fails when base type function declaration uses unresolved generic types
    IDE. JS
    • KTIJ-22167 Make JS IR default in projects created by wizard
    • KTIJ-22332 Wizard: Kotlin/JS projects: cssSupport DSL should be updated
    IDE. KDoc
    • KTIJ-22324 K2 IDE: implement reference resolve inside KDocs
    IDE. Multiplatform
    • KTIJ-19566 New Project Wizard: Update HMPP-related flags in multiplatform wizards
    IDE. Navigation
    • KT-51314 FIR IDE: show Kotlin declarations in search symbol
    • KTIJ-22755 Find usage for constructor from kotlin library doesn't work for secondary constructor usages
    IDE. Script
    • KTIJ-22598 Add warning for standalone scripts in source roots
    • KT-54325 .settings.gradle.kts and .init.gradle.kts are reported as standalone scripts
    IDE. Structural Search
    • KTIJ-21986 KSSR: "CodeFragment with non-kotlin context should have fakeContextForJavaFile set: originalContext = null" warning shows up when replacing
    IDE. Tests Support
    • KT-50269 FIR IDE: Allow running tests via gutter
    IDE. Wizards
    • KTIJ-23537 Wizard: projects with Android modules require higher sdkCompileVersion
    • KTIJ-23525 Wizard: Compose multiplatform: project won't build and require higher compileSdkVersion
    • KTIJ-22763 New Project Wizard: remove deprecated Android extensions plugin from Android target in the project constructor
    • KTIJ-22481 Wizard: Kotlin -> Browser application (gradle groove). Build error
    JavaScript
    Fixes
    • KT-55097 KJS / IR + IC: Using an internal function from a friend module throws an unbound symbol exception
    • KT-54406 Kotlin/JS: build with dependencies fails with "Could not find "kotlin" in [~/.local/share/kotlin/daemon]"
    • KT-53074 Make JS IR BE default in toolchain (gradle & CLI)
    • KT-50589 UTF-8 Instability in kotlin.js.map
    • KT-54934 KJS / IR + IC: Suspend abstract function stubs are generated with unstable lowered ic signatures
    • KT-54895 KJS / IR + IC: broken cross module references for function default param wrappers
    • KT-54520 KJS / IR Allow IdSignature clashes
    • KT-54120 JS IR + IC: pointless invalidation of dependent code after modifying companions
    • KT-53986 KJS / IR + IC: compiler produces different JS file names with IC and without IC
    • KT-54010 JS IR + IC: Force IC cache invalidation after updating language version or features
    • KT-53931 KJS / Gradle: Regression with 1.7.20-RC: ReferenceError: println is not defined
    • KT-53968 Kotlin/JS: no UninitializedPropertyAccessException on access to non-initialized lateinit property defined in dependencies
    • KT-54686 KJS / IR: Incorrect generation of signatures when one of argument is nested class
    • KT-54479 KJS / IR + IC: Adding or removing companion fields leads java.lang.IllegalStateException in the compiler IC infrastructure
    • KT-54382 KJS / IR: Wrong type check for inheritors of suspend functions
    • KT-54323 KJS / IR + IC: Intrinsics from stdlib may lose their dependencies in incremental rebuild
    • KT-53361 KJS / IR: No debug info is generated for in-line js code
    • KT-53321 Implement Enum.entries lowering on JS/IR
    • KT-53112 KJS IR turn on IC infra by default
    • KT-50503 Kotlin/JS: IR + IC: compileTestDevelopmentExecutableKotlinJs fails with ISE: "Could not find library" after removing module dependency
    • KT-54011 JS IR + IC: EnumEntries don't work well when IC is enabled
    • KT-53672 KJS / IR: "IndexOutOfBoundsException: Index 0 out of bounds for length 0" caused by function reference to extension function of reified type variable
    • KT-43455 KJS: IR. Incremental compilation problem with unbound symbols
    • KT-53539 KJS: Exported class inherited non-exported class shows warning
    • KT-53443 KJS/IR: NullPointerException caused by anonymous objects inside lambdas
    • KT-52795 K/JS and K/Native IR-validation/compilation errors for a valid kotlin code
    • KT-52805 KJS/IR: Invalid call of inline function in also block
    • KT-51151 KJS / IR: Wrong overloaded generic method with receiver is called
    • KT-52830 KJS/IR: Sourcemap disabling doesn't work
    • KT-52968 KJS / IR: Buggy generation of overridden methods
    • KT-53063 KJS / IR + IC: undefined cross module reference for implemented interface functions
    • KT-51099 KJS / IR + IC: Cache invalidation doesn't check generic class variance annotations (in, out)
    • KT-51090 KJS / IR + IC: Cache invalidation doesn't check suspend qualifier
    • KT-51088 KJS / IR + IC: Cache invalidation doesn't check class qualifiers (data, inline)
    • KT-51083 KJS / IR + IC: Cache invalidation doesn't check inline function which was non inline initially
    • KT-51896 KJS / IR + IC: Cache invalidation doesn't trigger rebuild for fake overridden inline functions
    Language Design
    • KT-48385 Deprecate confusing grammar in when-with-subject
    • KT-48516 Forbid @Synchronized annotation on suspend functions
    • KT-41886 Ability to require opt-in for interface implementation, but not for usage
    • KT-34943 OVERLOAD_RESOLUTION_AMBIGUITY inconsistent with the equivalent Java code
    • KT-51334 Implement type-bound label this@Type
    Libraries
    New Features
    • KT-21007 Provide Kotlin OSGI Bundle with extensions for JRE8 (and JRE7)
    • KT-54082 Comparable and subtractible TimeMarks
    • KT-52928 Provide copyToRecursively and deleteRecursively extension functions for java.nio.file.Path
    • KT-49425 Update OptIn documentation to reflect latest design changes
    • KT-54005 Allow calling declaringJavaClass on Enum
    • KT-52933 rangeUntil members in built-in types
    Performance Improvements
    • KT-53508 Cache typeOf-related KType instances when kotlin-reflect is used
    Fixes
    • KT-51907 Switch JVM target of the standard libraries to 1.8
    • KT-54835 Document that Iterable.all(emptyCollection) returns TRUE.
    • KT-54168 Expand on natural order in comparator docs
    • KT-53277 Stabilize experimental API for 1.8
    • KT-53864 Review deprecations in stdlib for 1.8
    • KT-47707 Remove the system property and the brittle contains optimization code itself
    • KT-52336 Different behavior on JVM and Native in stringBuilder.append(charArray, 0, 1)
    • KT-53927 Remove deprecation from ConcurrentModificationException constructors
    • KT-53152 Introduce EnumEntries to stdlib as backing implementation of Enum.entries
    • KT-53134 stdlib > object Charsets > not thread safe lazy initialization
    • KT-51063 Gradle project with JPS runner: "JUnitException: Failed to parse version" JUnit runner internal error with JUnit
    • KT-52908 Native: setUnhandledExceptionHook swallows exceptions
    Native
    • KT-51043 Kotlin Native: ObjC-Interop: kotlin.ClassCastException: null cannot be cast to kotlin.Function2
    • KT-50786 Native: prohibit suspend calls inside autoreleasepool {}
    • KT-52834 Implement test infrastructure for K2/Native
    Native. C Export
    • KT-36878 Reverse C Interop: incorrect headers generation for primitive unassigned type arrays
    • KT-53599 [Reverse C Interop] Provide box/unbox API for unsigned primitive types
    • KT-41904 Kotlin/Native : error: duplicate member for interface and function with the same name
    • KT-42830 [Reverse C Interop] Add API to get value of boxed primitives
    • KT-39496 K/N C: optional unsigned types as function parameters crash the compiler
    • KT-39015 Cannot compile native library with nullable inline class
    Native. C and ObjC Import
    • KT-54738 Cocoapods cinterop: linking platform.CoreGraphics package
    • KT-54001 Kotlin/Native: support header exclusion in cinterop def files
    • KT-53151 Native: Custom declarations in .def don't work with modules, only headers
    Native. ObjC Export
    • KT-53680 Obj-C refinement annotations
    • KT-54119 Native: runtime assertion failed due to missing thread state switch
    • KT-42641 Don't export generated component* methods from Kotlin data classes to Obj-C header
    Native. Platform Libraries
    • KT-54225 Native: update to Xcode 14.1
    • KT-54164 Native: commonizer fails on CoreFoundation types
    • KT-39747 Why is there no WinHttp API in Kotlin/Native's Windows API?
    Native. Runtime
    • KT-49228 Kotlin/Native: Allow to unset unhandled exception hook
    • KT-27305 Fix FILE macro inside RuntimeCheck and RuntimeAssert
    Native. Runtime. Memory
    • KT-54498 Deprecation message of 'FreezingIsDeprecated' is not really helpful
    • KT-53182 New memory manager: Unexpected memory usage on IOS
    Native. Stdlib
    • KT-52429 Small Usability Improvements for Worker API
    Reflection
    • KT-54629 Incorrectly cached class classifier
    • KT-54611 KTypeImpl does not take into account class loader from the classifier property
    • KT-48136 Make Reflection.getOrCreateKotlinPackage use cache when kotlin-reflect is used
    • KT-50705 Use ClassValue to cache KClass objects in kotlin-reflect
    • KT-53454 Properly cache the same class's KClass when it's loaded by multiple classloaders in getOrCreateKotlinClass
    Specification
    • KT-54210 Update Kotlin specification to mention that since 1.8 generics in value classes are allowed
    Tools. CLI
    • KT-54116 Add JVM target bytecode version 19
    • KT-53278 Support values 6 and 8 for -Xjdk-release
    • KT-46312 CLI: Kotlin runner should use platform class loader to load JDK modules on Java 9+
    Tools. Commonizer
    • KT-54310 Commonizer fails on 1.8.0-dev K/N distributions
    • KT-48576 [Commonizer] platform.posix.pselect not commonized in Ktor
    Tools. Compiler Plugins
    • KT-46959 Kotlin Lombok: Support generated builders (@Builder)
    • KT-53683 Unresolved reference compilation error occurs if a file is annotated with @ Singular and has any guava collection type : ImmutableTable, ImmutableList or else
    • KT-53657 [K2] Unresolved reference compilation error occurs if a field is annotated with @ Singular and has type NavigableMap without explicit types specification
    • KT-53647 [K2] Unresolved reference compilation error occurs if a field is annotated with @ Singular and has type Iterable<>
    • KT-53724 Param of the @ Singular lombok annotation ignoreNullCollections=true is ignored by kotlin compiler
    • KT-53451 [K2] References to methods generated by @ With lombok annotation can't be resolved with enabled K2 compiler
    • KT-53721 [K2] There is no compilation error while trying to add null as a param of the field with non-null type
    • KT-53370 Kotlin Lombok compiler plugin can't resolve methods generated for java boolean fields annotated with @ With annotation
    Tools. Compiler plugins. Serialization
    • KT-54878 JVM/IR: java.lang.ClassCastException: class org.jetbrains.kotlin.ir.types.impl.IrStarProjectionImpl cannot be cast to class org.jetbrains.kotlin.ir.types.IrTypeProjection on serializer<Box<*>>()
    • KT-55340 Argument for kotlinx.serialization.UseSerializers does not implement KSerializer or does not provide serializer for concrete type
    • KT-55296 Improve exceptions in serialization plugin
    • KT-55180 KJS: regression in serialization for Kotlin 1.8.0-beta
    • KT-53157 Recursion detected in a lazy value under LockBasedStorageManager in kotlinx.serialization
    • KT-54297 Regression in serializable classes with star projections
    • KT-49660 kotlinx.serialization: IndexOutOfBoundsException for parameterized sealed class
    • KT-43910 JS IR: Serialization with base class: "IndexOutOfBoundsException: Index 0 out of bounds for length 0"
    Tools. Daemon
    • KT-52622 Kotlin/JS, Kotlin/Common compilations start Kotlin daemon incompatible with Kotlin/JVM compilation on JDK 8
    Tools. Gradle
    New Features
    • KT-27301 Expose compiler flags via Gradle lazy properties
    • KT-53357 Change single build metrics property
    • KT-50673 Gradle: KotlinCompile task(s) should use @NormalizeLineEndings
    • KT-34464 Kotlin build report path not clickable in the IDE
    Performance Improvements
    • KT-51525 [Gradle] Optimize evaluating args for compile tasks
    • KT-52520 Remove usage of reflection from CompilerArgumentsGradleInput
    Fixes
    • KT-48843 Add ability to disable Kotlin daemon fallback strategy
    • KT-55334 kaptGenerateStubs passes wrong android variant module names to compiler
    • KT-55255 Gradle: stdlib version alignment fails build on dynamic stdlib version.
    • KT-55363 [K1.8.0-Beta] Command line parsing treats plugin parameters as source files
    • KT-54993 Raise kotlin.jvm.target.validation.mode check default level to error when build is running on Gradle 8+
    • KT-54136 Duplicated classes cause build failure if a dependency to kotlin-stdlib specified in an android project
    • KT-50115 Setting toolchain via Java extension does not configure 'kotlinOptions.jvmTarget' value when Kotlin compilation tasks are created eagerly
    • KT-55222 Migrate AndroidDependencyResolver to the new Gradle API
    • KT-55119 There is no validation for different jvmTarget and targetCompatibility values in multiplatform projects with jvm target and used java sources
    • KT-55102 Compile java task fails with different target version in pure kotlin project
    • KT-54995 [1.8.0-Beta] compileAppleMainKotlinMetadata fails on default parameters with No value passed for parameter 'mustExist'
    • KT-35003 Automatically set targetCompatibility for kotlin-jvm projects to work with gradle 6 metadata
    • KT-45335 kotlinOptions.jvmTarget conflicts with Gradle variants
    • KT-48798 Android: going from one to more than one productFlavor causes inputs of commonSourceSet$kotlin_gradle_plugin property of compileKotlin task to change
    • KT-55019 Gradle sync: UnknownConfigurationException when adding implementation dependencies to a Kotlin with Java compilation
    • KT-55004 jvmTarget value is ignored by depending modules if a task "UsesKotlinJavaToolchain" is configured for all project modules using allProjects {}
    • KT-54888 Add Gradle property to suppress kotlinOptions.freeCompilerArgs modification on execution phase
    • KT-54399 Undeprecate 'kotlinOptions' DSL
    • KT-54306 Change the naming of newly added Compiler*Options classes and interfaces
    • KT-54580 KotlinOptions in AbstractKotlinCompilation class are deprecated
    • KT-54653 java.lang.NoClassDefFoundError: kotlin/jdk7/AutoCloseableKt exception if a dependency to the kotlin-stdlib is added
    • KT-52624 Compatibility with Gradle 7.3 release
    • KT-54703 Stdlib substitution does not work with JPMS modules
    • KT-54602 Prevent leaking Gradle Compile DSL types into compiler cli runtime
    • KT-54439 Project failed to sync Native LaguageSettings to compiler options in afterEvaluate
    • KT-53885 Bump minimal supported Gradle version to 6.8.3
    • KT-53773 Protect and system properties can contain sensitive data
    • KT-53732 Add custom values limits for build scan reports
    • KT-52623 Compatibility with Gradle 7.2. release
    • KT-51831 Gradle: remove kotlin.compiler.execution.strategy system property
    • KT-51679 Change deprecation level to error for KotlinCompile setClasspath/getClasspath methods
    • KT-54335 Kotlin build report configuration. There is no validation for SINGLE_FILE output if the required kotlin.build.report.single_file property is empty or absent
    • KT-54356 Kotlin build report configuration. Wrong path is used for the property kotlin.internal.single.build.metrics.file
    • KT-53617 KotlinCompilerExecutionStrategy value is ignored by depending modules if configure once for all project modules using allProjects {}
    • KT-53823 Kotlin Gradle Plugin uses deprecated Gradle API: Provider.forUseAtConfigurationTime()
    • KT-54142 Increase Kotlin Gradle plugin Gradle target API to 7.5
    • KT-50161 Android variant filter breaks KotlinCompile cache compatibility
    • KT-54113 LanguageSettings to KotlinNativeLink.toolOptions sync are executed on the wrong context
    • KT-53830 Versions of kotlin-stdlib-jdk8 and kotlin-stdlib-jdk7 aren't overrided if added as transitive dependencies to kotlin-stdlib
    • KT-54112 Missing target input on KotlinNativeLink task
    • KT-45879 Documentation: Wrong kotlin languageVersion "1.6 (EXPERIMENTAL)"
    • KT-54103 Remove JvmTarget.JVM_1_6 from generated Gradle compiler type
    • KT-52959 KMP code is breaking Gradle project isolation
    • KT-50598 MULTIPLE_KOTLIN_PLUGINS_SPECIFIC_PROJECTS_WARNING is only shown on first build
    • KT-53246 Gradle: Special characters in paths of errors and warnings should be escaped
    • KT-47730 How to avoid stdlib coming from Kotlin gradle plugin
    • KT-52209 Corrupted cache and non-incremental build if produce caches "in process" and restore then compiling with kotlin daemon
    • KT-41642 "TaskDependencyResolveException: Could not determine the dependencies" when trying to apply stdlib
    • KT-53390 Drop usage of -Xjava-source-roots when passing java sources required for Kotlin compilation
    • KT-52984 Kotlin Gradle plugin is misbehaving by resolving DomainObjectCollection early
    • KT-38622 Non-incremental compilation because of R.jar with Android Gradle plugin 3.6
    • KT-38576 AnalysisResult.RetryWithAdditionalRoots crashes during incremental compilation with java classes in classpath
    Tools. Gradle. Cocoapods
    • KT-54314 Cocoapods: Signing pod dependency for Xcode 14
    • KT-54060 Xcode 14: disable bitcode embedding for Apple frameworks
    • KT-53340 Change default linking type for frameworks registered by cocoapods plugin
    • KT-53392 Deprecate and delete downloading pod dependencies by direct link
    • KT-53695 Build of macOS application fails if a framework is integrated via Cocoapods plugin
    Tools. Gradle. JS
    • KT-53367 KJS: Migrate cssSupport API
    • KT-45789 KJS / IR: Transitive NPM dependencies are not included in PublicPackageJsonTask output
    • KT-55099 K/JS: Second declaration of JS target without compiler type report warning incorrectly
    • KT-52951 [KGP/JS] Browser test target registration via properties
    • KT-52950 KJS: Report if yarn.lock was updated during built
    • KT-53374 KJS / Gradle: Implement IDEA sync detection logic via ValueSource to improve configuration cache support
    • KT-53381 Kotlin/JS: with erased kotlin-js-store/ and reportNewYarnLock = true the task kotlinUpgradeYarnLock always fails
    • KT-53788 KJS / Gradle: Disable Gradle build cache for KotlinJsDce when development mode is enabled
    • KT-53614 Kotlin/JS upgrade npm dependencies
    Tools. Gradle. Multiplatform
    New Features
    • KT-53396 Support 'implementation platform()' by gradle kotlin mpp plugin for JVM target
    • KT-40489 MPP / Gradle: support BOM (enforcedPlatform) artifacts in source set dependencies DSL
    Performance Improvements
    • KT-52726 [MPP] Optimize caching/performance/call-sites of 'compilationsBySourceSets'
    Fixes
    • KT-54634 MPP: Test Failure causes: KotlinJvmTest$Executor$execute$1 does not define failure
    • KT-35916 Gradle MPP plugin: Configurations for a main compilation and its default source set have different naming
    • KT-46960 Repeated kotlin/native external libraries in project
    • KT-27292 MPP: jvm { withJava() }: Gradle build: Java source under Kotlin root is resolved while building, but does not produce output class files
    • KT-34650 Naming clash in MPP+Android: androidTest vs androidAndroidTest
    • KT-54387 Remove MPP alpha stability warning
    • KT-31468 Targets disambiguation doesn't work if a depending multiplatform module uses withJava() mode
    • KT-54090 Take an Apple test device from the device list
    • KT-54301 KotlinToolingVersionOrNull: IllegalArgumentException
    • KT-53256 Implement K/N compiler downloading for KPM
    • KT-45412 KotlinCompilation: Make sure .kotlinSourceSets and .allKotlinSourceSets include the default source set
    • KT-49202 Tests on android target can't be executed in multiplatform project if dependency to kotlin-test framework is provided as a single dependency and tests configured to be executed via Junit5
    Tools. Gradle. Native
    New Features
    • KT-43293 Support Gradle configuration caching with Kotlin/Native
    • KT-53107 Add arm64 support for watchOS targets (Xcode 14)
    Fixes
    • KT-53704 Native cinterop: eager header path calculation
    • KT-54814 Kotlin/Native: Github Actions: Testing watchOSX64 with Xcode 14 — Invalid device: Apple Watch Series 5
    • KT-54627 Native: :commonizeNativeDistribution with configuration cache enabled fails even when set to warn on JDK 17
    • KT-54339 Link tasks fail if Gradle Configuration Cache is enabled
    • KT-53191 Native cinterop sync problem with gradle
    • KT-54583 watchosDeviceArm64 target shouldn't register test tasks
    • KT-52303 Gradle / Native: Build tasks ignore project.buildDir
    • KT-54442 Gradle iOS test tasks fail if a device is not selected explicitly
    • KT-54177 Gradle: Deprecate enableEndorsedLibs flag
    • KT-47355 Support macos target for FatFramework task
    • KT-53339 MPP / CocoaPods: The static framework fails to install on a real iOS device
    • KT-31573 Missing description for Native Gradle tasks
    • KT-53131 Gradle Sync: "NoSuchElementException: Array contains no element matching the predicate" with CocoaPods
    • KT-53686 Task assembleReleaseXCFramework fails with "error: the path does not point to a valid framework" if project name contains a dash
    Tools. Incremental Compile
    • KT-54144 New IC: "IllegalStateException: The following LookupSymbols are not yet converted to ProgramSymbols" when changing an inline function with custom JvmName
    • KT-53871 New IC: "IllegalStateException: The following LookupSymbols are not yet converted to ProgramSymbols" when changing an inline property accessor
    • KT-19804 Relocatable IC caches
    Tools. JPS
    • KT-45474 False positive NO_ELSE_IN_WHEN on sealed class with incremental compilation
    • KT-54228 Switching abstract to sealed classes causes incremental issue
    • KT-38483 JPS: Stopping compilation causes IDE CompilationCanceledException
    • KT-50310 False positive NO_ELSE_IN_WHEN on incremental build when adding sealed classes
    • KT-48813 Move cache version to compiler
    • KTIJ-921 JPS: FileNotFoundException on project build in mixed Kotlin/Scala project
    Tools. Kapt
    • KT-54187 JVM IR + kapt: incorrect modifier final is generated for nested enum in interface
    • KT-48827 Remove 'kapt.use.worker.api' property
    Tools. Scripts
    • KT-54355 Scripts: Internal compiler error (languageVersion=1.9)
    • KT-53009 Scripting: NDFDE “Descriptor wasn't found for declaration SCRIPT” on using script definition with kotlin from master

    v1.7.22: Kotlin 1.7.22

    This is a technical release. It doesn't contain any fixes that aren't included in Kotlin 1.7.21. Version 1.7.22 of the Kotlin plugin will not be available for downloading or installing in any IDEs.

    Checksums

    | File | Sha256 | | --- | --- | | kotlin-compiler-1.7.22.zip | 9db4b467743c1aea8a21c08e1c286bc2aeb93f14c7ba2037dbd8f48adc357d83 | | kotlin-native-linux-x86_64-1.7.22.tar.gz | dd004d520056aba67f2955a3bec5af75f8f2d78b179d4b5f733a77e3eef57aff | | kotlin-native-macos-x86_64-1.7.22.tar.gz | 153fa411fa8c993ce2635e2504e9b102cb05362cc794b66ef9def26a78b427b5 | | kotlin-native-macos-aarch64-1.7.22.tar.gz | 4ffcd76c77cc824eff8addd5e2a73da4f3bbd3584fa9ef282b3f669c45426b1e | | kotlin-native-windows-x86_64-1.7.22.zip | 3bccd23479848ec61c56ed5760010456d17acbe88a00a1f10fb38eae256f2e92 |

    v1.7.21

    Compiler
    • KT-54463 Delegating to a field with a platform type causes java.lang.NoSuchFieldError: value$delegate
    • KT-54509 Ir Interpreter: unable to evaluate string concatenation with "this" as argument
    • KT-54004 Builder type inference does not work correctly with variable assignment and breaks run-time
    • KT-54393 Change in behavior from 1.7.10 to 1.7.20 for java field override.
    • KT-54615 JVM: Internal error in file lowering: java.lang.AssertionError: Error occurred while optimizing an expression
    • KT-54581 JVM: "VerifyError: Bad type on operand stack" with generic inline function and when inside try-catch block
    • KT-53146 JVM IR

    Configuration

    📅 Schedule: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

    đŸšĻ Automerge: Disabled by config. Please merge this manually once you are satisfied.

    â™ģ Rebasing: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

    🔕 Ignore: Close this PR and you won't be reminded about this update again.


    • [ ] If you want to rebase/retry this PR, check this box

    This PR has been generated by Renovate Bot.

    renovate 
    opened by juul-mobile-bot 0
  • Support Linux / Windows JVM targets

    Support Linux / Windows JVM targets

    Currently, the Kable Library does not support Windows or Linux targets.

    There are libraries like https://github.com/weliem/blessed-bluez, that support Windows or Linux. It would be great to investigate if this could be an approach for kable to extend the platform compatibility. I really like the APIs from Kable, so I would prefer using such a library for all platforms instead of using different ones.

    opened by danielgruber 3
  • Peripheral blocking scope from finishing

    Peripheral blocking scope from finishing

    Bug report

    When using scope.peripheral(...) it will block scope from finishing.

    I am developing an Android application and I've tried versions 0.18.0, 0.17.2, 0.16.1 and unreleased version 0.18.0-issue-359-1-SNAPSHOT was crashing when using different contexts.

    How to reproduce

    A coroutine is not finished unless the job is manually canceled.

    val device: BluetoothDevice = ...
    
    viewModelScope.launch {
      val peripheral = peripheral(device)
    
      // some work, connecting and disconnection or nothing
    }
    

    Even worse when using a different context:

    val device: BluetoothDevice = ...
    
    viewModelScope.launch {
      withContext(Dispatchers.IO) {
        val peripheral = peripheral(device)
    
        // some work, connecting and disconnection or nothing
      }
      
      // unreachable code
    }
    

    Expected behavior

    Either should not block scope and be closed automatically or should provide peripheral.close() method for closing the peripheral.

    bug 
    opened by tomnovotny7 1
  • How to use requestConnectionPriority?

    How to use requestConnectionPriority?

    opened by somq 4
Releases(0.20.1)
  • 0.20.1(Nov 14, 2022)

    Logo Android

    • Fix leak/bug in bluetoothState flow (#399), thanks to @dzgeorgy for identifying the bug

    🧰 Maintenance

    • Update dependency com.benasher44:uuid to v0.6.0 (#398)
    Source code(tar.gz)
    Source code(zip)
  • 0.20.0(Nov 8, 2022)

    Logo Android

    • Use shared bluetooth state BroadcastReceiver (#369), thanks to @nverinaud for reporting the issue and verifying the fix

    Logo Apple

    • Add support for scan options (#392), special thanks to @robvs for the contribution

    🧰 Maintenance

    • Update dependency org.jetbrains.kotlin.multiplatform to v1.7.20 (#383)
    • Update plugin dokka to v1.7.20 (#391)
    • Update JamesIves/github-pages-deploy-action action to v4.4.1 (#389)
    • Update plugin android-library to v7.3.1 (#390)
    Source code(tar.gz)
    Source code(zip)
  • 0.19.0(Oct 11, 2022)

    • Surface bluetooth device name (#384)

    Logo Apple

    • Fix empty NSData crash (#388), special thanks to @joharei for the contribution

    Logo JavaScript

    • Enforce lowercase UUIDs for Web BLE filters (#385)

    🧰 Maintenance

    • Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.18.4 (#386)
    • Update plugin maven-publish to v0.22.0 (#381)
    • Update plugin android-library to v7.3.0 (#379)
    • Update plugin kotlinter to v3.12.0 (#345)
    Source code(tar.gz)
    Source code(zip)
  • 0.18.1(Sep 13, 2022)

    • Reset observation state on connect if there are no subscribers (#368), thanks to @francismariano for reporting and @ebabel for verifying the fix
    • Simplify toString representation of State (#364), special thanks to @ebabel for the contribution

    🧰 Maintenance

    • Configure release drafter for auto versioning (#373)
    • Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.18.3 (#361)
    • Update dependency gradle to v7.5.1 (#372)
    • Update plugin android-library to v7.2.2 (#370)
    • Update JamesIves/github-pages-deploy-action action to v4.4.0 (#362)
    • Update dependency gradle to v7.5 (#363)
    • Simplify CI by only running on MacOS (#360)
    Source code(tar.gz)
    Source code(zip)
  • 0.18.0(Jul 15, 2022)

    🚀 Changes

    Android

    • Add property for retrieving raw bytes of scan record (#357), special thanks to @kemalfaust for the contribution

    🧰 Maintenance

    • Update plugin dokka to v1.7.10 (#353)
    • Update plugin maven-publish to v0.21.0 (#355)
    • Update coroutines to v1.6.4 (#352)
    • Update tuulbox to v6.3.0 (#350)
    • Update dependency com.benasher44:uuid to v0.5.0 (#354)
    • Update dependency org.jetbrains.kotlin.multiplatform to v1.7.10 (#351)
    • Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.18.2 (#348)
    • Update JamesIves/github-pages-deploy-action action to v4.3.4 (#346)
    • Use Temurin 11 JDK for CI (#347)
    Source code(tar.gz)
    Source code(zip)
  • 0.17.2(Jun 29, 2022)

    🚀 Changes

    Apple

    • Add macosArm64 target to log-engine-tuulbox (#343)

    JavaScript

    • Log characteristic write type on JavaScript (#329)

    🧰 Maintenance

    • Update coroutines to v1.6.3 (#333)
    • Update plugin dokka to v1.7.0 (#344)
    • Update dependency com.benasher44:uuid to v0.4.1 (#338)
    • Update dependency org.jetbrains.kotlin.multiplatform to v1.7.0 (#340)
    • Update plugin maven-publish to v0.20.0 (#336)
    • Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.17.3 (#330)
    • Update plugin android-library to v7.2.1 (#328, #331)
    Source code(tar.gz)
    Source code(zip)
  • 0.17.1(May 6, 2022)

  • 0.17.0(Apr 27, 2022)

    🚀 Changes

    Android

    • Throw BluetoothDisabledException instead of IllegalStateException on scan (#323)

    🧰 Maintenance

    • Update JamesIves/github-pages-deploy-action action to v4.3.3 (#321, #324)
    • Update dependency co.touchlab:stately-iso-collections to v1.2.3 (#317, #322)
    • Update plugin kotlin-multiplatform to v1.6.21 (#318)
    • Update plugin dokka to v1.6.20 (#316)
    Source code(tar.gz)
    Source code(zip)
  • 0.16.1(Apr 13, 2022)

    🚀 Changes

    Android

    • Retry service discovery if no services are discovered (#304)

    Apple

    • Fix write "without response" support (#312), thanks to @renatosmf for reporting the issue
    • Fix Peripheral state not updating upon connection (#300), special thanks to @burnhamd for the contribution
    • Check bluetooth state prior to connecting (#291, #310), special thanks to @burnhamd for the contribution

    🧰 Maintenance

    • Update plugin kotlinter to v3.10.0 (#306)
    • Remove SNAPSHOT publication (#309)
    • Update plugin kotlin-multiplatform to v1.6.20 (#296)
    • Update org.jetbrains.kotlinx to v1.6.1 (#301)
    • Update plugin android-library to v7.1.3 (#305)
    • Update JamesIves/github-pages-deploy-action action to v4.3.0 (#302)
    • Update dependency gradle to v7.4.2 (#294)
    Source code(tar.gz)
    Source code(zip)
  • 0.16.0(Mar 30, 2022)

    🚀 Changes

    • Escalate deprecations (#289)
    • Propagate observation rewire failures during connection as reconnection failures (#285)

    ⚠ī¸ Behavior change: A failure to spin-up observations on connect will no longer propagate failures to the corresponding observation flows. Instead, the failure will propagate through the Peripheral.connect function and cancel the underlying connection — leaving observation flows in an active state. See Peripheral.kt KDoc documentation for more details.

    Android & Apple

    • Add ability to create peripheral from identifier (#280), special thanks to @burnhamd for the contribution

    Android

    • Update Android Gradle configuration and set target API to 30 (#284)

    Apple

    • Add disconnect to Apple peripheral when CBCentralManager turns off (#287), special thanks to @burnhamd for the contribution

    🧰 Maintenance

    • Update com.juul.tuulbox to v6.2.0 (#292)
    • Update actions/cache action to v3 (#283)
    Source code(tar.gz)
    Source code(zip)
  • 0.15.0(Mar 17, 2022)

    🚀 Changes

    • Add Apple Silicon support (#209), special thanks to @lammertw for the contribution
      • iOS was already supported but this version adds support for arm64 (e.g. Apple silicon such as M1) for the following targets:
        • JavaScript
        • MacOS
        • iOS simulators
    Source code(tar.gz)
    Source code(zip)
  • 0.14.2(Mar 14, 2022)

    🚀 Changes

    Javascript

    • Wrap DOMException (#274)
    • Refactor Javascript Connect/Disconnect (#255)

    🧰 Maintenance

    • Update com.juul.tuulbox to v6.0.1 (#271, #279)
    • Update dependency gradle to v7.4.1 (#276)
    • Automatically close/release on publication to Sonatype (#275)
    • Update actions/checkout action to v3 (#273)
    • Update plugin maven-publish to v0.19.0 (#272)
    • Drop Kotlin/JS extensions and use internal jso instead (#269)
    • Update actions/setup-java action to v3 (#270)
    • Update plugin android-library to v7.1.2 (#268)
    Source code(tar.gz)
    Source code(zip)
  • 0.14.1(Feb 22, 2022)

    🚀 Changes

    Apple

    • Remove explicit freezes on Native (#265)

    🐛 Bug Fixes

    • Properly propagate observation cancellations (#266)

    Fixes regression in 0.14.0 that caused cancellations of observe flows to be routed through the observation exception handler (rather than allowing the flow to cancel normally).

    🧰 Maintenance

    • Update plugin kotlinter to v3.9.0 (#267)
    • Update JamesIves/github-pages-deploy-action action to v4.2.5 (#263)
    Source code(tar.gz)
    Source code(zip)
  • 0.14.0(Feb 17, 2022)

    🚀 Changes

    🧰 Maintenance

    • Update dependency org.jetbrains.kotlin-wrappers:kotlin-extensions to v1.0.1-pre.299-kotlin-1.6.10 (#257, #261, #262)
    • Update plugin android-library to v7.1.1 (#248)
    • Update dependency androidx.startup:startup-runtime to v1.1.1 (#260)
    • Update dependency gradle to v7.4 (#259)
    • Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.17.1 (#258)
    Source code(tar.gz)
    Source code(zip)
  • 0.13.0(Feb 4, 2022)

    🚀 Changes

    • Make services direct references and match properties for I/O (#238), special thanks to @solvek for reporting the issue and providing inspiration for the implementation

    ℹī¸ Note: This is a potentially breaking change for users of peripherals that have incorrect (or missing) characteristic properties: characteristicOf will now only match characteristics with the expected property; in other words, when performing characteristic I/O, the following properties must be on the characteristic:

    | Characteristic action | Required property | |-|-| | read(..) | read | | write(.., WithResponse) | write | | write(.., WithoutReponse) | writeWithoutResponse | | observe(..) | notify or indicate |

    If a sought after characteristic does not have the required property, then NoSuchElementException will be thrown at the time of the I/O operation. If you're communicating with a peripheral that has incorrect (or missing) characteristic properties, then you'll need to manually traverse the Peripheral.services to locate the desired Characteristic to perform I/O against.

    See I/O documentation for more details.

    🧰 Maintenance

    • Update dependency org.jetbrains.kotlin-wrappers:kotlin-extensions to v1.0.1-pre.293-kotlin-1.6.10 (#247, #249, #253)
    • Update JamesIves/github-pages-deploy-action action to v4.2.3 (#252)
    Source code(tar.gz)
    Source code(zip)
  • 0.12.0(Jan 18, 2022)

    🚀 Changes

    • Optimize observation handling (#193)
      • Should fix intermittent GattRequestRejectedExceptions on connection loss
      • Peripheral.state is now exposed as a StateFlow (was previously a Flow)

    🐛 Bug Fixes

    Apple

    • Fix reconnect after a disconnect (#246), thanks to @TSkovsgaard for reporting

    🧰 Maintenance

    • Update dependency com.juul.tuulbox:logging to v5.1.0 (#244)
    • Update dependency com.benasher44:uuid to v0.4.0 (#245)
    Source code(tar.gz)
    Source code(zip)
  • 0.11.0(Jan 12, 2022)

    🚀 Changes

    Built against Kotlin 1.6.10.

    Android

    • Add manufacturer data scan filters (#191, #235), special thanks to @mtrewartha for the contribution

    Apple

    • Check scanning state before stopping (#240), thanks to @ln-12 for reporting the issue

    🧰 Maintenance

    • Update dependency org.jetbrains.kotlin-wrappers:kotlin-extensions to v1.0.1-pre.290-kotlin-1.6.10 (#227, #231, #234)
    • Replace usages of deprecated jsObject with jso (#241)
    • Update org.jetbrains.kotlinx to v1.6.0 (#229)
    • Update JamesIves/github-pages-deploy-action action to v4.2.2 (#221, #236, #242)
    • Update plugin dokka to v1.6.10 (#217, #232)
    • Update dependency gradle to v7.3.3 (#211, #228)
    • Update plugin kotlinter to v3.8.0 (#218, #224)
    • Update dependency com.juul.tuulbox:logging to v5 (#225)
    • Categorize release drafts (#223)
    • Update dependency co.touchlab:stately-isolate to v1.2.1 (#214, #222)
    • Update plugin android-library to v7 (#220)
    • Update dependency org.jetbrains.kotlinx:atomicfu-jvm to v0.17.0 (#215)
    • Update plugin kotlin-multiplatform to v1.6.10 (#213)
    • Update plugin maven-publish to v0.18.0 (#219)
    Source code(tar.gz)
    Source code(zip)
  • 0.10.4(Dec 13, 2021)

    🐛 Bug Fixes

    Android

    • Keep BLE threads alive until Peripheral is disposed (#197)

    JavaScript

    • Handle UUID aliases during service discovery (#207)

    Common

    • Bump Kotlin to 1.6.0 and use hierarchical project structure (#63)
    Source code(tar.gz)
    Source code(zip)
  • 0.10.3(Nov 2, 2021)

    🐛 Bug Fixes

    Android

    • Improve Advertising Robustness (#187)
    • Throw GattRequestRejectedException when characteristic notification fails (#180)

    JavaScript

    • Fix connection state stall (#186)
    • Move entire service discovery inside I/O lock (#181)

    Common

    • Fix KDoc for exception thrown while searching services (#182)
    Source code(tar.gz)
    Source code(zip)
  • 0.10.2(Oct 13, 2021)

    🐛 Bug Fixes

    Android

    • Improve discoverServices threading (#172)

    JavaScript

    • Prevent cancellation of notification processing (#174)
    • Fix bug with observe onSubscription parameter not being called (#171)
    Source code(tar.gz)
    Source code(zip)
  • 0.10.1(Oct 1, 2021)

  • 0.10.0(Sep 10, 2021)

  • 0.9.2(Aug 30, 2021)

    See 0.9.0 release notes for details on the new connection state behavior.

    🐛 Bug Fixes

    • Fix characteristic observations on Apple and JavaScript targets (#155)

    | Platform | Peripheral.observe status | |-|:-:| | Android | ✅  Works | | Apple | ✅  Works | | JavaScript | ✅  Works |

    Source code(tar.gz)
    Source code(zip)
  • 0.9.1(Aug 29, 2021)

    🐛 Bug Fixes

    • Android observe should suspend until Connecting.Observes OR Connected (#154)

    | Platform | Peripheral.observe status | |-|:-:| | Android | ✅  Works | | Apple | ⚠ī¸Â  Broken | | JavaScript | ⚠ī¸Â  Broken |

    Source code(tar.gz)
    Source code(zip)
  • 0.9.0(Aug 28, 2021)

    ⚠ī¸ observe bug

    0.9.0 introduced a bug in observations on all platforms, preventing them from being created except during the Connecting.Observes state. This bug is fixed on Android in 0.9.1, and all platforms in 0.9.2.

    | Platform | Peripheral.observe status | |-|:-:| | Android | ⚠ī¸Â  Broken | | Apple | ⚠ī¸Â  Broken | | JavaScript | ⚠ī¸Â  Broken |

    Changes

    • Add Connecting sub-states; delay Connected state until ready (#153), thanks to @francismariano for reporting the issue

    Peripheral connection states have been updated, the Connecting State is now split into the following sub-states:

    • Connecting.Bluetooth
    • Connecting.Sevices
    • Connecting.Observes

    See State.kt for additional info on these states. Note that Connected is now emitted after Peripheral has gone through these 3 steps. (Connecting.Services is the timeline-equivalent of pre-0.9.0's Connected).

    Source code(tar.gz)
    Source code(zip)
  • 0.8.0(Aug 26, 2021)

  • 0.7.2(Aug 10, 2021)

  • 0.7.1(Jul 22, 2021)

    🏗ī¸ New Features

    • Add iosArm32 support (#113), special thanks to @Jahor for the contribution

    🐛 Bug Fixes

    • Fix requestPeripheral when using Kotlin/JS IR compiler (#146)
    • Only attempt to stop observation if previously observed (#145), thanks to @solvek for reporting/testing
    Source code(tar.gz)
    Source code(zip)
  • 0.7.0(Jul 12, 2021)

    • Remove dependency on native-mt version of Coroutines (#134, #140)
    • Replace usages of deprecated sendBlocking with trySendBlocking (#138)

    🏗ī¸ New Features

    • JavaScript IR Support (#126), special thanks to @KVelasco for contributing and testing

    🐛 Bug Fixes

    • Handle peripheral initiated MTU changes (#135), thanks to @mediaController for reporting the issue
    • Handle bluetooth adapter state changes (#133, #137), special thanks to @cedrickcooke for contributing and @wrsx for reporting/testing

    Note: -native-mt Coroutines is no longer configured as a transitive dependency. If you are using Kable on Native (e.g. Apple) targets, please update your Gradle configuration accordingly; refer to updated example configuration in README for guidance.

    Source code(tar.gz)
    Source code(zip)
  • 0.6.0(Jun 25, 2021)

    • Route observation re-wiring exceptions through observe Flows (#120)
    • Bump dependency versions (#100)
      • Kotlin 1.5.10
      • Coroutines 1.5.0

    🏗ī¸ New Features

    • Add support for service filtering during scanning (#117), special thanks to @burnhamd for the contribution
    • Support requesting connection priority on Android (#125), thanks to @mtrewartha for testing
    • Support constructing Peripherals using builder lambda (#108)

    🐛 Bug Fixes

    • Only write indicate or notify to CCCD on Android (#121), thanks to @nspeeD for reporting and debugging
    • Propagate early characteristic changes (#110), thanks to @Devinete for reporting and debugging
    Source code(tar.gz)
    Source code(zip)
BLESSED Coroutines, a Bluetooth Low Energy (BLE) library for Android using Kotlin Coroutines

BLESSED for Android with Coroutines - BLE made easy BLESSED is a very compact Bluetooth Low Energy (BLE) library for Android 8 and higher, that makes

Martijn van Welie 82 Jan 1, 2023
An Android Library for handling Bluetooth Low Energy on Android Easy

An Android Library for handling Bluetooth Low Energy on Android Easy

Leandro SQ 42 Jan 3, 2023
An Android library that solves a lot of Android's Bluetooth Low Energy problems

A library that makes working with Bluetooth LE on Android a pleasure. Seriously.

Nordic Semiconductor 1.4k Jan 7, 2023
[UNMAINTAINED][Android] Bluetooth Serial Port Profile which comfortable to developer application to communication with microcontroller via bluetooth

⚠ WARNING: This project is no longer being maintained Android-BluetoothSPPLibrary Bluetooth Serial Port Profile which comfortable to developer applica

Akexorcist 1.7k Dec 31, 2022
Android Bluetooth Helper Library, Bluetooth Device Finder

Bluetooth Helper Allows you to access the Bluetooth of your mobile device, manage turn-on - turn off, and discover bluetooth devices around you. Getti

Tolga Bolatcan 44 Jul 15, 2022
A Bluetooth kotlin multiplatform "Cross-Platform" library for iOS and Android

Blue-Falcon A Bluetooth "Cross Platform" Kotlin Multiplatform library for iOS, Android, MacOS, Raspberry Pi and Javascript. Bluetooth in general has t

Andrew Reed 220 Dec 28, 2022
This library allows for easy access to a Bluetooth LE device's AdRecord and RSSI value. It offers additional functionality for iBeacons.

Bluetooth LE Library for Android This library allows for easy access to a Bluetooth LE device's Advertisement Records. It also offers: A simple runnin

Alexandros Schillings 843 Dec 13, 2022
Smooth communication via bluetooth with other android devices or microcontrollers such as Arduino.

Android Smooth Bluetooth Smooth communication via bluetooth with other android devices or microcontrollers such as Arduino. Getting Started Add Gradle

Mantas Palaima 191 Nov 28, 2022
A reactive, interface-driven central role Bluetooth LE library for Android

RxCentralBle RxCentralBle provides a simple reactive paradigm for connecting to and communicating with Bluetooth LE peripherals from the central role.

Uber Open Source 198 Nov 29, 2022
A non-trivial Bluetooth LE app using Kable and app architecture best practices

kable_mvvm_demo The intention of this project is to demonstrate a non-trivial Bluetooth LE app using Kable and app architecture best practices. ⚠ī¸ The

Chris Laplante 14 Aug 18, 2022
BluePass extracts two factor authentication codes (2FA) from SMS and sends them to a paired device via Bluetooth RFCOMM.

BluePass extracts two factor authentication codes (2FA) from SMS and sends them to a paired device via Bluetooth RFCOMM.

Manuel Huber 15 Dec 4, 2022
Open-source weight and body metrics tracker, with support for Bluetooth scales

Open-source weight and body metrics tracker, with support for Bluetooth scales

OliE 1.3k Jan 4, 2023
Simple bluetooth flutter project

bluetooth_simple Simple bluetooth implementation. Getting Started This project is a starting point for a Flutter application. A few resources to get y

Aleksey Vasiliev 0 Nov 25, 2021
The purpose is to share the Internet capability of one device to the entire Bluetooth LAN.

bluenet The purpose is to share the Internet capability of one device to the entire Bluetooth LAN. To make a prototype of a soft bus, or actually, I w

yunlong.wen 1 Jun 28, 2022
User-friendly Lightweight TPM Remote Attestation over Bluetooth

Ultrablue Ultrablue (User-friendly Lightweight TPM Remote Attestation over Bluetooth) is a solution to allow individual users to perform boot state at

ANSSI 32 Jan 2, 2023
RxBle: Use Android Bluetooth API in Rx way

RxBle: Use Android Bluetooth API in Rx way A lightweight encapsulation of Android Bluetooth API. Use Android Bluetooth API in Rx way. Support multiple

null 3 Dec 2, 2022
kotlin android - network connection

MarsPhotos - Starter Code Starter code for Android Basics in Kotlin. Introduction Using this stater code you will create MarsPhotos is a demo app that

RICKY_SENSEI 1 Oct 25, 2022
Kotlin Asynchronous Bluetooth Low-Energy

Kable Kotlin Asynchronous Bluetooth Low Energy provides a simple Coroutines-powered API for interacting with Bluetooth Low Energy devices. Usage is de

JUUL Labs 493 Dec 25, 2022
BLESSED Coroutines, a Bluetooth Low Energy (BLE) library for Android using Kotlin Coroutines

BLESSED for Android with Coroutines - BLE made easy BLESSED is a very compact Bluetooth Low Energy (BLE) library for Android 8 and higher, that makes

Martijn van Welie 82 Jan 1, 2023
An Android Library for handling Bluetooth Low Energy on Android Easy

An Android Library for handling Bluetooth Low Energy on Android Easy

Leandro SQ 42 Jan 3, 2023