Skip to content

Commit aab8e29

Browse files
authored
fix: make sure that amplitude is built before writing on storage (#274)
1 parent c1f7ab5 commit aab8e29

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

android/src/main/java/com/amplitude/android/utilities/DefaultEventUtils.kt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -53,6 +53,9 @@ class DefaultEventUtils(private val amplitude: Amplitude) {
5353

5454
// Write the current version/build into persistent storage
5555
amplitude.amplitudeScope.launch(amplitude.storageIODispatcher) {
56+
// wait until it is built before writing to storage
57+
amplitude.isBuilt.await()
58+
5659
storage.write(Storage.Constants.APP_VERSION, currentVersion)
5760
storage.write(Storage.Constants.APP_BUILD, currentBuild)
5861
}

0 commit comments

Comments
 (0)