我真的很困惑,为什么我有这个问题。我是非常新的android开发,所以我不确定从哪里开始解决这个问题。我拥有清单文件中所需的所有权限。和。
如果我使用一个URL像"http://www.google.com"
应用程序工作,因为它应该工作。我已经测试了我试图使用的URL ("https://api.discogs.com/users/mrblahblahblacksheep/collection/folders/0/releases?page=1&per_page=1"
)与"https://www.hurl.it/"
,它工作得很好。但由于某些原因,当我尝试在我的应用程序中运行它时,它崩溃了。
当一个按钮被按下myClickHandler被调用并发送url给downloadWebPageTask,它启动一个ASyncTask。这个AsyncTank获取URL,然后发送GET请求。这是我的代码。
public void myClickHandler(View view) {
SetText url = new SetText();
//String string_url = url.createURL(artist_text.getText().toString(), release_text.getText().toString());
new DownloadWebpageTask().execute("https://api.discogs.com/users/mrblahblahblacksheep/collection/folders/0/releases?page=1&per_page=1");
}
public class DownloadWebpageTask extends AsyncTask<String, Void, String> {
@Override
protected String doInBackground(String... urls) {
String url = urls[0];
String final_response = "FAILED!";
HttpClient client = new DefaultHttpClient();
HttpGet request = new HttpGet(url);
HttpResponse response;
try {
response = client.execute(request);
final_response = EntityUtils.toString(response.getEntity());
} catch (ClientProtocolException e) {
e.printStackTrace();
} catch (IOException e) {
e.printStackTrace();
}
return final_response;
}
// onPostExecute displays the results of the AsyncTask.
@Override
protected void onPostExecute(String result) {
if(result == null) {
result_text.setText("Try Again");
} else {
result_text.setText(result);
}
}
}
最后,下面是按下按钮时logcat打印出的错误消息:
05-20 22:34:50.404 485-550/system_process W/AudioTrack﹕ AUDIO_OUTPUT_FLAG_FAST denied by client
05-20 22:34:50.568 2014-2031/blahblahblacksheep.com.searchfordiscogs I/art﹕ Background partial concurrent mark sweep GC freed 4038(228KB) AllocSpace objects, 0(0B) LOS objects, 39% free, 2MB/4MB, paused 73.938ms total 138.022ms
05-20 22:34:50.791 2014-2170/blahblahblacksheep.com.searchfordiscogs A/libc﹕ Fatal signal 4 (SIGILL), code 2, fault addr 0xb721f5ce in tid 2170 (AsyncTask #5)
05-20 22:34:50.893 87-87/? I/DEBUG﹕ *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-20 22:34:50.893 87-87/? I/DEBUG﹕ Build fingerprint: 'generic/vbox86p/vbox86p:5.1/LMY47D/buildbot04091026:userdebug/test-keys'
05-20 22:34:50.893 87-87/? I/DEBUG﹕ Revision: '0'
05-20 22:34:50.893 87-87/? I/DEBUG﹕ ABI: 'x86'
05-20 22:34:50.893 87-87/? I/DEBUG﹕ pid: 2014, tid: 2170, name: AsyncTask #5 >>> blahblahblacksheep.com.searchfordiscogs <<<
05-20 22:34:50.893 87-87/? I/DEBUG﹕ signal 4 (SIGILL), code 2 (ILL_ILLOPN), fault addr 0xb721f5ce
05-20 22:34:50.901 87-87/? I/DEBUG﹕ eax a20c201c ebx a1f012ec ecx 00000014 edx a20c2018
05-20 22:34:50.905 87-87/? I/DEBUG﹕ esi a1f012e8 edi b73033e4
05-20 22:34:50.905 87-87/? I/DEBUG﹕ xcs 00000073 xds 0000007b xes 0000007b xfs 000000a7 xss 0000007b
05-20 22:34:50.905 87-87/? I/DEBUG﹕ eip b721f5ce ebp 00000010 esp a1f01238 flags 00210202
05-20 22:34:50.905 87-87/? I/DEBUG﹕ backtrace:
05-20 22:34:50.905 87-87/? I/DEBUG﹕ #00 pc 000965ce /system/lib/libcrypto.so (CRYPTO_memcmp+126)
05-20 22:34:50.905 87-87/? I/DEBUG﹕ #01 pc 0002b1f9 /system/lib/libssl.so (ssl3_read_bytes+1353)
05-20 22:34:50.905 87-87/? I/DEBUG﹕ #02 pc 0001e398 /system/lib/libssl.so (ssl3_get_message+312)
05-20 22:34:50.905 87-87/? I/DEBUG﹕ #03 pc 0001dc16 /system/lib/libssl.so (ssl3_get_finished+70)
05-20 22:34:50.905 87-87/? I/DEBUG﹕ #04 pc 000207ae /system/lib/libssl.so (ssl3_connect+2222)
05-20 22:34:50.905 87-87/? I/DEBUG﹕ #05 pc 00015cc4 /system/lib/libjavacrypto.so
05-20 22:34:50.905 87-87/? I/DEBUG﹕ #06 pc 003a901c /data/dalvik-cache/x86/system@framework@boot.oat
05-20 22:34:51.147 87-87/? I/DEBUG﹕ Tombstone written to: /data/tombstones/tombstone_06
05-20 22:34:51.148 485-507/system_process I/BootReceiver﹕ Copying /data/tombstones/tombstone_06 to DropBox (SYSTEM_TOMBSTONE)
05-20 22:34:51.223 485-525/system_process W/InputDispatcher﹕ channel '32c3b9fd blahblahblacksheep.com.searchfordiscogs/blahblahblacksheep.com.searchfordiscogs.SearchForDiscogs (server)' ~ Consumer closed input channel or an error occurred. events=0x9
05-20 22:34:51.223 485-525/system_process E/InputDispatcher﹕ channel '32c3b9fd blahblahblacksheep.com.searchfordiscogs/blahblahblacksheep.com.searchfordiscogs.SearchForDiscogs (server)' ~ Channel is unrecoverably broken and will be disposed!
05-20 22:34:51.292 485-502/system_process I/ActivityManager﹕ Process blahblahblacksheep.com.searchfordiscogs (pid 2014) has died
05-20 22:34:51.292 485-1004/system_process I/WindowState﹕ WIN DEATH: Window{32c3b9fd u0 blahblahblacksheep.com.searchfordiscogs/blahblahblacksheep.com.searchfordiscogs.SearchForDiscogs}
05-20 22:34:51.292 485-1004/system_process W/InputDispatcher﹕ Attempted to unregister already unregistered input channel '32c3b9fd blahblahblacksheep.com.searchfordiscogs/blahblahblacksheep.com.searchfordiscogs.SearchForDiscogs (server)'
05-20 22:34:51.294 485-502/system_process W/ActivityManager﹕ Force removing ActivityRecord{31d393c7 u0 blahblahblacksheep.com.searchfordiscogs/.SearchForDiscogs t55}: app died, no saved state
05-20 22:34:51.295 95-95/? I/Zygote﹕ Process 2014 exited due to signal (4)
05-20 22:34:51.302 190-190/? W/SurfaceFlinger﹕ couldn't log to binary event log: overflow.
05-20 22:34:51.383 485-535/system_process I/OpenGLRenderer﹕ Initialized EGL, version 1.4
05-20 22:34:51.453 746-983/com.android.launcher3 W/EGL_emulation﹕ eglSurfaceAttrib not implemented
05-20 22:34:51.453 746-983/com.android.launcher3 W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0xa08b01a0, error=EGL_SUCCESS
05-20 22:34:51.470 485-535/system_process W/EGL_emulation﹕ eglSurfaceAttrib not implemented
05-20 22:34:51.470 485-535/system_process W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0x9f46ac20, error=EGL_SUCCESS
05-20 22:34:51.559 485-535/system_process W/EGL_emulation﹕ eglSurfaceAttrib not implemented
05-20 22:34:51.559 485-535/system_process W/OpenGLRenderer﹕ Failed to set EGL_SWAP_BEHAVIOR on surface 0x9f46ac20, error=EGL_SUCCESS
05-20 22:34:52.017 746-983/com.android.launcher3 W/OpenGLRenderer﹕ Incorrectly called buildLayer on View: ShortcutAndWidgetContainer, destroying layer...
05-20 22:34:53.753 485-550/system_process W/AudioTrack﹕ AUDIO_OUTPUT_FLAG_FAST denied by client
05-20 22:34:53.807 485-535/system_process D/OpenGLRenderer﹕ endAllStagingAnimators on 0xa1b07200 (RippleDrawable) with handle 0xaf28d7f0
05-20 22:34:53.815 485-1004/system_process W/InputMethodManagerService﹕ Got RemoteException sending setActive(false) notification to pid 2014 uid 10060
谢谢你看。
有点晚,但是SSL是具有不同加密方案的复杂协议,因此不同的站点可以触发不同的代码路径。在这种情况下,看起来你的libcrypto是为一个比你拥有更高级功能的系统编译的——也许它想要SSE4,而你的CPU没有这些指令。
你正在使用哪个CPU ?您需要一个相当高级的CPU来支持x86_64。即使x86 Android ABI也需要64位芯片(从技术上讲,它只需要Atom cpu或64位桌面cpu上的指令)。