10-22 09:36:23.598 14313-14512/com.exampple.app A/libc: Fatal signal 11 (SIGSEGV), code 1, fault addr 0x10 in tid 14512 (AsyncTask #5)
10-22 09:36:23.703 541-541/? A/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
10-22 09:36:23.703 541-541/? A/DEBUG: Build fingerprint: 'Xiaomi/hydrogen/hydrogen:6.0.1/MMB29M/V7.5.4.1.MBCMIDE:user/release-keys'
10-22 09:36:23.704 541-541/? A/DEBUG: Revision: '0'
10-22 09:36:23.704 541-541/? A/DEBUG: ABI: 'arm64'
10-22 09:36:23.704 541-541/? A/DEBUG: pid: 14313, tid: 14512, name: AsyncTask #5 >>> com.exampple.app <<<
10-22 09:36:23.705 541-541/? A/DEBUG: signal 11 (SIGSEGV), code 1 (SEGV_MAPERR), fault addr 0x10
10-22 09:36:23.730 541-541/? A/DEBUG: x0 0000000000000000 x1 0000000000000000 x2 00000055831f5730 x3 000000558322c1e0
10-22 09:36:23.730 541-541/? A/DEBUG: x4 0000000000000000 x5 0000000000000001 x6 0000000000000000 x7 0000000000000000
10-22 09:36:23.730 541-541/? A/DEBUG: x8 0000000000000403 x9 0000007fae1bda70 x10 0000000000000003 x11 0000000000000010
10-22 09:36:23.731 541-541/? A/DEBUG: x12 0000007fae1bdaf8 x13 00000055830a1c70 x14 00000055829dd000 x15 00000000ebad607f
10-22 09:36:23.731 541-541/? A/DEBUG: x16 0000007fae1b6a58 x17 0000000000000000 x18 00000055831f5730 x19 00000055831f57c8
10-22 09:36:23.731 541-541/? A/DEBUG: x20 00000055831f5730 x21 0000007faae40000 x22 000000006ffaa648 x23 0000007f8b397208
10-22 09:36:23.731 541-541/? A/DEBUG: x24 0000007f8b3972b8 x25 0000007f8b3972d8 x26 0000000070403aaf x27 000000006ffaa648
10-22 09:36:23.731 541-541/? A/DEBUG: x28 000000558325b330 x29 0000007f8b397180 x30 0000007faa941248
10-22 09:36:23.731 541-541/? A/DEBUG: sp 0000007f8b397180 pc 0000007faac62b30 pstate 0000000020000000
10-22 09:36:23.734 541-541/? A/DEBUG: backtrace:
10-22 09:36:23.734 541-541/? A/DEBUG: #00 pc 000000000044fb30 /system/lib64/libart.so (_ZN3art6Thread28PopDeoptimizationReturnValueEv+24)
10-22 09:36:23.734 541-541/? A/DEBUG: #01 pc 000000000012e244 /system/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+536)
10-22 09:36:23.734 541-541/? A/DEBUG: #02 pc 000000000042b2a8 /system/lib64/libart.so (_ZN3art35InvokeVirtualOrInterfaceWithJValuesERKNS_33ScopedObjectAccessAlreadyRunnableEP8_jobjectP10_jmethodIDP6jvalue+460)
10-22 09:36:23.734 541-541/? A/DEBUG: #03 pc 0000000000459954 /system/lib64/libart.so (_ZN3art6Thread14CreateCallbackEPv+744)
10-22 09:36:23.735 541-541/? A/DEBUG: #04 pc 0000000000067754 /system/lib64/libc.so (_ZL15__pthread_startPv+52)
10-22 09:36:23.735 541-541/? A/DEBUG: #05 pc 000000000001c644 /system/lib64/libc.so (__start_thread+16)
10-22 09:36:23.921 541-541/? A/DEBUG: Tombstone written to: /data/tombstones/tombstone_06
10-22 09:36:23.921 541-541/? E/DEBUG: AM write failed: Broken pipe
10-22 09:36:23.924 1245-15797/? E/ActivityManager: Invalid thumbnail dimensions: 0x0
10-22 09:36:23.931 4751-6427/? E/octvm_klo: read: Unexpected EOF!
10-22 09:36:24.062 1245-1287/? E/JavaBinder: !!! FAILED BINDER TRANSACTION !!! (parcel size = 60)
10-22 09:36:24.087 1245-3077/? E/InputDispatcher: channel 'b057529 com.exampple.app/com.exampple.app.fragmentbase.Activity_Login (server)' ~ Channel is unrecoverably broken and will be disposed!
10-22 09:36:24.095 4859-4863/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
10-22 09:36:24.096 4859-4863/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [4, 0]
10-22 09:36:27.078 4859-4863/? E/ANDR-PERF-MPCTL: Invalid profile no. 0, total profiles 0 only
10-22 09:36:27.084 4859-4863/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [4, 0]
10-22 09:36:27.088 4859-4863/? E/ANDR-PERF-RESOURCEQS: Failed to apply optimization [4, 0]
我不知道我在哪里面对错误。我的Android手机是Redmi MI Max,Android版本,6.0.1。我使用Asynctask后台线程进行API调用并成功使用json数据并保存数据,线程在Postexecute上完全保存成功无法工作......我没有使用任何指纹访问。但它显示指纹错误。
public void userLogin(String schoolCode, String userName, String password, String deviceId) {
try {
boolean isDataSet = false;
String url = Constants.MAIN_SERVER_URL;
JSONObject jsonObject = new JSONObject();
jsonObject.put(Params.SCHOOLCODE, schoolCode);
jsonObject.put(Params.USERNAME, userName);
jsonObject.put(Params.PASSWORD, password);
jsonObject.put(Params.DEVICE_ID, deviceId);
api.call(url, jsonObject, new Api.CallBack() {
@Override
public void done(String url, JSONObject jsonObject, AjaxStatus status) {
boolean isDataSet = false;
try {
if (jsonObject != null) {
int statusCode = jsonObject.getInt(Params.STATUS);
if (statusCode == StatusCodes.SUCCESS) {
isDataSet = true;
JSONObject dataObject = jsonObject.getJSONObject(Params.DATA);
new UserLogInInfoSaving(dataObject).execute();
} else {
String message = Utils.getValidStringFromJSON(jsonObject, Params.MESSAGE);
JSONObject jsonErrorObj = new JSONObject();
jsonErrorObj.put(Params.MESSAGE, message);
Log.e("ERRROR", " IN DASHBOARD INFORMATION ".concat(status.getMessage()));
if (dataCompletedAction != null) {
dataCompletedAction.onRecordsCompleted(jsonErrorObj);
}
}
} else {
Toast.makeText(ctx, status.getMessage(), Toast.LENGTH_SHORT).show();
}
} catch (Exception e) {
e.printStackTrace();
} finally {
if (!isDataSet) {
Log.e("ERRROR", " IN DASHBOARD INFORMATION ".concat(status.getMessage()));
if (dataCompletedAction != null) {
dataCompletedAction.onRecordsCompleted(null);
}
}
}
}
});
} catch (Exception e) {
e.printStackTrace();
}
}
检查用户登录,我将记录保存到数据库
private class UserLogInInfoSaving extends AsyncTask<Void, Void, Void> {
JSONObject jsonObject;
UserLogInInfoSaving(JSONObject jsonObject) {
this.jsonObject = jsonObject;
}
@Override
protected Void doInBackground(Void... params) {
DBSchools dbSchools = null;
try {
// Saving school information
Constants.ACTIVE_USER_ID = Utils.getValidStringFromJSON(jsonObject, Params.USER_ID);
if (jsonObject.has(Params.SCHOOL_INFO)) {
JSONObject jsonSchoolInfoObj = jsonObject.getJSONObject(Params.SCHOOL_INFO);
String newSchoolCode = Utils.getValidStringFromJSON(jsonSchoolInfoObj, Params.SCHOOLCODE);
if(newSchoolCode!=null && !newSchoolCode.equals("NA")) {
dbSchools=DBSchools.set(newSchoolCode, isFirstSchool(), jsonSchoolInfoObj);
if(dbSchools!=null) {
Constants.CURRENT_SCHOOL_CODE = dbSchools.getSchoolCode();
Constants.SERVER_URL = dbSchools.getSchoolUrl();
DBParent.set(Constants.CURRENT_SCHOOL_CODE, Constants.SERVER_URL, Constants.ACTIVE_USER_ID, jsonObject);
}
}
}
} catch (Exception e){
e.printStackTrace();
}
return null;
}
@Override
protected void onPostExecute(Void v) {
super.onPostExecute(v);
try {
JSONObject jsonSchoolInfoObj = jsonObject.getJSONObject(Params.SCHOOL_INFO);
String newSchoolCode = Utils.getValidStringFromJSON(jsonSchoolInfoObj, Params.SCHOOLCODE);
String parentId = Utils.getValidStringFromJSON(jsonObject, Params.USER_ID);
JSONArray jsonArray = Utils.getValidJSONArrayFromJSON(jsonObject, Params.STUDENT_INFO);
new StudentInfoSaving(jsonArray, Constants.SERVER_URL, newSchoolCode, parentId).execute();
}catch (Exception e){
e.printStackTrace();
}
}
当我从post执行中删除代码并在runOnUiMethod()的帮助下在UserLogInInfoSaving类中的doInBackgroud方法上执行时,它运行正常。但当它转到同一类的postExecute()方法时会出现错误。
有人见过这种错误吗?帮助我。我仍然坚持这个问题。帮助将不胜感激
答案 0 :(得分:0)
启动调试模式,这是由于你的Params.SCHOOL_INFO将空值传递给jsonobject而导致在post执行方法中使用jsonobject引起的