Ahsan Ullah Rasel
01/23/2024, 8:43 AMKTOR
for network request. My android version is working completely fine. But when I run the iOS app, it gives the kotlin.IllegalStateException: Invalid url
error.
Do you know for which reason it might occur? The URL is fine as it's working on Android side.McEna
01/23/2024, 6:48 PMAhsan Ullah Rasel
01/24/2024, 1:25 AMMcEna
01/24/2024, 5:52 AMMcEna
01/24/2024, 5:52 AM<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "<http://www.apple.com/DTDs/PropertyList-1.0.dtd>">
<plist version="1.0">
<dict>
<key>NSAllowsArbitraryLoads</key>
<true/>
</dict>
</plist>
and try againAhsan Ullah Rasel
01/24/2024, 8:35 AMREQUEST <https://myApiDomainHere.com> failed with exception: kotlin.IllegalStateException: Invalid url: <https://myApiDomainHere.com>
Here, actual domain is replaced with <https://myApiDomainHere.com>
in error message pasted.p-schneider
01/24/2024, 8:37 AM<https://myApiDomainHere.com/>
Ahsan Ullah Rasel
01/24/2024, 9:02 AMhttps://myApiDomainHere.com/api/v1/history
p-schneider
01/24/2024, 9:05 AMkotlin.IllegalStateException: Invalid url: <https://myApiDomainHere.com/api/v1/history>
Because to me it feels like there is something invalid in the URL string itself, like some sort of invalid character that's not encoded properly.
I think the error is thrown before any network request is made because on iOS the framework already consideres the URL invalid.Ahsan Ullah Rasel
01/24/2024, 9:09 AMp-schneider
01/24/2024, 9:18 AMp-schneider
01/24/2024, 9:29 AMAhsan Ullah Rasel
01/24/2024, 9:37 AM<https://myApiDomainHere.com/api/v1/history/>
Whereas, in Ktor, there is no trailing slash being added.
Don't know whether this is the reason or not, but I will try to investigate further with your provided lead.
Thanks a lot!Ahsan Ullah Rasel
01/24/2024, 9:38 AM