URI formate exception
See original GitHub issueFaced the following issue while using the library in prod, any possible solution for
Fatal Exception: java.lang.IllegalArgumentException: uri format is unknown
at com.alexstyl.contactstore.RawContactQueries.fetchRawContacts(:2)
at com.alexstyl.contactstore.ContactQueries.access$fetchAdditionalColumns(:1)
at com.alexstyl.contactstore.ContactQueries$queryContacts$$inlined$map$1$2.emit(:69)
at com.alexstyl.contactstore.ContactQueries$queryAllContacts$$inlined$map$1$2.emit(:64)
at com.alexstyl.contactstore.utils.ContentResolverKt$runQueryFlow$$inlined$map$1$2.emit(:74)
at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.invoke(SafeCollector.kt:15)
at kotlinx.coroutines.flow.internal.SafeCollectorKt$emitFun$1.invoke(SafeCollector.kt:15)
at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:87)
at kotlinx.coroutines.flow.internal.SafeCollector.emit(SafeCollector.kt:66)
at com.alexstyl.contactstore.utils.FlowExtensionsKt$a.invokeSuspend(:34)
at com.alexstyl.contactstore.utils.FlowExtensionsKt$a.invoke(:1)
at kotlinx.coroutines.flow.FlowKt__EmittersKt$onStart$$inlined$unsafeFlow$1.collect(SafeCollector.common.kt:116)
at com.alexstyl.contactstore.utils.ContentResolverKt$runQueryFlow$$inlined$map$1.collect(:21)
at com.alexstyl.contactstore.ContactQueries$queryAllContacts$$inlined$map$1.collect(:7)
at com.alexstyl.contactstore.ContactQueries$queryContacts$$inlined$map$1.collect(:11)
at kotlinx.coroutines.flow.FlowKt__ReduceKt.first(Reduce.kt:198)
at kotlinx.coroutines.flow.FlowKt.first(:1)
at com.alexstyl.contactstore.FetchRequest$a.invokeSuspend(:34)
at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
at kotlinx.coroutines.EventLoopImplBase.processNextEvent(EventLoop.common.kt:279)
at kotlinx.coroutines.BlockingCoroutine.joinBlocking(Builders.kt:85)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking(Builders.kt:59)
at kotlinx.coroutines.BuildersKt.runBlocking(:1)
at kotlinx.coroutines.BuildersKt__BuildersKt.runBlocking$default(Builders.kt:38)
at kotlinx.coroutines.BuildersKt.runBlocking$default(:1)
at com.alexstyl.contactstore.FetchRequest.blockingGet(:7)
at com.jobget.onboarding.requestendorsements.repo.DefaultUserContactsProvider.get$lambda-1(UserContactsProvider.kt:45)
at com.jobget.onboarding.requestendorsements.repo.DefaultUserContactsProvider.$r8$lambda$PCXMhjAq1fthczh8YCeZcJhq6FM()
at com.jobget.onboarding.requestendorsements.repo.DefaultUserContactsProvider$$ExternalSyntheticLambda4.call(:2)
at io.reactivex.rxjava3.internal.operators.observable.ObservableFromCallable.subscribeActual(ObservableFromCallable.java:46)
at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13176)
at io.reactivex.rxjava3.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13176)
at io.reactivex.rxjava3.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13176)
at io.reactivex.rxjava3.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13176)
at io.reactivex.rxjava3.internal.operators.observable.ObservableMap.subscribeActual(ObservableMap.java:33)
at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13176)
at io.reactivex.rxjava3.internal.operators.observable.ObservableOnErrorReturn.subscribeActual(ObservableOnErrorReturn.java:31)
at io.reactivex.rxjava3.core.Observable.subscribe(Observable.java:13176)
at io.reactivex.rxjava3.internal.operators.observable.ObservableSubscribeOn$SubscribeTask.run(ObservableSubscribeOn.java:96)
at io.reactivex.rxjava3.core.Scheduler$DisposeTask.run(Scheduler.java:644)
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.run(ScheduledRunnable.java:65)
at io.reactivex.rxjava3.internal.schedulers.ScheduledRunnable.call(ScheduledRunnable.java:56)
at java.util.concurrent.FutureTask.run(FutureTask.java:266)
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:301)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1167)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:641)
at java.lang.Thread.run(Thread.java:923)
We just fetch the contacts in our application to show them to our users.
Issue Analytics
- State:
- Created 10 months ago
- Comments:11 (7 by maintainers)
Top Results From Across the Web
c# - System.UriFormatException - Stack Overflow
If result is relative path, for example image.jpg you must use UriKind.Relative : BitmapImage tmp = new BitmapImage(new Uri(result, UriKind.
Read more >UriFormatException - C# in a Nutshell, Second Edition [Book]
This exception indicates that you attempted to use an invalid URI, usually in the Uri constructor. For a description of the URI format,...
Read more >Invalid URI: The format of the URI could not be determined ...
Invalid URI (System.UriFormatException) issue occurs when the input value is not what the application was expecting. In order to solve it .
Read more >Invalid URI: The format of the URI could not be determined
This is the result of the BusinessLayer failing to start due to an incorrect WebsiteID in the ReportJobs table or an invalid URL...
Read more >Error: System.UriFormatException: Invalid URI: The hostname ...
Description: Unable to schedule replication to the specified server (Server: <server.domain>, Exception: System.UriFormatException: Invalid URI: ...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Just pushed a fix for this in https://github.com/alexstyl/contactstore/commit/b8a3294eec449f48c20e58bc34427e20a0098f6d
Keeping this open until released.
EDIT: For those curious about why the URI might be invalid: I had a look at the AOSP. They are ignoring Uris they are not expecting. ContactStore will do the same to match that behavior. Those Uris are probably custom Raw Contact Uris created by apps, so probably not important for this part of the code base.
@alexstyl @purna-jobget this is a problem for us too. We’re getting Crashlytics crashes about it. Unfortunately me trying to fix it would break everything. We’re looking forward to it being fixed. Great work on the library btw!