Когда я запускаю код в эмуляторе, код запускается успешно, и каждая функция кода работает хорошо. Хранилище данных в базе данных облачного хранилища и извлекаются из облачного хранилища. Но когда я пытаюсь запустить тот же код на своем физическом устройстве, я получаю сообщение об ошибке в консоли, что «привязка к службе не удалась», и из-за этих данных иногда данные сохраняются в облачном хранилище огня, а иногда и нет. Я не знаю, в чем проблема, с моей точки зрения, в коде нет ошибки.
Сообщение 1: Относится к КОНСОЛИ ЭМУЛЯТОРА, которая успешно работает.
Launching lib\lead.dart on AOSP on IA Emulator in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Waiting for AOSP on IA Emulator to report its views...
Debug service listening on ws://127.0.0.1:60235/O5orr8mwwjs=/ws
Syncing files to device AOSP on IA Emulator...
W/ankKumar.micar(11188): Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (light greylist, reflection)
W/ankKumar.micar(11188): Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (light greylist, reflection)
W/ankKumar.micar(11188): Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (light greylist, reflection)
W/ankKumar.micar(11188): Accessing hidden method Landroid/util/LongArray;->get(I)J (light greylist, reflection)
I/OpenGLRenderer(11188): Initialized EGL, version 1.4
D/OpenGLRenderer(11188): Swap behavior 1
D/HostConnection(11188): HostConnection::get() New Host Connection established 0xe03a1eb0, tid 11327
D/HostConnection(11188): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
W/OpenGLRenderer(11188): Failed to choose config with EGL_SWAP_BEHAVIOR_PRESERVED, retrying without...
D/OpenGLRenderer(11188): Swap behavior 0
D/eglCodecCommon(11188): setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation(11188): eglCreateContext: 0xe0386140: maj 2 min 0 rcv 2
D/EGL_emulation(11188): eglMakeCurrent: 0xe0386140: ver 2 0 (tinfo 0xcc63a5d0)
D/HostConnection(11188): HostConnection::get() New Host Connection established 0xc8c7a0e0, tid 11254
D/HostConnection(11188): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
D/eglCodecCommon(11188): setVertexArrayObject: set vao to 0 (0) 0 0
D/EGL_emulation(11188): eglCreateContext: 0xe66ba480: maj 2 min 0 rcv 2
D/HostConnection(11188): createUnique: call
D/HostConnection(11188): createUnique: call
D/HostConnection(11188): HostConnection::get() New Host Connection established 0xc8c7a040, tid 11254
D/HostConnection(11188): HostConnection::get() New Host Connection established 0xe03a1fa0, tid 11327
D/HostConnection(11188): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
D/HostConnection(11188): HostComposition ext ANDROID_EMU_CHECKSUM_HELPER_v1 ANDROID_EMU_dma_v1 ANDROID_EMU_YUV420_888_to_NV21 ANDROID_EMU_YUV_Cache ANDROID_EMU_async_unmap_buffer GL_OES_vertex_array_object GL_KHR_texture_compression_astc_ldr ANDROID_EMU_gles_max_version_2
E/eglCodecCommon(11188): GoldfishAddressSpaceHostMemoryAllocator: ioctl_ping failed for device_type=5, ret=-1
D/EGL_emulation(11188): eglMakeCurrent: 0xe66ba480: ver 2 0 (tinfo 0xdeaaf2f0)
I/Choreographer(11188): Skipped 40 frames! The application may be doing too much work on its main thread.
D/EGL_emulation(11188): eglMakeCurrent: 0xe0386140: ver 2 0 (tinfo 0xcc63a5d0)
I/OpenGLRenderer(11188): Davey! duration=936ms; Flags=1, IntendedVsync=13778394284480, Vsync=13779060951120, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=13779066379340, AnimationStart=13779066481740, PerformTraversalsStart=13779066512940, DrawStart=13779117473040, SyncQueued=13779127408640, SyncStart=13779130176540, IssueDrawCommandsStart=13779133755240, SwapBuffers=13779239087640, FrameCompleted=13779333957940, DequeueBufferDuration=33280000, QueueBufferDuration=563000,
D/EGL_emulation(11188): eglMakeCurrent: 0xe66ba480: ver 2 0 (tinfo 0xdeaaf2f0)
D/eglCodecCommon(11188): setVertexArrayObject: set vao to 0 (0) 1 0
Сообщение 2: Относится к КОНСОЛИ ФИЗИЧЕСКИХ УСТРОЙСТВ, подключенных с помощью кабеля USB (мобильный телефон), которое вызывает проблему.
Launching lib\lead.dart on Redmi Note 4 in debug mode...
Running Gradle task 'assembleDebug'...
√ Built build\app\outputs\flutter-apk\app-debug.apk.
Installing build\app\outputs\flutter-apk\app.apk...
Waiting for Redmi Note 4 to report its views...
D/SharedPreferencesImpl(26836): Time required to fsync /data/user/0/co.MayankKumar.micard/shared_prefs/com.google.android.gms.measurement.prefs.xml: [<1: 0, <2: 0, <4: 0, <8: 0, <16: 1, <32: 1, <64: 1, <128: 0, <256: 0, <512: 0, <1024: 1, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
Debug service listening on ws://127.0.0.1:59088/uGAKr_NsdvA=/ws
Syncing files to device Redmi Note 4...
W/ankKumar.micar(26836): Accessing hidden method Landroid/view/accessibility/AccessibilityNodeInfo;->getSourceNodeId()J (light greylist, reflection)
W/ankKumar.micar(26836): Accessing hidden method Landroid/view/accessibility/AccessibilityRecord;->getSourceNodeId()J (light greylist, reflection)
W/ankKumar.micar(26836): Accessing hidden field Landroid/view/accessibility/AccessibilityNodeInfo;->mChildNodeIds:Landroid/util/LongArray; (light greylist, reflection)
W/ankKumar.micar(26836): Accessing hidden method Landroid/util/LongArray;->get(I)J (light greylist, reflection)
D/SharedPreferencesImpl(26836): Time required to fsync /data/user/0/co.MayankKumar.micard/shared_prefs/com.google.android.gms.measurement.prefs.xml: [<1: 0, <2: 0, <4: 0, <8: 0, <16: 1, <32: 1, <64: 1, <128: 0, <256: 0, <512: 1, <1024: 1, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
I/OpenGLRenderer(26836): Initialized EGL, version 1.4
D/OpenGLRenderer(26836): Swap behavior 2
I/Choreographer(26836): Skipped 61 frames! The application may be doing too much work on its main thread.
I/OpenGLRenderer(26836): Davey! duration=3545ms; Flags=1, IntendedVsync=645934273575483, Vsync=645935290242109, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=645935303833077, AnimationStart=645935303911567, PerformTraversalsStart=645935305227348, DrawStart=645935312171411, SyncQueued=645935314591776, SyncStart=645935314695005, IssueDrawCommandsStart=645935314944172, SwapBuffers=645937816483484, FrameCompleted=645937819231817, DequeueBufferDuration=2150000, QueueBufferDuration=513000,
D/SharedPreferencesImpl(26836): Time required to fsync /data/user/0/co.MayankKumar.micard/shared_prefs/com.google.android.gms.appid.xml: [<1: 0, <2: 0, <4: 0, <8: 1, <16: 0, <32: 0, <64: 0, <128: 0, <256: 0, <512: 1, <1024: 0, <2048: 0, <4096: 0, <8192: 0, <16384: 0, >=16384: 0]
E/FirebaseInstanceId(26836): binding to the service failed.