简体   繁体   English

从Google Play解密崩溃报告

[英]deciphering crash report from Google Play

I am receiving a crash report but it doesn't make sense to me. 我收到崩溃报告,但对我来说没有意义。 Says text may not be null. 说的文字不能为空。 It works on any device I test with but somehow it is crashing for a few people. 它可以在我测试过的任何设备上运行,但是对于某些人来说却崩溃了。 Latest one reported using a Galaxy Indulge (SCH-R910). 最新一期报道使用Galaxy Indulge(SCH-R910)。 Here is the report 这是报告

java.lang.RuntimeException: An error occured while executing doInBackground()
at android.os.AsyncTask$3.done(AsyncTask.java:200)
at java.util.concurrent.FutureTask$Sync.innerSetException(FutureTask.java:273)
at java.util.concurrent.FutureTask.setException(FutureTask.java:124)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:307)
at java.util.concurrent.FutureTask.run(FutureTask.java:137)
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1068)
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:561)
at java.lang.Thread.run(Thread.java:1096)
Caused by: java.lang.IllegalArgumentException: Text may not be null
at org.apache.http.entity.mime.content.StringBody.<init>(StringBody.java:94)
at org.apache.http.entity.mime.content.StringBody.<init>(StringBody.java:113)
at    com.pff.photosfromfriends.UploadPicture$uploadthephoto.doInBackground(UploadPicture.java:313)
at com.pff.photosfromfriends.UploadPicture$uploadthephoto.doInBackground(UploadPicture.java:1)
at android.os.AsyncTask$2.call(AsyncTask.java:185)
at java.util.concurrent.FutureTask$Sync.innerRun(FutureTask.java:305)
... 4 more

And here is my code for the upload 这是我上传的代码

class uploadthephoto extends AsyncTask<String, String, String> {

    @Override
    protected void onPreExecute() {
        super.onPreExecute();
        pDialog = new ProgressDialog(UploadPicture.this);
        pDialog.setMessage("Uploading Picture");
        pDialog.setIndeterminate(false);
        pDialog.setCancelable(true);
        pDialog.show();

    }

    @Override
    protected String doInBackground(String... args) {

        HttpClient client = new DefaultHttpClient();
        HttpPost post = new HttpPost(POST_COMMNT_URL);

        try {

            MultipartEntity entity = new MultipartEntity(
                    HttpMultipartMode.BROWSER_COMPATIBLE);
            File file = new File(theimagepath);
            cbFile = new FileBody(file, "image/jpeg");
            entity.addPart("username", new StringBody(username,
                    Charset.forName("UTF-8")));
            entity.addPart("name", new StringBody(name,
                    Charset.forName("UTF-8")));
            entity.addPart("album", new StringBody(spinselected, Charset.forName("UTF-8")));
            entity.addPart("picture", cbFile);
            post.setEntity(entity);


            HttpResponse response1 = client.execute(post);
            HttpEntity resEntity = response1.getEntity();
            String Response = EntityUtils.toString(resEntity);
            Log.d("Response", Response);

            json = new JSONObject(Response);
            success_number = json.getInt("success");

            if (success_number == 1) { // picture added!
                return json.getString("message");

            } else {
                Log.d("Login Failure!", json.getString(message));
                return json.getString("message");

            }

        } catch (IOException e) {
            Log.e("asdf", e.getMessage(), e);

        } catch (JSONException e) {
            // TODO Auto-generated catch block
            e.printStackTrace();
        }
        return null;

    }

    protected void onPostExecute(String file_url) {
        pDialog.dismiss();
        if (file_url != null) {
            Toast.makeText(UploadPicture.this, file_url, Toast.LENGTH_LONG)
                    .show();
        }

    }
}

// Username is from SharedPreferences
// Name is from SharedPreferences
// Album is from a Spinner 
// Picture is chosen from their gallery

Any idea why it would throw this error on some devices? 知道为什么它将在某些设备上引发此错误吗? Thank you. 谢谢。

It's this line: 是这行:

entity.addPart("album", new StringBody(spinselected, Charset.forName("UTF-8")));

Apparently spinselected is null and StringBody throws an error if it is constructed with a null parameter. 显然spinselected为null,如果StringBody是用null参数构造的,则抛出错误。

Caused by: java.lang.IllegalArgumentException: Text may not be null
at org.apache.http.entity.mime.content.StringBody.<init>(StringBody.java:94) 

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Google Play崩溃报告中的AndroidRuntimeException - AndroidRuntimeException from Google Play Crash Report 活动响应方法中首选项管理器的 Google Play 控制台崩溃报告 - Google Play Console Crash Report on preference manager in on response method of Activity 适用于所有 Android 6.0+ 设备的 Google Play 预发布报告崩溃 - Google Play Pre-launch Report crash for all Android 6.0+ devices JVM崩溃报告 - Crash report from JVM Google Play控制台中的java.lang.IllegalStateException崩溃报告 - java.lang.IllegalStateException crash reports from Google Play Console Google Play控制台中的java.lang.RuntimeException应用程序崩溃 - java.lang.RuntimeException App Crash from Google Play Console 从Google Play安装后,ionic 1在第一次运行时崩溃 - ionic 1 crash on first run after installing from google play java.lang.IllegalArgumentException,我从游戏商店的崩溃报告中得到了建议,建议我如何解决该问题…… - java.lang.IllegalArgumentException, i got that in my crash report from play store, suggest me to how resolve that… 从AcousticBrainz解密JSON - Deciphering JSON from AcousticBrainz Google Play游戏服务崩溃LibGDX游戏 - Google Play Games Service crash LibGDX Game
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM