braze-inc / braze-flutter-sdk

Public repo for the Braze Flutter SDK
Other
15 stars 28 forks source link

Android DateTimeUtils error #67

Open RyanMcManus10 opened 1 month ago

RyanMcManus10 commented 1 month ago

Bug I'm getting a lot of screen rebuilds on android, when debugging I can see that Braze is failing because of a DateTimeUtils error, the logs are constantly looping through this error:

E/Braze v30.3.0 .DateTimeUtils( 1737): Error reading date and time from network. Using system time instead. E/Braze v30.3.0 .DateTimeUtils( 1737): java.time.DateTimeException: Missing network time fix E/Braze v30.3.0 .DateTimeUtils( 1737): at java.lang.reflect.Constructor.newInstance0(Native Method) E/Braze v30.3.0 .DateTimeUtils( 1737): at java.lang.reflect.Constructor.newInstance(Constructor.java:343) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.ParcelableException.readFromParcel(ParcelableException.java:56) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.ParcelableException$1.createFromParcel(ParcelableException.java:82) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.ParcelableException$1.createFromParcel(ParcelableException.java:79) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.Parcel.readParcelableInternal(Parcel.java:5015) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.Parcel.readParcelable(Parcel.java:4997) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.Parcel.createExceptionOrNull(Parcel.java:3177) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.Parcel.createException(Parcel.java:3166) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.Parcel.readException(Parcel.java:3149) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.Parcel.readException(Parcel.java:3091) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.app.timedetector.ITimeDetectorService$Stub$Proxy.latestNetworkTime(ITimeDetectorService.java:463) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.SystemClock.currentNetworkTimeMillis(SystemClock.java:345) E/Braze v30.3.0 .DateTimeUtils( 1737): at android.os.SystemClock$3.millis(SystemClock.java:392) E/Braze v30.3.0 .DateTimeUtils( 1737): at com.braze.support.DateTimeUtils.nowInMilliseconds(SourceFile:4) E/Braze v30.3.0 .DateTimeUtils( 1737): at bo.app.c5.a(SourceFile:19) E/Braze v30.3.0 .DateTimeUtils( 1737): at bo.app.c5$g.invokeSuspend(SourceFile:4) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:108) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlinx.coroutines.internal.LimitedDispatcher$Worker.run(LimitedDispatcher.kt:115) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:103) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:584) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:793) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:697) E/Braze v30.3.0 .DateTimeUtils( 1737): at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:684)

Flutter Doctor -v output Flutter (Channel stable, 3.16.6, on macOS 14.3.1 23D60 darwin-arm64, locale en-US) • Flutter version 3.16.6 on channel stable at /Users/example/Development/flutter • Upstream repository https://github.com/flutter/flutter.git • Framework revision 46787ee49c (3 months ago), 2024-01-09 14:36:07 -0800 • Engine revision 3f3e560236 • Dart version 3.2.3 • DevTools version 2.28.4

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) • Android SDK at /Users/example/Library/Android/sdk • Platform android-34, build-tools 34.0.0 • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314) • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.3) • Xcode at /Applications/Xcode.app/Contents/Developer • Build 15E204a • CocoaPods version 1.14.3

[✓] Chrome - develop for the web • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2023.1) • Android Studio at /Applications/Android Studio.app/Contents • Flutter plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/9212-flutter • Dart plugin can be installed from: 🔨 https://plugins.jetbrains.com/plugin/6351-dart • Java version OpenJDK Runtime Environment (build 17.0.7+0-17.0.7b1000.6-10550314)

[✓] VS Code (version 1.87.2) • VS Code at /Applications/Visual Studio Code.app/Contents • Flutter extension version 3.84.0

bryanlogan commented 1 month ago

What device are you running this on? That error is indicating that the device doesn't have a NTP time sync'd, so it's falling back to the device's local time. I'll get a fix in so that isn't spamming.

I don't believe this should cause screen rebuilding.

CocoaJerry commented 4 weeks ago

I got this error also, I'm using pixel 7 api 34 simulator and the braze_plugin version is 8.2.0, and it usually threw this error on my android mobile(honor 30)

I used the logCustomEvent function, and when this error occured, the other code after the function would not work

I have not test on other devices, but if still meet this error, this will affect many features of our app

radixdev commented 4 weeks ago

We have a fix internally and will update you all once that's released. Thank you for filing.

techouse commented 1 week ago

Duplicate of https://github.com/braze-inc/braze-android-sdk/issues/28

Fixed in v30.4.0 https://github.com/braze-inc/braze-android-sdk/commit/2591eb63f590742983401e3f8a666d5cacd10c4b