Android HttpURLConnection本机崩溃(SIGSEGV)

时间:2019-10-28 13:17:29

标签: android httpurlconnection

我在我的应用程序中将HttpURLConnection用于api。它可以在android 5,7,8,9上正常运行,但不能在6上运行。问题是HttpURLConnection的getOutputStream()上的本机崩溃(SIGSEGV)。这是我的代码:

URL url = new URL(path);
HttpURLConnection connection = (HttpURLConnection) url.openConnection();
connection.setRequestMethod("POST");
connection.setDoOutput(true);
OutputStream stream = connection.getOutputStream(); // Crash!
OutputStreamWriter osw = new OutputStreamWriter(stream);

日志:

A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x6f42736d in tid 3669 (FinalizerDaemon)

在Android 6上使用Retrofit时,我有完全相同的问题和相同的错误(SIGSEGV)。

0 个答案:

没有答案