4

I am trying to use parse.com with my android app. I am creating sign up credentials but I am receiving a TransactionTooLargeExcepetion. I believe that this happens because I am exceeding the amount of data I am receiving or submitting. However, I cannot pin point the issue, because I am only trying to submit 2 strings to the server. I am adding an image of the stack trace and the small amount of code for your reference. Thank you very much for any guidance, everyone!

public class ParseStarterProjectActivity extends Activity {
    // Sign Up/sign in Variables
    Button signup;
    String userName;
    String userPassword;

    EditText user;
    EditText pass;

    public void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.main);

//      // Test Parse Object
//      ParseObject testObject = new ParseObject("TestObject");
//      testObject.put("foo", "bar");
//      testObject.saveInBackground();

        user = (EditText) findViewById(R.id.editText);
        pass = (EditText) findViewById(R.id.editText2);

        signup = (Button) findViewById(R.id.button);
        //signup = (Button) findViewById(R.id.button2);

        // Button onClick Listener
        signup.setOnClickListener(new View.OnClickListener() {
            @Override         
            public void onClick(View arg0) {
                userName = user.getText().toString();
                userPassword = pass.getText().toString();

                //send to parse
                ParseUser user = new ParseUser();
                user.setUsername(userName);
                user.setPassword(userPassword);
                user.signUpInBackground(new SignUpCallback() {
                    public void done(ParseException e) {
                        if (e == null) {
                            Toast.makeText(getApplicationContext(),
                                           "Success",
                                           Toast.LENGTH_SHORT).show();
                        } else {
                            Toast.makeText(getApplicationContext(),
                                           "Failed",
                                           Toast.LENGTH_SHORT).show();
                        }
                    }
                });
            }
        });
    }
}

StackTrace Output:

    17:52:54.747  15613-15613/com.parse.starter D/Error﹕ ERR: TOTAL BYTES WRITTEN: 12282164
    06-01 17:52:54.748  15613-15613/com.parse.starter E/JavaBinder﹕ !!! FAILED   BINDER TRANSACTION !!!
    06-01 17:52:54.748  15613-15613/com.parse.starter E/AndroidRuntime﹕ Error reporting crash
android.os.TransactionTooLargeException
        at android.os.BinderProxy.transactNative(Native Method)
        at android.os.BinderProxy.transact(Binder.java:496)
        at   android.app.ActivityManagerProxy.handleApplicationCrash(ActivityManagerNative.java:4100)
        at     com.android.internal.os.RuntimeInit$UncaughtHandler.uncaughtException(RuntimeInit.java:89)
        at com.parse.ErrorReporter.uncaughtException(ErrorReporter.java:1084)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:693)
        at java.lang.ThreadGroup.uncaughtException(ThreadGroup.java:690)
06-01 17:52:54.749  15613-15613/com.parse.starter I/Process﹕ Sending signal.    PID: 15613 SIG: 9
rici
  • 234,347
  • 28
  • 237
  • 341
user3078406
  • 511
  • 1
  • 9
  • 26
  • `TransactionTooLargeException` means you are putting too much stuff in a binder, probably in an intent that would start an activity, or communicating with a service – njzk2 Jun 02 '15 at 00:18
  • Thank you for your response. I know I am not using intents (at least to my knowledge) so it must be the communication between my app and the server. I am using parse.com. I ran a test before I coded the login credentials and the test was successful. After the credentials I began to get this error. Am I missing a method that would prevent this from happening? Thanks again. – user3078406 Jun 02 '15 at 02:41
  • its the parse service class, handling your signup request, how long is the username or password try making them like max 12 or 10 and see if it helps – Elltz Jun 02 '15 at 03:22
  • Hi Elltz, I tried entering 5 characters for user and password when creating a new user. The app simply throws the exception and the app closes. I have 2 java classes. One ParseApplication that contains the sign in keys and the ParseStarterProjectActivity which contains the code above. Your comment leads me to believe that I should have a ParseService class? – user3078406 Jun 02 '15 at 04:15

2 Answers2

0

It turns out that the code was correctly implemented. But for some reason the original project was throwing the error exception. I migrated the code to a new project and it works fine. Thank you for everyone who took the time to address my question.

user3078406
  • 511
  • 1
  • 9
  • 26
0

I had this problem while getting some JSON from an API and passing it in a Recycler view using Retrofit apparently i was using a GSON converter but my POJO classes had no annotation so i added the annotation, cleaned and rebuilt the project, uninstalled the old setup from my Phone/Emulator and run again the problem was Gone.

Frank Odoom
  • 1,545
  • 18
  • 19