Welcome to the Treehouse Community

Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.

Looking to learn something new?

Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.

Start your free trial

Android Build a Self-Destructing Message Android App Adding Users Using Parse.com Creating an Account and App on Parse.com

Parse.initialize method called inside my RibbitApplication class inside the oncreate method keep crashing the app.

If i remove this parse initialization method, the app does not crash

Ken Alger
Ken Alger
Treehouse Teacher

Can you post your code, and have you checked that your Parse credentials match?

Thanks for your reply Ken

RipitApplication.java file below:

RipitApplication onCreate method

@Override
public void onCreate() {
    super.onCreate();
    Parse.initialize(this, "my_app_id", "my_client_key");

    ParseUser user = new ParseUser();
    user.setUsername("my name");
    user.setPassword("my pass");
    user.setEmail("email@example.com");

    // other fields can be set just like with ParseObject
    user.put("phone", "650-555-0000");

    user.signUpInBackground(new SignUpCallback() {
      public void done(ParseException e) {
        if (e == null) {
          // Hooray! Let them use the app now.
        } else {
          // Sign up didn't succeed. Look at the ParseException
          // to figure out what went wrong
        }
      }
    });
}

01-09 19:34:20.609: E/AndroidRuntime(7458): FATAL EXCEPTION: main 01-09 19:34:20.609: E/AndroidRuntime(7458): java.lang.NoClassDefFoundError: bolts.Task 01-09 19:34:20.609: E/AndroidRuntime(7458): at com.parse.GcmRegistrar.updateAsync(GcmRegistrar.java:44) 01-09 19:34:20.609: E/AndroidRuntime(7458): at com.parse.Parse.initialize(Parse.java:150) 01-09 19:34:20.609: E/AndroidRuntime(7458): at com.atunje.ripit.RipitApplication.onCreate(RipitApplication.java:16) 01-09 19:34:20.609: E/AndroidRuntime(7458): at android.app.Instrumentation.callApplicationOnCreate(Instrumentation.java:1017) 01-09 19:34:20.609: E/AndroidRuntime(7458): at android.app.ActivityThread.handleBindApplication(ActivityThread.java:4611) 01-09 19:34:20.609: E/AndroidRuntime(7458): at android.app.ActivityThread.access$1400(ActivityThread.java:158) 01-09 19:34:20.609: E/AndroidRuntime(7458): at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1356) 01-09 19:34:20.609: E/AndroidRuntime(7458): at android.os.Handler.dispatchMessage(Handler.java:99) 01-09 19:34:20.609: E/AndroidRuntime(7458): at android.os.Looper.loop(Looper.java:176) 01-09 19:34:20.609: E/AndroidRuntime(7458): at android.app.ActivityThread.main(ActivityThread.java:5365) 01-09 19:34:20.609: E/AndroidRuntime(7458): at java.lang.reflect.Method.invokeNative(Native Method) 01-09 19:34:20.609: E/AndroidRuntime(7458): at java.lang.reflect.Method.invoke(Method.java:511) 01-09 19:34:20.609: E/AndroidRuntime(7458): at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:1102) 01-09 19:34:20.609: E/AndroidRuntime(7458): at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:869) 01-09 19:34:20.609: E/AndroidRuntime(7458): at dalvik.system.NativeStart.main(Native Method)