I got error below if the device clock is behind. In this case,it is behind 1 year (11/1/2021):

I/System.out(19047): [socket]:check permission begin!
W/System  (19047): ClassLoader referenced unknown path: system/framework/mediatek-cta.jar
I/System.out(19047): [socket] e:java.lang.ClassNotFoundException: com.mediatek.cta.CtaUtils

I am trying to get the server time offset using Firebase Database function. I am not sure whether the error relates to the Firebase Database because I already edit the security rules of the Firebase database as below:

  "rules": {
    ".read": true,
    ".write": true

I am running the apps on physical device. My code is:

final offsetRef = FirebaseDatabase.instance.ref(".info/serverTimeOffset");

// I got the error once I started running codes below
offsetRef.onValue.listen((event) {
   final offset = event.snapshot.value as num ?? 0.0;
   final estimatedServerTimeMs = DateTime.now().millisecondsSinceEpoch + offset;


    xmlns:android="http://schemas.android.com/apk/res/android" xmlns:tools="http://schemas.android.com/tools" package="com.example.app">

    <uses-permission android:name="android.permission.INTERNET"/>
    <uses-permission android:name="android.permission.VIBRATE"/>
    <uses-permission android:name="android.permission.RECEIVE_BOOT_COMPLETED"/>
    <uses-permission android:name="android.permission.ACCESS_NETWORK_STATE"/>
    <uses-permission android:name="android.permission.ACCESS_WIFI_STATE"/>

Trả lời

Email của bạn sẽ không được hiển thị công khai. Các trường bắt buộc được đánh dấu *