2017-10-10 27 views
0

我已經使用排氣呼叫api的,所以我使用的版本是「compile」com.mcxiaoke.volley:library-aar:1.0.0'「但今天幾乎在5個月後,似乎一些錯誤後,我進口的另一臺筆記本電腦我的項目工作,所以我運行後收到錯誤造成排球庫已造成異常

W/System.err的:刪除失敗:ENOENT(沒有這樣的文件或目錄): /數據/用戶/ 0/in.medma.callbin/files/.Fabric/com.crashlytics.sdk.android.crashlytics-core/log-files/crashlytics-userlog-59DC9B9B0184-0001-3355-3FD34D64056C.temp

E/UncaughtException:java.lang.NullPointerException:試圖在空對象 上引用 虛擬方法'int java.lang.String.hashCode()'com.android.volley.Request。(Request.java: 136) at com.android.volley.toolbox.StringRequest。(StringRequest.java:43) at in.medma.callbin.LoginActivity $ 5.(LoginActivity.java:0) at in.medma.callbin.LoginActivity.requestForSMS (LoginActivity.java:203) 在in.medma.callbin.LoginActivity.validateForm(LoginActivity.java:189) 在in.medma.callbin.LoginActivity.onClick(LoginActivity.java:155)

織物crashlytic我得到這個

CrashReport

凌空要求

private void requestForSMS(final String mobile) { 
     StringRequest strReq = new StringRequest(Request.Method.POST, 
       Config.URL_REQUEST_SMS, new Response.Listener<String>() { 

      @Override 
      public void onResponse(String response) { 

       try { 
        JSONObject responseObj = new JSONObject(response); 

        // Parsing json object response 
        // response will be a json object 
        boolean error = responseObj.getBoolean("error"); 
        String message = responseObj.getString("message"); 

        // checking for error, if not error SMS is initiated 
        // device should receive it shortly 
        if (!error) { 
         // boolean flag saying device is waiting for sms 
         pref.setIsWaitingForSms(true); 
         viewPager.setCurrentItem(1); 
         Toast.makeText(getApplicationContext(), message, Toast.LENGTH_SHORT).show(); 

        } else { 
         Toast.makeText(getApplicationContext(), 
           "Error: " + message, 
           Toast.LENGTH_LONG).show(); 
        } 

        // hiding the progress bar 


       } catch (JSONException e) { 
        Toast.makeText(getApplicationContext(), 
          "Error: " + e.getMessage(), 
          Toast.LENGTH_LONG).show(); 


       } 

      } 
     }, new Response.ErrorListener() { 

      @Override 
      public void onErrorResponse(VolleyError error) { 
       Log.e(TAG, "Error: " + error.getMessage()); 
       Toast.makeText(getApplicationContext(), 
         error.getMessage(), Toast.LENGTH_SHORT).show(); 
      } 
     }) { 

      /** 
      * Passing user parameters to our server 
      * @return 
      */ 
      @Override 
      protected Map<String, String> getParams() { 
       Map<String, String> params = new HashMap<String, String>(); 
       params.put("mobile", mobile); 
       Log.e(TAG, "Posting params: " + params.toString()); 

       return params; 
      } 

     }; 

     // Adding request to request queue 
     MyApplication.getInstance().addToRequestQueue(strReq); 
    } 
+0

'編譯「com.mcxiaoke.volley:庫AAR:1.0.0'棄用 –

+0

@IntelliJAmiya謝謝,我可以用哪一個,請給鏈接 –

+0

'compile'c​​om.android.volley:volley:1.0.0'' –

回答

0

編譯

編譯「eu.the4thfloor.volley:com.android.volley:2015.05。 28'

+0

編譯'com.mcxiaoke.volley:library:1.0.19'??這是一個工作,你可以請覈實 –

+0

NetworkDispatcher.run:未處理的異常了java.lang.RuntimeException:不良網址我得到了這個二手\t 編譯時「com.mcxiaoke.volley:圖書館:1.0.19」畸形,當我搜索它說在谷歌 –

+0

檢查您的URL。它沒有打到服務器。這是錯誤@MohammadSameerKhan –

0

DEPRECATED 請注意,該項目已棄用,不再維護,請使用官方版本volley。

編譯 'com.android.volley:凌空:1.0.0'

+0

compile'c​​om.mcxiaoke.volley:library:1.0.19'this one ??? –

+0

是的。嘗試通過google volley替換您的圖書館。問題應該解決。 –

+0

NetworkDispatcher.run:未處理的異常java.lang.RuntimeException:錯誤的URL我在使用時得到這個編譯'com.mcxiaoke.volley:library:1.0.19'格式錯誤它說當我搜索谷歌 –