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 trialPetras Brinko
1,850 PointsThe type bolts
package com.teamtreehouse.ribbit;
import android.app.Application;
import com.parse.Parse;
import com.parse.ParseObject;
public class RibbitApplication extends Application {
@Override
public void onCreate() {
super.onCreate();
Parse.initialize(this, "dbrOyEHgX2GR3EPTIblrNNAd4ITXarc82shcXdlu", "6iyrGf1I8pXKRGlxMuL4NQQ4doZLrR5btJ2ZlvII");
ParseObject testObject = new ParseObject("TestObject");
testObject.put("foo", "bar");
testObject.saveInBackground();
}
}
I got an error on testObject.saveInBackground(); saying "The method saveInBackground() from the type ParseObject refers to the missing type Task"
Any help?
2 Answers
Jarvis Prestidge
1,940 PointsHi the parse sdk also comes with a bolts jar file that you need to include in the libs folder along side the parse jar file. Hope this helps ^^.
Bradley St John Jones
2,286 PointsThanks for your help mate, that worked
James Pamplona
10,015 PointsI had the same problem. It looks like the Parse library depends on a library called Bolt which is in the same folder with the Parse library downloaded from the Parse.com website.
This is for Android Studio, but it should be similar for Eclipse.
Copy and past the Bolt library from the unzipped folder into the 'libs' folder of your project. You can also just copy and paste the entire unzipped library folder into the 'libs' folder. Right click on the 'Parse-.jar' file and select 'Add as library' or similar if it isn't already added. Do the same for the 'bolts-android-.jar' file. Try to run the project again and everything should work.
Bradley St John Jones
2,286 PointsThanks for your help mate, that worked
Bradley St John Jones
2,286 PointsBradley St John Jones
2,286 PointsI think I'm having the same problem.
I get:
error: cannot access Task testObject.saveInBackground(); ^ class file for bolts.Task not found Note: C:\Users\Brad\AndroidStudioProjects\Ribbit\app\src\main\java\bigplans\ribbit\MainActivity.java uses or overrides a deprecated API. Note: Recompile with -Xlint:deprecation for details. 1 error
FAILED
FAILURE: Build failed with an exception.
What went wrong: Execution failed for task ':app:compileDebugJava'.
Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
BUILD FAILED
Anyone have any ideas?
Thanks in advance