view raw
S. Miller S. Miller - 10 months ago 41
Android Question

How can I resolve the "Didn't find class ''" error?

I am trying to use the Google Calendar API for the first time in Android Studio, and this class is crashing once it gets to the"primary", event).execute();


The error say
"Didn't find class "" on path: DexPathList"

public class CalendarRequestTask extends AsyncTask<Task, Void, Boolean> {
private mService = null;
private Exception mLastError = null;

public CalendarRequestTask(GoogleAccountCredential credential) {
HttpTransport transport = AndroidHttp.newCompatibleTransport();
JsonFactory jsonFactory = JacksonFactory.getDefaultInstance();
mService = new
transport, jsonFactory, credential)
.setApplicationName("Task Tracker")

* Background task to call Google Calendar API.
* @tasks has the date, title, summary of the event.
protected Boolean doInBackground(Task... tasks) {
try {
return true;
} catch (Exception e) {
mLastError = e;
return false;

private void setEventInApi(Task... tasks) throws IOException {
// Insert an event into the Google Calendar

for (Task task: tasks) {
Event event = new Event()
DateTime startTime = new DateTime(task.getDueDate());
EventDateTime start = new EventDateTime()
event.setStart(start);"primary", event).execute();


I solved it.

Add the following in app build.gradle (Module:app)

compile ''

Add the following in project build.gradle (Project:ProjectName)

dependencies {
classpath ''

Clean and Rebuild.