firebase / firebase-android-sdk

Firebase Android SDK
https://firebase.google.com
Apache License 2.0
2.29k stars 579 forks source link

Conflict with ML kit and Firestore implementation in android. #5607

Closed karthikbs27 closed 10 months ago

karthikbs27 commented 11 months ago

I am working on an android native app development using koltin, jetpack compose. Below is the environment detail.

    id 'com.android.application' version '8.0.2' apply false
    id 'com.android.library' version '8.0.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.9.10' apply false
    id 'com.google.dagger.hilt.android' version '2.49' apply false
    id 'org.jetbrains.kotlin.jvm' version '1.8.20' apply false
    id 'com.google.gms.google-services' version '4.4.0' apply false
plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'kotlin-kapt'
    id 'com.google.dagger.hilt.android'
    id 'com.google.gms.google-services'
}

android {
    namespace 'com.example.appr'
    compileSdk 34

    defaultConfig {
        applicationId "com.unriddle.paper"
        minSdk 24
        targetSdk 34
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
        vectorDrawables {
            useSupportLibrary true
        }
    }

    buildTypes {
        release {
            debuggable false
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
        debug {
            debuggable true
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_17
        targetCompatibility JavaVersion.VERSION_17
    }
    kotlinOptions {
        jvmTarget = '17'
    }
    buildFeatures {
        compose true
    }
    composeOptions {
        kotlinCompilerExtensionVersion '1.5.3'
    }
    packagingOptions {
        resources {
            excludes += '/META-INF/{AL2.0,LGPL2.1}'
        }
    }
}

I am facing an issue with Firestore and ML kit Digital Ink. If I have ML kit installed, firestore will not connect to the server, it throws the below warnings, with the mobile internet.

2023-12-18 14:45:01.275  8804-8804  ziparchive              com.unriddle.paper                   W  Unable to open '/data/app/~~p6HgUQgeT_3wR9ho5ATitg==/com.unriddle.paper-GraeCQoNd6MIziZx1i76_g==/base.dm': No such file or directory
2023-12-18 14:45:01.275  8804-8804  ziparchive              com.unriddle.paper                   W  Unable to open '/data/app/~~p6HgUQgeT_3wR9ho5ATitg==/com.unriddle.paper-GraeCQoNd6MIziZx1i76_g==/base.dm': No such file or directory
2023-12-18 14:45:02.014  8804-8804  nativeloader            com.unriddle.paper                   D  Configuring clns-4 for other apk /data/app/~~p6HgUQgeT_3wR9ho5ATitg==/com.unriddle.paper-GraeCQoNd6MIziZx1i76_g==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~p6HgUQgeT_3wR9ho5ATitg==/com.unriddle.paper-GraeCQoNd6MIziZx1i76_g==/lib/arm64:/data/app/~~p6HgUQgeT_3wR9ho5ATitg==/com.unriddle.paper-GraeCQoNd6MIziZx1i76_g==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.unriddle.paper
2023-12-18 14:45:02.039  8804-8804  GraphicsEnvironment     com.unriddle.paper                   V  ANGLE Developer option for 'com.unriddle.paper' set to: 'default'
2023-12-18 14:45:02.039  8804-8804  GraphicsEnvironment     com.unriddle.paper                   V  ANGLE GameManagerService for com.unriddle.paper: false
2023-12-18 14:45:02.039  8804-8804  GraphicsEnvironment     com.unriddle.paper                   V  Updatable production driver is not supported on the device.
2023-12-18 14:45:02.047  8804-8804  NetworkSecurityConfig   com.unriddle.paper                   D  No Network Security Config specified, using platform default
2023-12-18 14:45:02.049  8804-8804  NetworkSecurityConfig   com.unriddle.paper                   D  No Network Security Config specified, using platform default
2023-12-18 14:45:02.068  8804-8804  Compatibil...geReporter com.unriddle.paper                   D  Compat change id reported: 183155436; UID 10511; state: ENABLED
2023-12-18 14:45:02.103  8804-8804  FirebaseApp             com.unriddle.paper                   I  Device unlocked: initializing all Firebase APIs for app [DEFAULT]
2023-12-18 14:45:02.121  8804-8804  FirebaseInitProvider    com.unriddle.paper                   I  FirebaseApp initialization successful
2023-12-18 14:45:02.130  8804-8804  DIRecoRegistrar         com.unriddle.paper                   D  DigitalInkRecognitionRegistrar.getComponents()
2023-12-18 14:45:02.144  8804-8804  WM-WrkMgrInitializer    com.unriddle.paper                   D  Initializing WorkManager with default configuration.
2023-12-18 14:45:02.164  8804-8859  DynamiteModule          com.unriddle.paper                   I  Considering local module com.google.android.gms.measurement.dynamite:97 and remote module com.google.android.gms.measurement.dynamite:97
2023-12-18 14:45:02.164  8804-8859  DynamiteModule          com.unriddle.paper                   I  Selected local version of com.google.android.gms.measurement.dynamite
2023-12-18 14:45:02.251  8804-8865  Compatibil...geReporter com.unriddle.paper                   D  Compat change id reported: 160794467; UID 10511; state: ENABLED
2023-12-18 14:45:02.344  8804-8874  FA                      com.unriddle.paper                   I  App measurement initialized, version: 82001
2023-12-18 14:45:02.344  8804-8874  FA                      com.unriddle.paper                   I  To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
2023-12-18 14:45:02.344  8804-8874  FA                      com.unriddle.paper                   I  To enable faster debug mode event logging run:
                                                                                                      adb shell setprop debug.firebase.analytics.app com.unriddle.paper
2023-12-18 14:45:03.144  8804-8804  DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager()
2023-12-18 14:45:03.182  8804-8928  TransportR...oScheduler com.unriddle.paper                   D  Scheduling upload for context TransportContext(cct, VERY_LOW, MSRodHR3JtYXQ9anNvbl9wcm90bzNc) with jobId=66397297 in 86400000ms(Backend next call timestamp 0). Attempt 1
2023-12-18 14:45:03.183  8804-8928  Compatibil...geReporter com.unriddle.paper                   D  Compat change id reported: 194532703; UID 10511; state: ENABLED
2023-12-18 14:45:03.230  8804-8804  MddModelManager         com.unriddle.paper                   I  Start initialization
2023-12-18 14:45:03.232  8804-8932  DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager.initialize(): Parse Manifest
2023-12-18 14:45:03.232  8804-8932  DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionManifestParser.parseManifest()
2023-12-18 14:45:03.276  8804-8804  MLKD.ModelManager       com.unriddle.paper                   I  Model set for language 'en-IN' ('com.google.mlkit.vision.digitalink.DigitalInkRecognitionModelIdentifier@13b2a80c.languageTag').
2023-12-18 14:45:03.276  8804-8804  MLKD.StrokeManager      com.unriddle.paper                   I  status: Model set for language: en-IN
2023-12-18 14:45:03.278  8804-8804  MLKD.ModelManager       com.unriddle.paper                   I  Model set for language 'en-IN-x-gesture' ('com.google.mlkit.vision.digitalink.DigitalInkRecognitionModelIdentifier@30e0ea10.languageTag').
2023-12-18 14:45:03.281  8804-8804  MLKD.Langu...delManager com.unriddle.paper                   D  checken-IN
2023-12-18 14:45:03.281  8804-8804  MddModelManager         com.unriddle.paper                   I  isModelDownloadedAndValid()
2023-12-18 14:45:03.343  8804-8804  Compatibil...geReporter com.unriddle.paper                   D  Compat change id reported: 237531167; UID 10511; state: DISABLED
2023-12-18 14:45:03.344  8804-8874  FA                      com.unriddle.paper                   I  Tag Manager is not found and thus will not be used
2023-12-18 14:45:03.357  8804-8867  Parcel                  com.unriddle.paper                   W  Expecting binder but got null!
2023-12-18 14:45:03.382  8804-8804  Choreographer           com.unriddle.paper                   I  Skipped 72 frames!  The application may be doing too much work on its main thread.
2023-12-18 14:45:03.585  8804-8932  DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionManifestParser.parseManifestFromAsset(): read 808 manifest entries
2023-12-18 14:45:03.585  8804-8932  DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager.initialize(): Parse packmapping
2023-12-18 14:45:03.699  8804-8932  DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager.initialize(): Read 725 pack mapping entries
2023-12-18 14:45:03.700  8804-8945  MddModelManager         com.unriddle.paper                   I  modelRegister initialized: true
2023-12-18 14:45:03.700  8804-8945  DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager: getAllFileGroupNames(). # Entries = 725
2023-12-18 14:45:03.796  8804-8804  .unriddle.paper         com.unriddle.paper                   W  Method boolean androidx.compose.runtime.snapshots.SnapshotStateList.conditionalUpdate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
                                                                                                    Common causes for lock verification issues are non-optimized dex code
                                                                                                    and incorrect proguard optimizations.
2023-12-18 14:45:03.796  8804-8804  .unriddle.paper         com.unriddle.paper                   W  Method java.lang.Object androidx.compose.runtime.snapshots.SnapshotStateList.mutate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
2023-12-18 14:45:03.796  8804-8804  .unriddle.paper         com.unriddle.paper                   W  Method void androidx.compose.runtime.snapshots.SnapshotStateList.update(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
2023-12-18 14:45:03.810  8804-8955  DynamiteModule          com.unriddle.paper                   W  Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
2023-12-18 14:45:03.819  8804-8955  DynamiteModule          com.unriddle.paper                   I  Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
2023-12-18 14:45:03.819  8804-8955  ProviderInstaller       com.unriddle.paper                   W  Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
2023-12-18 14:45:03.852  8804-8955  nativeloader            com.unriddle.paper                   D  Configuring clns-5 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:45:03.865  8804-8955  nativeloader            com.unriddle.paper                   D  Configuring clns-6 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:45:03.870  8804-8955  .unriddle.paper         com.unriddle.paper                   W  Loading /data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@framework@com.android.location.provider.jar@classes.odex non-executable as it requires an image which we failed to load
2023-12-18 14:45:03.875  8804-8955  nativeloader            com.unriddle.paper                   D  Configuring clns-7 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:45:03.889  8804-8955  nativeloader            com.unriddle.paper                   D  Configuring clns-8 for other apk /data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:45:03.917  8804-8804  lksd                    com.unriddle.paper                   D  null
2023-12-18 14:45:03.928  8804-8804  sldkfsdfs 11            com.unriddle.paper                   D  MutableState(value=Offset(0.0, 0.0))@110883005
2023-12-18 14:45:03.942  8804-8955  NativeCrypto            com.unriddle.paper                   V  Registering com/google/android/gms/org/conscrypt/NativeCrypto's 302 native methods...
2023-12-18 14:45:04.002  8804-8955  .unriddle.paper         com.unriddle.paper                   W  Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
2023-12-18 14:45:04.127  8804-8867  AdrenoGLES-0            com.unriddle.paper                   I  QUALCOMM build                   : 85da404, I46ff5fc46f
                                                                                                    Build Date                       : 11/30/20
                                                                                                    OpenGL ES Shader Compiler Version: EV031.31.04.01
                                                                                                    Local Branch                     : promo490_3_Google
                                                                                                    Remote Branch                    : 
                                                                                                    Remote Branch                    : 
                                                                                                    Reconstruct Branch               : 
2023-12-18 14:45:04.127  8804-8867  AdrenoGLES-0            com.unriddle.paper                   I  Build Config                     : S P 10.0.4 AArch64
2023-12-18 14:45:04.127  8804-8867  AdrenoGLES-0            com.unriddle.paper                   I  Driver Path                      : /vendor/lib64/egl/libGLESv2_adreno.so
2023-12-18 14:45:04.178  8804-8867  AdrenoGLES-0            com.unriddle.paper                   I  PFP: 0x016ee190, ME: 0x00000000
2023-12-18 14:45:04.213  8804-8867  AdrenoUtils             com.unriddle.paper                   W  <ReadGpuID_from_sysfs:197>: Failed to open /sys/class/kgsl/kgsl-3d0/gpu_model
2023-12-18 14:45:04.213  8804-8867  AdrenoUtils             com.unriddle.paper                   W  <ReadGpuID:221>: Failed to read chip ID from gpu_model. Fallback to use the GSL path
2023-12-18 14:45:04.236  8804-8867  OpenGLRenderer          com.unriddle.paper                   E  Unable to match the desired swap behavior.
2023-12-18 14:45:04.262  8804-8955  ProviderInstaller       com.unriddle.paper                   I  Installed default security provider GmsCore_OpenSSL
2023-12-18 14:45:04.300  8804-8824  OpenGLRenderer          com.unriddle.paper                   I  Davey! duration=2106ms; Flags=1, FrameTimelineVsyncId=200186054, IntendedVsync=606386111357978, Vsync=606387312725210, InputEventId=0, HandleInputStart=606387320960225, AnimationStart=606387320967204, PerformTraversalsStart=606387321185329, DrawStart=606388174346612, FrameDeadline=606386131857978, FrameInterval=606387320765590, FrameStartTime=16685656, SyncQueued=606388197581302, SyncStart=606388197659375, IssueDrawCommandsStart=606388197740677, SwapBuffers=606388216795210, FrameCompleted=606388218185263, DequeueBufferDuration=13906, QueueBufferDuration=586927, GpuCompleted=606388218185263, SwapBuffersCompleted=606388217981929, DisplayPresentTime=27303497949577330, CommandSubmissionCompleted=606388216795210, 
2023-12-18 14:45:04.331  8804-8804  Choreographer           com.unriddle.paper                   I  Skipped 52 frames!  The application may be doing too much work on its main thread.
2023-12-18 14:45:04.400  8804-8957  OpenGLRenderer          com.unriddle.paper                   I  Davey! duration=923ms; Flags=0, FrameTimelineVsyncId=200186128, IntendedVsync=606387395358902, Vsync=606388262646102, InputEventId=0, HandleInputStart=606388269219226, AnimationStart=606388269224591, PerformTraversalsStart=606388302950427, DrawStart=606388303568917, FrameDeadline=606388250936290, FrameInterval=606388269054955, FrameStartTime=16678600, SyncQueued=606388315883606, SyncStart=606388315938293, IssueDrawCommandsStart=606388315990897, SwapBuffers=606388317086887, FrameCompleted=606388318426835, DequeueBufferDuration=15261, QueueBufferDuration=214531, GpuCompleted=606388318426835, SwapBuffersCompleted=606388317637720, DisplayPresentTime=13229740523716713, CommandSubmissionCompleted=606388317086887, 
2023-12-18 14:45:04.442  8804-8867  OpenGLRenderer          com.unriddle.paper                   E  Unable to match the desired swap behavior.
2023-12-18 14:45:04.463  8804-8970  TrafficStats            com.unriddle.paper                   D  tagSocket(116) with statsTag=0xffffffff, statsUid=-1
2023-12-18 14:45:04.575  8804-8970  .unriddle.paper         com.unriddle.paper                   W  Accessing hidden field Ljava/net/Socket;->impl:Ljava/net/SocketImpl; (unsupported, reflection, allowed)
2023-12-18 14:45:04.870  8804-8970  .unriddle.paper         com.unriddle.paper                   W  Accessing hidden method Ljava/security/spec/ECParameterSpec;->setCurveName(Ljava/lang/String;)V (unsupported, reflection, allowed)
2023-12-18 14:45:05.189  8804-8970  TrafficStats            com.unriddle.paper                   D  tagSocket(136) with statsTag=0xffffffff, statsUid=-1
2023-12-18 14:45:05.200  8804-8951  Firestore               com.unriddle.paper                   W  (24.10.0) [WatchStream]: (1350676) Stream closed with status: Status{code=INTERNAL, description=error in frame handler, cause=java.lang.NoSuchMethodError: No interface method getBuffer()Lokio/Buffer; in class Lokio/BufferedSource; or its super classes (declaration of 'okio.BufferedSource' appears in /data/app/~~p6HgUQgeT_3wR9ho5ATitg==/com.unriddle.paper-GraeCQoNd6MIziZx1i76_g==/base.apk!classes18.dex)
                                                                                                        at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.data(OkHttpClientTransport.java:1146)
                                                                                                        at io.grpc.okhttp.internal.framed.Http2$Reader.readData(Http2.java:236)
                                                                                                        at io.grpc.okhttp.internal.framed.Http2$Reader.nextFrame(Http2.java:148)
                                                                                                        at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.run(OkHttpClientTransport.java:1105)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)
                                                                                                    }.
2023-12-18 14:45:05.205  8804-8951  Firestore               com.unriddle.paper                   W  (24.10.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Connection failed 1 times. Most recent error: Status{code=INTERNAL, description=error in frame handler, cause=java.lang.NoSuchMethodError: No interface method getBuffer()Lokio/Buffer; in class Lokio/BufferedSource; or its super classes (declaration of 'okio.BufferedSource' appears in /data/app/~~p6HgUQgeT_3wR9ho5ATitg==/com.unriddle.paper-GraeCQoNd6MIziZx1i76_g==/base.apk!classes18.dex)
                                                                                                        at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.data(OkHttpClientTransport.java:1146)
                                                                                                        at io.grpc.okhttp.internal.framed.Http2$Reader.readData(Http2.java:236)
                                                                                                        at io.grpc.okhttp.internal.framed.Http2$Reader.nextFrame(Http2.java:148)
                                                                                                        at io.grpc.okhttp.OkHttpClientTransport$ClientFrameHandler.run(OkHttpClientTransport.java:1105)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
                                                                                                        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:644)
                                                                                                        at java.lang.Thread.run(Thread.java:1012)
                                                                                                    }
                                                                                                    This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
2023-12-18 14:45:05.207  8804-8804  Firestore               com.unriddle.paper                   E  Error reading document: com.google.firebase.firestore.FirebaseFirestoreException: Failed to get document because the client is offline.
2023-12-18 14:45:05.208  8804-8804  DoctorRepository        com.unriddle.paper                   D  Error reading doctor com.google.firebase.firestore.FirebaseFirestoreException: Failed to get document because the client is offline.
2023-12-18 14:45:05.208  8804-8804  Prescripti...eViewModel com.unriddle.paper                   D  null
2023-12-18 14:45:08.247  8804-8932  MddModelManager         com.unriddle.paper                   I  registerFileGroups(): Done.
2023-12-18 14:45:08.247  8804-8932  MddModelManager         com.unriddle.paper                   I  File groups registered: true
2023-12-18 14:45:08.588  8804-8928  TransportR...EventStore com.unriddle.paper                   D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
2023-12-18 14:45:08.598  8804-8928  TransportR...oScheduler com.unriddle.paper                   D  Upload for context TransportContext(cct, VERY_LOW, MSRodHXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
2023-12-18 14:45:09.323  8804-8993  ProfileInstaller        com.unriddle.paper                   D  Installing profile for com.unriddle.paper
2023-12-18 14:45:28.341  8804-8816  .unriddle.paper         com.unriddle.paper                   I  Background concurrent copying GC freed 712304(28MB) AllocSpace objects, 27(604KB) LOS objects, 76% free, 7625KB/31MB, paused 137us,23us total 111.800ms
2023-12-18 14:45:28.346  8804-8818  System                  com.unriddle.paper                   W  A resource failed to call close. 

But I tried to fix it with a patch in gradle with the mobile internet.

configurations.all {
    resolutionStrategy {
        force 'com.squareup.okio:okio:3.7.0'
    }
}

I got the below logs

2023-12-18 14:51:47.788 10812-10812 DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager()
2023-12-18 14:51:47.885 10812-10857 TransportR...oScheduler com.unriddle.paper                   D  Scheduling upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) with jobId=66397297 in 86400000ms(Backend next call timestamp 0). Attempt 1
2023-12-18 14:51:47.886 10812-10857 Compatibil...geReporter com.unriddle.paper                   D  Compat change id reported: 194532703; UID 10511; state: ENABLED
2023-12-18 14:51:48.015 10812-10812 MddModelManager         com.unriddle.paper                   I  Start initialization
2023-12-18 14:51:48.017 10812-10860 DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager.initialize(): Parse Manifest
2023-12-18 14:51:48.017 10812-10860 DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionManifestParser.parseManifest()
2023-12-18 14:51:48.144 10812-10812 MLKD.ModelManager       com.unriddle.paper                   I  Model set for language 'en-IN' ('com.google.mlkit.vision.digitalink.DigitalInkRecognitionModelIdentifier@13b2a80c.languageTag').
2023-12-18 14:51:48.144 10812-10812 MLKD.StrokeManager      com.unriddle.paper                   I  status: Model set for language: en-IN
2023-12-18 14:51:48.149 10812-10812 MLKD.ModelManager       com.unriddle.paper                   I  Model set for language 'en-IN-x-gesture' ('com.google.mlkit.vision.digitalink.DigitalInkRecognitionModelIdentifier@30e0ea10.languageTag').
2023-12-18 14:51:48.156 10812-10812 MLKD.Langu...delManager com.unriddle.paper                   D  checken-IN
2023-12-18 14:51:48.156 10812-10812 MddModelManager         com.unriddle.paper                   I  isModelDownloadedAndValid()
2023-12-18 14:51:48.307 10812-10812 Compatibil...geReporter com.unriddle.paper                   D  Compat change id reported: 237531167; UID 10511; state: DISABLED
2023-12-18 14:51:48.322 10812-10846 FA                      com.unriddle.paper                   I  Tag Manager is not found and thus will not be used
2023-12-18 14:51:48.324 10812-10843 Parcel                  com.unriddle.paper                   W  Expecting binder but got null!
2023-12-18 14:51:48.381 10812-10812 Choreographer           com.unriddle.paper                   I  Skipped 182 frames!  The application may be doing too much work on its main thread.
2023-12-18 14:51:49.289 10812-10860 DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionManifestParser.parseManifestFromAsset(): read 808 manifest entries
2023-12-18 14:51:49.289 10812-10860 DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager.initialize(): Parse packmapping
2023-12-18 14:51:49.466 10812-10812 .unriddle.paper         com.unriddle.paper                   W  Method boolean androidx.compose.runtime.snapshots.SnapshotStateList.conditionalUpdate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
                                                                                                    Common causes for lock verification issues are non-optimized dex code
                                                                                                    and incorrect proguard optimizations.
2023-12-18 14:51:49.466 10812-10812 .unriddle.paper         com.unriddle.paper                   W  Method java.lang.Object androidx.compose.runtime.snapshots.SnapshotStateList.mutate(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
2023-12-18 14:51:49.467 10812-10812 .unriddle.paper         com.unriddle.paper                   W  Method void androidx.compose.runtime.snapshots.SnapshotStateList.update(kotlin.jvm.functions.Function1) failed lock verification and will run slower.
2023-12-18 14:51:49.499 10812-10868 DynamiteModule          com.unriddle.paper                   W  Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
2023-12-18 14:51:49.510 10812-10868 DynamiteModule          com.unriddle.paper                   I  Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
2023-12-18 14:51:49.510 10812-10868 ProviderInstaller       com.unriddle.paper                   W  Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.
2023-12-18 14:51:49.545 10812-10868 nativeloader            com.unriddle.paper                   D  Configuring clns-5 for other apk /system/framework/org.apache.http.legacy.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:51:49.577 10812-10868 nativeloader            com.unriddle.paper                   D  Configuring clns-6 for other apk /system/framework/com.android.media.remotedisplay.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:51:49.598 10812-10868 .unriddle.paper         com.unriddle.paper                   W  Loading /data/misc/apexdata/com.android.art/dalvik-cache/arm64/system@framework@com.android.location.provider.jar@classes.odex non-executable as it requires an image which we failed to load
2023-12-18 14:51:49.613 10812-10868 nativeloader            com.unriddle.paper                   D  Configuring clns-7 for other apk /system/framework/com.android.location.provider.jar. target_sdk_version=34, uses_libraries=ALL, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:51:49.701 10812-10868 nativeloader            com.unriddle.paper                   D  Configuring clns-8 for other apk /data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk. target_sdk_version=34, uses_libraries=, library_path=/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/lib/arm64:/data/app/~~TTm5f8d-wH1qPramPGwnWA==/com.google.android.gms-r2Sc2ILhp4E4cc70bKQDdQ==/base.apk!/lib/arm64-v8a, permitted_path=/data:/mnt/expand:/data/user/0/com.google.android.gms
2023-12-18 14:51:49.779 10812-10860 DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager.initialize(): Read 725 pack mapping entries
2023-12-18 14:51:49.791 10812-10870 MddModelManager         com.unriddle.paper                   I  modelRegister initialized: true
2023-12-18 14:51:49.792 10812-10870 DIRecoDownload          com.unriddle.paper                   I  DigitalInkRecognitionFileDependencyManager: getAllFileGroupNames(). # Entries = 725
2023-12-18 14:51:49.826 10812-10812 lksd                    com.unriddle.paper                   D  null
2023-12-18 14:51:49.851 10812-10812 sldkfsdfs 11            com.unriddle.paper                   D  MutableState(value=Offset(0.0, 0.0))@225996326
2023-12-18 14:51:49.896 10812-10868 NativeCrypto            com.unriddle.paper                   V  Registering com/google/android/gms/org/conscrypt/NativeCrypto's 302 native methods...
2023-12-18 14:51:50.093 10812-10868 .unriddle.paper         com.unriddle.paper                   W  Accessing hidden method Ljava/security/spec/ECParameterSpec;->getCurveName()Ljava/lang/String; (unsupported, reflection, allowed)
2023-12-18 14:51:50.251 10812-10812 Choreographer           com.unriddle.paper                   I  Skipped 101 frames!  The application may be doing too much work on its main thread.
2023-12-18 14:51:50.668 10812-10868 ProviderInstaller       com.unriddle.paper                   I  Installed default security provider GmsCore_OpenSSL
2023-12-18 14:51:51.144 10812-10846 FA                      com.unriddle.paper                   I  Application backgrounded at: timestamp_millis: 1702891309136
2023-12-18 14:51:53.858 10812-10829 System                  com.unriddle.paper                   W  A resource failed to call close. 
2023-12-18 14:51:54.065 10812-10914 ProfileInstaller        com.unriddle.paper                   D  Installing profile for com.unriddle.paper
2023-12-18 14:51:56.115 10812-10915 TrafficStats            com.unriddle.paper                   D  tagSocket(5) with statsTag=0xffffffff, statsUid=-1
2023-12-18 14:52:00.087 10812-10867 Firestore               com.unriddle.paper                   W  (24.10.0) [OnlineStateTracker]: Could not reach Cloud Firestore backend. Backend didn't respond within 10 seconds

                                                                                                    This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.
2023-12-18 14:52:00.098 10812-10812 Firestore               com.unriddle.paper                   D  Document read at path: doctors/d281aef2-3017-4d3e-a3e9-1c9a2543af82
2023-12-18 14:52:00.101 10812-10812 Prescripti...eViewModel com.unriddle.paper                   D  Doctor(doctorId=d281aef2-3017-4d3e-a3e9-1c9a2543af82, firstName=Nigam Kushalappa, lastName=null, designation=null, mciNumber=KMI_89349, dob=null, phoneNumber=943498349834, email=null, specializedIn=null)
2023-12-18 14:52:02.239 10812-10860 MddModelManager         com.unriddle.paper                   I  registerFileGroups(): Done.
2023-12-18 14:52:02.239 10812-10860 MddModelManager         com.unriddle.paper                   I  File groups registered: true
2023-12-18 14:52:02.982 10812-10857 TransportR...EventStore com.unriddle.paper                   D  Storing event with priority=VERY_LOW, name=FIREBASE_ML_SDK for destination cct
2023-12-18 14:52:03.015 10812-10857 TransportR...oScheduler com.unriddle.paper                   D  Upload for context TransportContext(cct, VERY_LOW, MSRodHRwczovL2ZpcmViYXNlbG9nZ2luZy5nb29nbGVhcGlzLmNvbS92MGNjL2xvZy9iYXRjaD9mb3JtYXQ9anNvbl9wcm90bzNc) is already scheduled. Returning...
2023-12-18 14:52:11.084 10812-10867 Firestore               com.unriddle.paper                   W  (24.10.0) [WatchStream]: (4c1b5c) Stream closed with status: Status{code=UNAVAILABLE, description=Channel shutdownNow invoked, cause=null}.
2023-12-18 14:52:11.097 10812-10868 DynamiteModule          com.unriddle.paper                   W  Local module descriptor class for com.google.android.gms.providerinstaller.dynamite not found.
2023-12-18 14:52:11.121 10812-10868 DynamiteModule          com.unriddle.paper                   I  Considering local module com.google.android.gms.providerinstaller.dynamite:0 and remote module com.google.android.gms.providerinstaller.dynamite:0
2023-12-18 14:52:11.122 10812-10868 ProviderInstaller       com.unriddle.paper                   W  Failed to load providerinstaller module: No acceptable module com.google.android.gms.providerinstaller.dynamite found. Local version is 0 and remote version is 0.

But when the device is connected to wifi and the 'OKio' fix is present in the gradle, The firestore works fine.

google-oss-bot commented 11 months ago

I found a few problems with this issue:

argzdev commented 11 months ago

Thanks for reaching out, @karthikbs27. I was able to reproduce the same behavior by using the versions below:

    implementation(platform("com.google.firebase:firebase-bom:32.7.0"))
    implementation("com.google.firebase:firebase-firestore")
    implementation("com.google.mlkit:digital-ink-recognition:18.1.0")

I'll notify our engineers and see what we can do here.

tom-andersen commented 11 months ago

I am able to get Firestore to work by pinning version to the one used by Firestore.

    implementation("com.squareup.okio:okio") {
        version {
            strictly("1.17.5")
        }
    }

However, the Firebase library should also update their internal dependency on io.grpc:grpc-okhttp to a more recent version that will transitively bring com.squareup.okio:okio up to 2.10.0 and likely solve the problem as well.

tom-andersen commented 11 months ago

Tracking upgrade of gRPC internally in b/317067917

tom-andersen commented 11 months ago

We will be updating our dependencies for Firebase I/O 2024 since this will represent a breaking change of increasing our minimum Android level.

karthikbs27 commented 11 months ago

I am able to get Firestore to work by pinning version to the one used by Firestore.

    implementation("com.squareup.okio:okio") {
        version {
            strictly("1.17.5")
        }
    }

However, the Firebase library should also update their internal dependency on io.grpc:grpc-okhttp to a more recent version that will transitively bring com.squareup.okio:okio up to 2.10.0 and likely solve the problem as well.

Sorry for the late reply. The implementation is working fine. Thanks for the update.

Web3Kev commented 10 months ago

Thank you so much @karthikbs27 for bringing that up and thank you @tom-andersen for the fix. I've been struggling for a week because of that.

For anyone using Firestore and Mlkit on unity and wondering why when running on android, firestore fails to connect and throws a Task fail error saying that there are no internet connections, that's the fix !

In unity Player/PublishingSettings tick Custom Main Gradle Template, Custom Gradle Properties Template and Custom Gradle Settings Template.

Force Resolve External Dependency Manager (Android) to get the dependencies required and add the fix inside mainTemplate.Gradle inside dependencies {}

karthikbs27 commented 10 months ago

Closing the issue, with the temporary fix. Hoping the fix to be present in Firebase I/O 2024. Thank you all.