我使用最新的解析android sdk 1.13.0和自托管的解析服务器。我在使用android sdk-> com.parse.ParseRequest $ ParseRequestException上传文件时遇到以下错误:json响应错误,或者有时com.parse.ParseRequest $ ParseRequestException:输入/输出失败
所有其他ParseObjects都可以正常工作,但不能正常工作。请在此问题上提供帮助,完整的堆栈跟踪信息如下-> https://gist.github.com/ishaan1995/06a7c7abe83414ab4ceb。
我的代码->
final ParseFile file = new ParseFile(f);
file.saveInBackground(new SaveCallback() {
public void done(ParseException e) {
// Handle success or failure here ..
if (e == null) {
Toast.makeText(getApplicationContext(), "File Uploaded", Toast.LENGTH_SHORT).show();
Log.d("ishaan","uploadede url: "+file.getUrl());
} else {
Toast.makeText(getApplicationContext(), "Error: " + e.toString(), Toast.LENGTH_SHORT).show();
Log.d("ishaan-parse", "" + e.getMessage());
e.printStackTrace();
Log.d("ishaan-parse",""+e.getCode());
}
spinner.setVisibility(View.GONE);
}
}, new ProgressCallback() {
public void done(Integer percentDone) {
// Update your progress spinner here. percentDone will be between 0 and 100.
//spinner.incrementProgressBy(percentDone);
Log.d("perc", "Done:" + percentDone);
}
});
ParseObject files = new ParseObject("Files");
files.put("file_link", file);
//files.put("compr_data",compFile);
files.put("file_name",abc);
files.put("file_desc",desc);
files.saveInBackground();
当搜索具有类似模糊解析响应(错误的json)的相关问题时,我在github上发现了此问题。
https://github.com/ParsePlatform/Parse-SDK-Android/issues/456
简而言之,您指定的服务器URL必须以斜杠结尾。因此,“ https://my.parseserver.com/parse/ ”
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句