using canlaunchurl was the cuplrit . i removed it and used launchUrl(Uri.parse(url)).onError() and it was fixed for me
launchUrl(Uri.parse(url)).onError()