簡體   English   中英

每次我發出一個GET語句時,應用程序都會崩潰。 我怎樣才能解決這個問題?

[英]App keeps crashing every time I make a certain GET statement. How can I fix this?

我真的很困惑為什么我遇到這個問題。 我對android開發很新,所以我不確定在解決這個問題時從哪里開始。 我在清單文件中擁有所有必需的權限。 和。

如果我使用像"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上的指令)。 嘗試將您的Android圖像更改為純x86。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM