Version 3.0 of the Kotlin SDK contains breaking changes. Most of them surface as Gradle sync or compile errors, so work through the steps below in order and rebuild after each one.
- Update the BOM
- Declare libraries you use directly
- Update error handling
- Replace
copy()and destructuring - Remove references to types and icons that are no longer available
Update the BOM
You're affected if your app uses any SDK module.
Raise the platform-bom version to 3.+. The BOM sets the version of every SDK module, so declare
the modules without a version of their own:
build.gradle.kts
Keep only the modules your app uses. If your app pins a version on an individual module, remove it and let the BOM set it, so the modules stay on the same release.
Declare libraries you use directly
You're affected if your app uses Koin, androidx.collection:collection, or the Compose
material3, foundation, material-ripple, animation, or animation-core libraries without
declaring them directly.
These libraries are no longer exposed through the SDK's compile dependencies. Code that relies on
those dependencies stops compiling until you declare them directly. The foundation-layout library
remains exposed through platform-ui, so imports such as PaddingValues are unaffected. Add only
the libraries your app imports:
build.gradle.kts
Update error handling
You're affected if your app checks the reason of a YouVersionNetworkException.
CANNOT_DOWNLOADis renamed toREQUEST_FAILED, andINVALID_DOWNLOADis removed.- Failed responses now report a more specific reason:
RATE_LIMITEDandSERVER_ERRORfor failures a later retry may fix, andREQUEST_REJECTEDfor requests the server won't accept. Reasonis now a class instead of an enum, and more reasons may be added in later releases. Awhenoverreasonneeds anelsebranch, and enum members such asname,ordinal,values(), andentriesare gone. UsetoString()to log a reason.- Requesting a data exchange token for a user whose sign-in is no longer accepted now fails with
MISSING_AUTHENTICATIONinstead ofNOT_PERMITTED.NOT_PERMITTEDstill means the user hasn't granted the permission.
The following fragments show how to update search error handling. For search, NOT_PERMITTED
indicates an app key configuration or access problem. For user-authenticated operations, it can
indicate a missing user permission instead.
Before:
Code
After:
Code
See the search guide's error handling section for search failure reasons and how long to wait before retrying.
Replace copy() and destructuring
You're affected if your app calls copy() on an SDK model or destructures one.
SDK models are no longer Kotlin data classes, so they have no copy() or componentN()
functions. Value equality is preserved.
Replace destructuring with property access:
Code
Replace copy() by building the new value from the properties you need. For example, to move a
BibleReference to another Bible version, where you previously called
reference.copy(versionId = newId):
Code
BibleTextNode.text and BibleTextNode.children are now read-only, and children is a List.
No longer available
You're affected if your app references an SDK type, model constructor, or drawable that is no longer public. The compiler names each one, and the 3.0.0 breaking changes in the changelog list them all.
- Internal types: types that support the SDK's own components, such as
HighlightChange,PendingHighlightOperation, andBibleVersionsViewModel.State, are no longer public. Remove references to them. - Model constructors: your app can no longer construct the models the SDK returns, such as
BibleVersionorSearchResults. Types you create as input, such asBibleReferenceandSearchUserIntent, keep their public constructors. - Drawables: the SDK no longer ships drawable resources, so if your app references an
R.drawablefrom the SDK, add your own asset instead.