question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found

See original GitHub issue

Hi,

After searching google, Github issue etc…, I didn’t find the answer to resolve this issue. I found the #4322 and this is only because of the cache.

React Native: 59+ buildToolsVersion: 28.03 minSdkVersion: 16 compileSdkVersion: 28 targetSdkVersion: 28 Gradle: 3.3.1

  • This error comes wit ADB install signed apk package on a REAL device.
  • Debugging and release run in react native works without problem.

Error:

04-09 16:53:02.841 22070 22093 E AndroidRuntime: FATAL EXCEPTION: mqt_native_modules
04-09 16:53:02.841 22070 22093 E AndroidRuntime: Process: com.app_app, PID: 22070
04-09 16:53:02.841 22070 22093 E AndroidRuntime: java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1333)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at okhttp3.HttpUrl.get(HttpUrl.java:916)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at okhttp3.Request$Builder.url(Request.java:165)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at com.facebook.react.modules.websocket.WebSocketModule.connect(WebSocketModule.java:93)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at java.lang.reflect.Method.invoke(Native Method)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at com.facebook.react.bridge.JavaMethodWrapper.invoke(JavaMethodWrapper.java:372)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at com.facebook.react.bridge.JavaModuleWrapper.invoke(JavaModuleWrapper.java:158)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at com.facebook.react.bridge.queue.NativeRunnable.run(Native Method)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at android.os.Handler.handleCallback(Handler.java:789)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at android.os.Handler.dispatchMessage(Handler.java:98)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadHandler.dispatchMessage(MessageQueueThreadHandler.java:29)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at android.os.Looper.loop(Looper.java:164)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at com.facebook.react.bridge.queue.MessageQueueThreadImpl$4.run(MessageQueueThreadImpl.java:232)
04-09 16:53:02.841 22070 22093 E AndroidRuntime: 	at java.lang.Thread.run(Thread.java:764)
04-09 16:53:02.856 22070 22075 I zygote64: Do partial code cache collection, code=236KB, data=142KB
04-09 16:53:02.857 17048 25342 W ActivityManager:   Force finishing activity com.app_app/.MainActivity
04-09 16:53:02.857 22070 22075 I zygote64: After code cache collection, code=231KB, data=140KB
04-09 16:53:02.857 22070 22075 I zygote64: Increasing code cache capacity to 1024KB
04-09 16:53:02.863 17048 17163 I ActivityManager: Showing crash dialog for package com.app_app u0```

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Reactions:1
  • Comments:8 (3 by maintainers)

github_iconTop GitHub Comments

6reactions
Vedkhcommented, Apr 13, 2019

I have the same issue with the client’s Huawei Honor 9 Lite LLD-L31 device, with installed application beta-version (signed app from the Google Play Store, beta test). It works fine for Android 6 and 7.1, MTK chipsets. But not for Huawei Honor 9 Lite LLD-L31 device. Unfortunately, I cannot provide a test source code here. Only next information from the Firebase Crashlytics:

FatalException: java.lang.IllegalArgumentException Expected URL scheme ‘http’ or ‘https’ but no colon was found okhttp3.HttpUrl$Builder.parse (HttpUrl.java:1332) okhttp3.HttpUrl.get (HttpUrl.java:917) retrofit2.Retrofit$Builder.baseUrl (Retrofit.java:458)

I checked all URLs in app and they are correct. Hope it will help, at least a bit. I’ll try to downgrade libraries I use and find a version that will work, and then will update this info.

UPDATE: OkHttp has been used from the Retrofit library. After Retrofit downgrade to the 2.4.0 version issue has not been found. So seems error into Retrofit or OkHttp. Will duplication it for Retrofit too [https://github.com/square/retrofit/issues/3077])

1reaction
anantwag19commented, May 10, 2022

java.lang.IllegalArgumentException: Expected URL scheme ‘http’ or ‘https’ but no colon was found at okhttp3.HttpUrl$Builder.parse(HttpUrl.java:1332) at okhttp3.HttpUrl.get(HttpUrl.java:917) at retrofit2.Retrofit$Builder.baseUrl(Retrofit.java:506) at com.example.ant.Home.uploadImage(Home.java:372) at com.example.ant.Home.onClick(Home.java:270) at android.view.View.performClick(View.java:6319) at android.view.View$PerformClick.run(View.java:23995) at android.os.Handler.handleCallback(Handler.java:751) at android.os.Handler.dispatchMessage(Handler.java:95) at android.os.Looper.loop(Looper.java:154) at android.app.ActivityThread.main(ActivityThread.java:6816) at java.lang.reflect.Method.invoke(Native Method) at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1565) at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:1453) D/Camera2CameraImpl: {Camera@c0f9f59[id=0]} Transitioning camera internal state: OPENED –

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to fix "Expected URL scheme 'http' or 'https' but no colon ...
I tried to fiddle around in hash map, but the issue now seems to be in the creating task. this is my spinner...
Read more >
Expected URL scheme 'http' or 'https' but no colon was found ...
The error says Expected URL scheme 'http' or 'https' but no colon was found.It is an app where I use spinner so a...
Read more >
Android之okdownload下载提示奔溃Expected URL scheme ...
Caused by: java.lang.IllegalArgumentException: Expected URL scheme 'http' or 'https' but no colon was found at okhttp3.
Read more >
[Okhttp3] Expected URL scheme 'http' or 'https' but no colon ...
Fatal Exception : java.lang.IllegalArgumentException Expected URL scheme 'http' or 'https' but no colon was found okhttp3.
Read more >
Expected URL scheme 'http' or 'https' but was 'file' - Questions
The common solution for this issue is to host your app (and media content) on local web server and refer with HTTP(S) to...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found