android.native.buildOutput
To reduce clutter in build output, AGP 4.2 filters messages from native builds that use CMake and ndk-build, displaying only C/C++ compiler output by default. Previously, a line of output was generated for every file that was built, resulting in a large quantity of informational messages.
ndk-build
For usage information, see the release notes.
In the C++ code editor window, you can set an arbitrary execution point when running your app in the debugger. This feature is useful when you want to break out of a loop or force a different path with branching code.
To learn more, see the release notes.
This update includes fixes for the following issues:
This update also includes fixes for the following public issues:
For Kotlin apps that use coroutines, you can now use StateFlow objects as a data binding source to automatically notify the UI about changes in the data. Your data bindings will be lifecycle aware and will only be triggered when the UI is visible on the screen.
StateFlow
To use a StateFlow object with your binding class, you need to specify a lifecycle owner to define the scope of the StateFlow object, and in your layout, assign the properties and methods of your ViewModel component to the corresponding views using binding expressions, as shown in the following snippets:
ViewModel
class ViewModel() { val username: StateFlow }
<TextView android:id="@+id/name" android:text="@{viewmodel.username}" />
If you're in a Kotlin app that uses AndroidX, StateFlow support is automatically included in the functionality of data binding, including the coroutines dependencies.
To learn more, see the user guide.