Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
ghost opened this issue Apr 9, 2019 · 8 comments
Labels
bug Bug in existing code

Comments

@ghost
Copy link

ghost commented Apr 9, 2019

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```
@ghost ghost added the bug Bug in existing code label Apr 9, 2019
@swankjesse
Copy link
Collaborator

Executable test case?

@ghost
Copy link
Author

ghost commented Apr 10, 2019

Executable test case?

Yes, in simulator and react-native run-android this work. After sign the apk and starting the app doing same things. The error will show up.

@swankjesse
Copy link
Collaborator

Sounds like a bug in React Native. Please report there. Or provide an executable test case here without the React Native dependency.

@Vedkh
Copy link

Vedkh commented 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])

@swankjesse
Copy link
Collaborator

Unclear what action to take here. If you can provide an executable test case that reproduces the problem, please open a new issue.

@d-rahul
Copy link

d-rahul commented Jun 20, 2020

Issue closed without any solution. Great!

@yschimke
Copy link
Collaborator

yschimke commented Jun 20, 2020

@d-rahul provide a reproduction, or logging showing the urls are valid and we can investigate. This bug report is not reproducible as is.

Generally for user support like this, we would advise using stackoverflow. This github issue tracker is for confirmed bug reports.

@anantwag19
Copy link

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 --

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Bug in existing code
Projects
None yet
Development

No branches or pull requests

5 participants