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

illegal character in path at index 0: {{metaservice.metaImage()}} #8

Open
adapana opened this issue Sep 6, 2018 · 1 comment
Open

Comments

@adapana
Copy link

adapana commented Sep 6, 2018

This crash happen sometimes:

Caused by java.lang.IllegalArgumentException: Illegal character in path at index 0: {{metaservice.metaImage()}}
at java.net.URI.create(URI.java:734)
at java.net.URI.resolve(URI.java:1264)
at io.github.ponnamkarthik.richlinkpreview.RichPreview.resolveURL(SourceFile:170)
at io.github.ponnamkarthik.richlinkpreview.RichPreview.access$100$421289a4(SourceFile:19)
at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground$10299ca(SourceFile:86)
at io.github.ponnamkarthik.richlinkpreview.RichPreview$getData.doInBackground(SourceFile:35)
at android.os.AsyncTask$2.call(AsyncTask.java:295)
at java.util.concurrent.FutureTask.run(FutureTask.java:237)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
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:818)

Fatal Exception: java.lang.RuntimeException: An error occurred while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:309)
at java.util.concurrent.FutureTask.finishCompletion(FutureTask.java:354)
at java.util.concurrent.FutureTask.setException(FutureTask.java:223)
at java.util.concurrent.FutureTask.run(FutureTask.java:242)
at android.os.AsyncTask$SerialExecutor$1.run(AsyncTask.java:234)
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:818)

@fernandoavf7
Copy link

fernandoavf7 commented Mar 12, 2019

I have same problem, I fix with sorce code but cant push:

RichPreview.java

`
private String resolveURL(String url, String part) {
if(URLUtil.isValidUrl(part)) {
return part;
} else {
URI base_uri = null;
try {
base_uri = new URI(url);

    } catch (URISyntaxException e) {
        e.printStackTrace();
    }

    try{
        part = fixSpecialCharacters(url, part);
        base_uri = base_uri.resolve(part);

    }catch (IllegalArgumentException i){
        i.printStackTrace();
    }
    return base_uri.toString();
}

}

private String fixSpecialCharacters(String url, String part){
if(url.contains("falabella.com") && part.contains("?")){
part = part.split("\?")[0];
}

return part;

}
`

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

2 participants