Upgrade firebase-dataconnect version to 16.0.0-beta03 (was 16.0.0-beta02) #2539
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR upgrades the
firebase-dataconnectdependency to version to16.0.0-beta03(https://firebase.google.com/support/release-notes/android#data-connect_v16-0-0-beta03) from16.0.0-beta02.This upgrade is a breaking change and requires Data Connect toolkit version 1.7.0 or later, which is available in firebase-tools version 13.25.0 (https://firebase.google.com/support/release-notes/cli#version_13250_-_november_12_2024). The breaking change is that the code generation for
DateGraphQL fields and variables uses the newcom.google.firebase.dataconnect.LocalDateclass instead ofjava.util.Date. This new class has functions to convert it tojava.time.LocalDateandkotlinx.datetime.LocalDate.Since
java.time.LocalDatewas added to the Android standard library in API 26, special case must be taken if your application's version has aminSdkVersionless than 26. The options to usejava.time.LocalDatein such an application are:com.google.firebase.dataconnect.LocalDate, without converting it tojava.time.LocalDate.java.timepackage inside aif (Build.VERSION.SDK_INT >= Build.VERSION_CODES.O)block.java.time.LocalDateclass available all the way back to API 21 (theminSdkVersiondefined in thefirebase-dataconnectmodule).Also note that using
kotlinx.datetime.LocalDaterequires your application to take a dependency on the "kotlinx-datetime" library by addingimplementation("org.jetbrains.kotlinx:kotlinx-datetime:0.6.1")to thedependenciessection of your "app" module'sbuild.gradleorbuild.gradle.kts. In addition, thekotlinx-datetimelibrary usesjava.timeunder the hood, so has the same restrictions and requires the same mitigation strategies mentioned above.