2

有没有人尝试 mashape api 并得到这样的错误

Caused by: java.lang.VerifyError: com/mashape/relocation/conn/ssl/AbstractVerifier
        at com.mashape.relocation.conn.ssl.SSLConnectionSocketFactory.<clinit>(SSLConnectionSocketFactory.java:126)
        at com.mashape.relocation.impl.conn.PoolingHttpClientConnectionManager.getDefaultRegistry(PoolingHttpClientConnectionManager.java:98)
        at com.mashape.relocation.impl.conn.PoolingHttpClientConnectionManager.<init>(PoolingHttpClientConnectionManager.java:105)
        at com.mashape.unirest.http.options.Options.refresh(Options.java:72)
        at com.mashape.unirest.http.options.Options.<clinit>(Options.java:46)
        at com.mashape.unirest.http.HttpClientHelper.prepareRequest(HttpClientHelper.java:151)
        at com.mashape.unirest.http.HttpClientHelper.request(HttpClientHelper.java:131)
        at com.mashape.unirest.request.BaseRequest.asString(BaseRequest.java:56)
        at app.entersky.hiptunesmusicchart.screen.SongDetail$getSongDetail.doInBackground(SongDetail.java:68)
        at app.entersky.hiptunesmusicchart.screen.SongDetail$getSongDetail.doInBackground(SongDetail.java:62)
        at android.os.AsyncTask$2.call(AsyncTask.java:288)

这是我的代码

private class callAPI extends AsyncTask<String, Integer, HttpResponse<String>> {

    protected HttpResponse<String> doInBackground(String... msg) {

        HttpResponse<String> request = null;
        try {
            request = Unirest.get(<URI>)
                    .header("X-Mashape-Authorization", <KEY>)
                    .header("Accept", "text/plain")
                    .asString();
        } catch (UnirestException e) {
            e.printStackTrace();
        }
        return request;
    }

    protected void onProgressUpdate(Integer...integers) {
    }

    protected void onPostExecute(HttpResponse<JsonNode> response) {
        String answer = response.getBody().toString();
    }
}

我试图找到解决方案,但没有找到
任何人知道如何解决这个问题?
谢谢

4

0 回答 0