GitLiveApp / firebase-kotlin-sdk

A Kotlin-first SDK for Firebase
https://gitliveapp.github.io/firebase-kotlin-sdk/
Apache License 2.0
1.07k stars 152 forks source link

Firebase database ios #472

Open benzaied opened 6 months ago

benzaied commented 6 months ago

Hello, Thanks for your beautiful work, I start using it, and there IS a problem only on ios when i use this code. Référence.orderbykey().endAt(somekey).limittolast(...) It gaves this error "you must use queryendingatvalue: instead of query endingat value:child key: when using queryorderedbykey"

nbransby commented 4 months ago

could you please supply the stacktrace for the error and some example code?

akaratTunisie commented 4 months ago

hi, this is the code that makes erroe myRef.child(gouvernorat).child(typdebien) .orderByKey() .endAt(value = indexKey) .limitToLast(5).valueEvents

and this is the error only in ios


Terminating app due to uncaught exception 'InvalidQueryParameter', reason: 'You must use queryEndingAtValue: instead of queryEndingAtValue:childKey: when using queryOrderedByKey:' * First throw call stack: ( 0 CoreFoundation 0x00007ff8004288ab exceptionPreprocess + 242 1 libobjc.A.dylib 0x00007ff80004dba3 objc_exception_throw + 48 2 عقارات 0x00000001007cd1d3 -[FIRDatabaseQuery queryEndingAtValue:childKey:] + 291 3 عقارات 0x000000010275763e kfun:dev.gitlive.firebase.database.Query#endAt(kotlin.String;kotlin.String?){}dev.gitlive.firebase.database.Query + 414 4 عقارات 0x0000000102757897 kfun:dev.gitlive.firebase.database.Query#endAt$default(kotlin.String;kotlin.String?;kotlin.Int){}dev.gitlive.firebase.database.Query + 295 5 عقارات 0x0000000100b99654 kfun:com.benzi.benzaied.aqarat.repository.HomeRepository#getMoreAnnonces(kotlin.String;kotlin.String;kotlin.String;kotlin.String){}kotlinx.coroutines.flow.Flow + 564 6 عقارات 0x0000000100b15574 kfun:com.benzi.benzaied.aqarat.home.HomeViewModel.getMoreAnnonce$lambda$5#internal + 740 7 عقارات 0x0000000100b1a9e4 kfun:com.benzi.benzaied.aqarat.home.HomeViewModel.$getMoreAnnonce$lambda$5$FUNCTION_REFERENCE$15.invoke#internal + 132 8 عقارات 0x000000010111fb49 kfun:kotlin.Function2#invoke(1:0;1:1){}1:2-trampoline + 89 9 عقارات 0x0000000100fe88ef kfun:kotlin.coroutines.intrinsics.object-4.invokeSuspend#internal + 863 10 عقارات 0x000000010111f5c4 kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any?-trampoline + 52 11 عقارات 0x0000000100fe4e1e kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 830 12 عقارات 0x000000010111f66a kfun:kotlin.coroutines.Continuation#resumeWith(kotlin.Result<1:0>){}-trampoline + 74 13 عقارات 0x000000010121b258 kfun:kotlinx.coroutines.internal#resumeCancellableWithatkotlin.coroutines.Continuation<0:0>(kotlin.Result<0:0>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){0§<kotlin.Any?>} + 2840 14 عقارات 0x0000000101227b99 kfun:kotlinx.coroutines.intrinsics#startCoroutineCancellableatkotlin.coroutines.SuspendFunction1<0:0,0:1>(0:0;kotlin.coroutines.Continuation<0:1>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?){0§<kotlin.Any?>;1§<kotlin.Any?>} + 697 15 عقارات 0x0000000101227da2 kfun:kotlinx.coroutines.intrinsics#startCoroutineCancellable$defaultatkotlin.coroutines.SuspendFunction1<0:0,0:1>(0:0;kotlin.coroutines.Continuation<0:1>;kotlin.Function1<kotlin.Throwable,kotlin.Unit>?;kotlin.Int){0§<kotlin.Any?>;1§<kotlin.Any?>} + 338 16 عقارات 0x00000001011ab609 kfun:kotlinx.coroutines.CoroutineStart#invoke(kotlin.coroutines.SuspendFunction1<0:0,0:1>;0:0;kotlin.coroutines.Continuation<0:1>){0§<kotlin.Any?>;1§<kotlin.Any?>} + 313 17 عقارات 0x0000000101199f4d kfun:kotlinx.coroutines.AbstractCoroutine#start(kotlinx.coroutines.CoroutineStart;0:0;kotlin.coroutines.SuspendFunction1<0:0,1:0>){0§<kotlin.Any?>} + 157 18 عقارات 0x000000010119a8d8 kfun:kotlinx.coroutines#launchatkotlinx.coroutines.CoroutineScope(kotlin.coroutines.CoroutineContext;kotlinx.coroutines.CoroutineStart;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,kotlin.Unit>){}kotlinx.coroutines.Job + 664 19 عقارات 0x000000010119ab69 kfun:kotlinx.coroutines#launch$defaultatkotlinx.coroutines.CoroutineScope(kotlin.coroutines.CoroutineContext?;kotlinx.coroutines.CoroutineStart?;kotlin.coroutines.SuspendFunction1<kotlinx.coroutines.CoroutineScope,kotlin.Unit>;kotlin.Int){}kotlinx.coroutines.Job + 569 20 عقارات 0x0000000100b11529 kfun:com.benzi.benzaied.aqarat.home.HomeViewModel#getMoreAnnonce(){}kotlinx.coroutines.Job + 233 21 عقارات 0x0000000100b08df8 kfun:com.benzi.benzaied.aqarat.home.Home$lambda$25$lambda$24#internal + 200 22 عقارات 0x0000000100b0f427 kfun:com.benzi.benzaied.aqarat.home.$Home$lambda$25$lambda$24$FUNCTION_REFERENCE$37.invoke#internal + 87 23 عقارات 0x0000000100b0f517 kfun:com.benzi.benzaied.aqarat.home.$Home$lambda$25$lambda$24$FUNCTION_REFERENCE$37.$invoke(kotlin.Boolean){}#internal + 119 24 عقارات 0x000000010111b881 kfun:kotlin.Function1#invoke(1:0){}1:1-trampoline + 81 25 عقارات 0x0000000100b0ba0d kfun:com.benzi.benzaied.aqarat.home.InfiniteListHandler$lambda$35$lambda$34#internal + 237 26 عقارات 0x0000000100b0f70e kfun:com.benzi.benzaied.aqarat.home.$InfiniteListHandler$lambda$35$lambda$34$FUNCTION_REFERENCE$39.emit#internal + 126 27 عقارات 0x0000000100b0f83c kfun:com.benzi.benzaied.aqarat.home.$InfiniteListHandler$lambda$35$lambda$34$FUNCTION_REFERENCE$39.$emit#suspend(kotlin.Boolean;kotlin.coroutines.Continuation){}kotlin.Any#internal + 156 28 عقارات 0x0000000101252e29 kfun:kotlinx.coroutines.flow.FlowCollector#emit#suspend(1:0;kotlin.coroutines.Continuation){}kotlin.Any-trampoline + 89 29 عقارات 0x000000010120dca7 kfun:kotlinx.coroutines.flow.DistinctFlowImpl.collect$lambda$0#internal + 839 30 عقارات 0x000000010120dda2 kfun:kotlinx.coroutines.flow.DistinctFlowImpl.$collect$lambda$0$FUNCTION_REFERENCE$2.emit#internal + 146 31 عقارات 0x0000000101252e29 kfun:kotlinx.coroutines.flow.FlowCollector#emit#suspend(1:0;kotlin.coroutines.Continuation){}kotlin.Any-trampoline + 89 32 عقارات 0x00000001012487e4 kfun:kotlinx.coroutines.flow.internal.SafeCollector#emit#suspend(1:0;kotlin.coroutines.Continuation){}kotlin.Any + 532 33 عقارات 0x0000000101252e29 kfun:kotlinx.coroutines.flow.FlowCollector#emit#suspend(1:0;kotlin.coroutines.Continuation){}kotlin.Any-trampoline + 89 34 عقارات 0x00000001012e69bb kfun:androidx.compose.runtime.$snapshotFlow$lambda$6COROUTINE$0.invokeSuspend#internal + 3323 35 عقارات 0x00000001012e7ba7 kfun:androidx.compose.runtime.snapshotFlow$lambda$6#internal + 359 36 عقارات 0x00000001012e7dd4 kfun:androidx.compose.runtime.$snapshotFlow$lambda$6$FUNCTION_REFERENCE$1.invoke#internal + 132 37 عقارات 0x000000010111fe49 kfun:kotlin.coroutines.SuspendFunction1#invoke#suspend(1:0;kotlin.coroutines.Continuation<1:1>){}kotlin.Any?-trampoline + 89 38 عقارات 0x00000001011f618c kfun:kotlinx.coroutines.flow.SafeFlow.collectSafely#internal + 236 39 عقارات 0x0000000101252fec kfun:kotlinx.coroutines.flow.AbstractFlow#collectSafely#suspend(kotlinx.coroutines.flow.FlowCollector<1:0>;kotlin.coroutines.Continuation){}kotlin.Any-trampoline + 60 40 عقارات 0x00000001011f8bd3 kfun:kotlinx.coroutines.flow.AbstractFlow.$collectCOROUTINE$0.invokeSuspend#internal + 851 41 عقارات 0x00000001011f8f57 kfun:kotlinx.coroutines.flow.AbstractFlow#collect#suspend(kotlinx.coroutines.flow.FlowCollector<1:0>;kotlin.coroutines.Continuation){}kotlin.Any + 359 42 عقارات 0x0000000101252f49 kfun:kotlinx.coroutines.flow.Flow#collect#suspend(kotlinx.coroutines.flow.FlowCollector<1:0>;kotlin.coroutines.Continuation){}kotlin.Any-trampoline + 89 43 عقارات 0x000000010120d909 kfun:kotlinx.coroutines.flow.DistinctFlowImpl.collect#internal + 569 44 عقارات 0x0000000101252f49 kfun:kotlinx.coroutines.flow.Flow#collect#suspend(kotlinx.coroutines.flow.FlowCollector<1:0>;kotlin.coroutines.Continuation){}kotlin.Any-trampoline + 89 45 عقارات 0x0000000100b0bc52 kfun:com.benzi.benzaied.aqarat.home.InfiniteListHandler$lambda$35#internal + 498 46 عقارات 0x0000000100b0ceab kfun:com.benzi.benzaied.aqarat.home.$InfiniteListHandler$lambda$35$FUNCTION_REFERENCE$7.invoke#internal + 139 47 عقارات 0x000000010111fb49 kfun:kotlin.Function2#invoke(1:0;1:1){}1:2-trampoline + 89 48 عقارات 0x0000000100fe88ef kfun:kotlin.coroutines.intrinsics.object-4.invokeSuspend#internal + 863 49 عقارات 0x000000010111f5c4 kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#invokeSuspend(kotlin.Result<kotlin.Any?>){}kotlin.Any?-trampoline + 52 50 عقارات 0x0000000100fe4e1e kfun:kotlin.coroutines.native.internal.BaseContinuationImpl#resumeWith(kotlin.Result<kotlin.Any?>){} + 830 51 عقارات 0x000000010111f66a kfun:kotlin.coroutines.Continuation#resumeWith(kotlin.Result<1:0>){}-trampoline + 74 52 عقارات 0x000000010121c758 kfun:kotlinx.coroutines.DispatchedTask#run(){} + 2760 53 عقارات 0x000000010124f001 kfun:kotlinx.coroutines.Runnable#run(){}-trampoline + 65 54 عقارات 0x0000000101ead879 kfun:androidx.compose.ui.platform.FlushCoroutineDispatcher.flush$lambda$2#internal + 985 55 عقارات 0x0000000101eae6d0 kfun:androidx.compose.ui.platform.FlushCoroutineDispatcher.$flush$lambda$2$FUNCTION_REFERENCE$1.invoke#internal + 64 56 عقارات 0x0000000101eae790 kfun:androidx.compose.ui.platform.FlushCoroutineDispatcher.$flush$lambda$2$FUNCTION_REFERENCE$1.$invoke(){}#internal + 64 57 عقارات 0x000000010111c949 kfun:kotlin.Function0#invoke(){}1:0-trampoline + 73 58 عقارات 0x0000000101eaca92 kfun:androidx.compose.ui.platform.FlushCoroutineDispatcher.performRun#internal + 450 59 عقارات 0x0000000101eac8b1 kfun:androidx.compose.ui.platform.FlushCoroutineDispatcher#flush(){} + 177 60 عقارات 0x0000000101ec808f kfun:androidx.compose.ui.scene.ComposeSceneRecomposer#performScheduledEffects(){} + 143 61 عقارات 0x0000000101ebf33b kfun:androidx.compose.ui.scene.BaseComposeScene#render(androidx.compose.ui.graphics.Canvas;kotlin.Long){} + 987 62 عقارات 0x0000000101f9c612 kfun:androidx.compose.ui.scene.ComposeScene#render(androidx.compose.ui.graphics.Canvas;kotlin.Long){}-trampoline + 82 63 عقارات 0x0000000101f25ad4 kfun:androidx.compose.ui.scene.RenderingUIViewDelegateImpl.render#internal + 724 64 عقارات 0x0000000101fa4953 kfun:androidx.compose.ui.window.RenderingUIView.Delegate#render(org.jetbrains.skia.Canvas;kotlin.Double){}-trampoline + 83 65 عقارات 0x0000000101f842d0 kfun:androidx.compose.ui.window.RenderingUIView.object-1.render#internal + 208 66 عقارات 0x0000000101fa4613 kfun:androidx.compose.ui.window.MetalRedrawerCallbacks#render(org.jetbrains.skia.Canvas;kotlin.Double){}-trampoline + 83 67 عقارات 0x0000000101f7b9d2 kfun:androidx.compose.ui.window.MetalRedrawer.draw#internal + 3922 68 عقارات 0x0000000101f7d7cc kfun:androidx.compose.ui.window.MetalRedrawer.$lambda$0#internal + 492 69 عقارات 0x0000000101f7eb30 kfun:androidx.compose.ui.window.MetalRedrawer.$$lambda$0$FUNCTION_REFERENCE$0.invoke#internal + 64 70 عقارات 0x0000000101f7ebf0 kfun:androidx.compose.ui.window.MetalRedrawer.$$lambda$0$FUNCTION_REFERENCE$0.$invoke(){}#internal + 64 71 عقارات 0x000000010111c949 kfun:kotlin.Function0#invoke(){}1:0-trampoline + 73 72 عقارات 0x0000000101f7f946 kfun:androidx.compose.ui.window.DisplayLinkProxy.handleDisplayLinkTick#internal + 166 73 عقارات 0x0000000101f7f9fe kfun:androidx.compose.ui.window.DisplayLinkProxy.$imp:handleDisplayLinkTick#internal + 142 74 QuartzCore 0x00007ff8087bd857 _ZN2CA7Display11DisplayLink14dispatch_itemsEyyy + 1027 75 QuartzCore 0x00007ff8088e46e3 _ZL22display_timer_callbackP12_CFMachPortPvlS1 + 395 76 CoreFoundation 0x00007ff800353c4f CFMachPortPerform + 151 77 CoreFoundation 0x00007ff8003887f4 CFRUNLOOP_IS_CALLING_OUT_TO_A_SOURCE1_PERFORM_FUNCTION + 41 78 CoreFoundation 0x00007ff800387d3b CFRunLoopDoSource1 + 538 79 CoreFoundation 0x00007ff800382538 CFRunLoopRun + 2740 80 CoreFoundation 0x00007ff8003816a7 CFRunLoopRunSpecific + 560 81 GraphicsServices 0x00007ff809cb128a GSEventRunModal + 139 82 UIKitCore 0x000000010ff5ead3 -[UIApplication _run] + 994 83 UIKitCore 0x000000010ff639ef UIApplicationMain + 123 84 SwiftUI 0x0000000108d83667 swift_memcpy93_8 + 11936 85 SwiftUI 0x0000000108d83514 swift_memcpy93_8 + 11597 86 SwiftUI 0x00000001083e77e9 __swift_memcpy195_8 + 12255 87 عقارات 0x0000000100697603 $s0011mgbajAaCbCc6iOSAppV5$mainyyFZ + 35 88 عقارات 0x0000000100697799 main + 9 89 dyld 0x0000000106f012bf start_sim + 10 90 ??? 0x000000010b82652e 0x0 + 4488062254 ) libc++abi: terminating with uncaught exception of type NSException * Terminating app due to uncaught exception 'InvalidQueryParameter', reason: 'You must use queryEndingAtValue: instead of queryEndingAtValue:childKey: when using queryOrderedByKey:' terminating with uncaught exception of type NSException CoreSimulator 857.14 - Device: 6.5 pouce (679505EE-BE87-4EB5-863C-2E007D42603B) - Runtime: iOS 16.2 (20C52) - DeviceType: iPhone 11 Pro Max (lldb)