我已經使用排氣呼叫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我得到這個
凌空要求
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);
}
'編譯「com.mcxiaoke.volley:庫AAR:1.0.0'棄用 –
@IntelliJAmiya謝謝,我可以用哪一個,請給鏈接 –
'compile'com.android.volley:volley:1.0.0'' –