Welcome to the Treehouse Community

The Treehouse Community is a meeting place for developers, designers, and programmers of all backgrounds and skill levels to get support. Collaborate here on code errors or bugs that you need feedback on, or asking for an extra set of eyes on your latest project. Join thousands of Treehouse students and alumni in the community today. (Note: Only Treehouse students can comment or ask questions, but non-students are welcome to browse our conversations.)

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and a supportive community. Start your free trial today.

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Creating a New User on Parse

Will Schwarz
Will Schwarz
2,795 Points

Register ParseObject before instantiating it

I'm getting this error: java.lang.IllegalArgumentException: You must register this ParseObject subclass before instantiating it.

with code

else {
  ParseUser newUser = new ParseUser();
  newUser.signUpInBackground(new SignUpCallback() {

logcat says the error is on the ParseUser new User line but my imports are as follows

import com.parse.ParseException;
import com.parse.ParseUser;
import com.parse.SignUpCallback;

I have no idea what I did wrong, I thought I followed the tutorial exactly.

2 Answers

Rahsan Boykin
Rahsan Boykin
2,067 Points

this might be too late but you must register the application class (with the initialization code) into the manifest file.

As an application NOT activity.


Piara Sandhu
Piara Sandhu
4,626 Points

This totally worked!

Michael Dvorscak
Michael Dvorscak
7,003 Points

Sorry, I'm a little late in the response (but I had the same issue).

What caused it for me: playing around with git. I tried doing something experimental, then I rolled back, but it was too far!

How I fixed it:

public class RibbitApplication extends Application {

    public void onCreate(){
        // Enable Local Datastore.
        //This is what Parse was complaining about
        Parse.initialize(this, "eCRiFz7HFXwf1Z7ehwaw0x8VkYrAwZvCEfl3N5v5", "UYtdHfYM4C7Td5m0bqwvmIRCjcTOIHPmcCn4DrdW");

But more importantly! You need to also update your manifest like Rashan said.

<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<!-- name attribute is the important one (just above this line) -->
<!-- rest of the manifest as normal -->
Farouk Charkas
Farouk Charkas
1,957 Points

The adding the Java Class as Application worked for me