The application keeps crashing every time I make a certain GET expression. How can I fix this?
I am really confused as to why I have such a problem. I'm very new to Android development, so I'm not sure where to start when I solve this problem. I have all the required permissions in my manifest file. and.
If I use a URL, for example "http://www.google.com"
, the app works as it should. I have tested the url I am trying to use ( "https://api.discogs.com/users/mrblahblahblacksheep/collection/folders/0/releases?page=1&per_page=1"
) with "https://www.hurl.it/"
and it works fine. But for some reason, when I try to run it with my application, it crashes.
When the button is clicked, myClickHandler is called and dispatches the url to load the WebPageTask, which launches the ASyncTask. This AsyncTank takes the url and then sends a GET request. Here is my code.
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);
}
}
}
Finally, here is the error message that logcat prints when the button is clicked:
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
Thanks for watching.
source to share
A bit late, but SSL is a complex protocol with different encryption schemes, so different sites can run different code paths. In this case, it looks like your libcrypto was compiled for a system with more complex capabilities than yours - it may want SSE4 and your processor does not have these instructions.
What processor are you using? To support x86_64, you need a fairly advanced processor. Even the x86 Android ABI requires a 64-bit chip (technically, it needs instructions that are only for Atom processors or 64-bit desktop processors). Try changing your android image to x86.
source to share