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

Exception #1

Open
tusharuit25 opened this issue Jan 6, 2018 · 3 comments
Open

Exception #1

tusharuit25 opened this issue Jan 6, 2018 · 3 comments

Comments

@tusharuit25
Copy link

E/UncaughtException: java.lang.IllegalArgumentException: unexpected url: /yts/img/yt_1200-vfl4C3T0K.png
at okhttp3.Request$Builder.url(Request.java:142)
at com.mega4tech.linkpreview.LinkUtil$1.onResponse(LinkUtil.java:144)
at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1113)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:588)
at java.lang.Thread.run(Thread.java:833)

@tusharuit25 tusharuit25 changed the title Exceoption Exception Jan 6, 2018
@yelsane
Copy link

yelsane commented Apr 24, 2018

Experiencing this issue as well. It seems that when response url is pointing to an image file, it immediately crashes. In my case, the site I always run into is "https://www.goo", this throws a FatalException:

04-24 15:47:24.864 32168-32408/com.test.app E/AndroidRuntime: FATAL EXCEPTION: OkHttp Dispatcher
    Process: com.test.app, PID: 32168
    java.lang.IllegalArgumentException: unexpected url: //www.xgoo.jp/img/og/rm4.png
        at okhttp3.Request$Builder.url(Request.java:143)
        at com.mega4tech.linkpreview.LinkUtil$1.onResponse(LinkUtil.java:144)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:153)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:761)

Adding a Malformed URL checker in LinkUtil for the imageLink should prevent this crash.

@kpamansoor
Copy link

I am also having similar issue. Any body solved?

    java.lang.IllegalArgumentException: unexpected url: //i-cdn.phonearena.com/images/article/114851-two_lead/WhatsApp-closer-to-protecting-the-retinas-of-Android-users.jpg
        at okhttp3.Request$Builder.url(Request.java:142)
        at com.mega4tech.linkpreview.LinkUtil$1.onResponse(LinkUtil.java:144)
        at okhttp3.RealCall$AsyncCall.execute(RealCall.java:135)
        at okhttp3.internal.NamedRunnable.run(NamedRunnable.java:32)
        at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1133)
        at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:607)
        at java.lang.Thread.run(Thread.java:760)

@kpamansoor
Copy link

kpamansoor commented Mar 28, 2019

My problem solved by adding this library offline and catches exception in the line mentioned in the error log.

follow the line https://stackoverflow.com/questions/32600325/android-studio-add-library-from-github to add this library offline. and in LinkUtil.class, add exception to the line 98.

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

No branches or pull requests

3 participants