"cannot find symbol method setBatchPath(String)" in the generated source from generated endpoint

Viewed 3235

For an unknown reason, when I tried to build my Google App Engine endpoints, I get these errors in all of the API java files generated by Android Studio:

Error:(400, 5) error: method does not override or implement a method from a supertype Error:(402, 29) error: cannot find symbol method setBatchPath(String)

I did some initial troubleshooting and found out that there's a Builder class inside the java file and it extends AbstractGoogleJsonClient.Builder. I looked at the source for the Builder class and I cannot find the method.

Why all of the sudden am I getting these errors? Help!

3 Answers

Same thing happened to me this morning.

I resolved it by adding this in my backend project

appengine {
    endpoints {
        googleClientVersion = '1.23.0'
    }
}

and updating this version in my app gradle file.

implementation('com.google.api-client:google-api-client-android:1.23.0')

Faced the same problem. I upgraded google client libs to 1.23.0 and it worked (earlier was 1.22.0)

compile 'com.google.api-client:google-api-client:1.23.0'
compile 'com.google.http-client:google-http-client-android:1.23.0'

We already had these in our backend build.gradle:

dependencies {
    compile 'com.google.api-client:google-api-client:+'
    compile 'com.google.api-client:google-api-client-android:+'
    compile 'com.google.http-client:google-http-client:+'
    compile 'com.google.http-client:google-http-client-android:+'
}

All we needed was adding:

appengine {
    endpoints {
        googleClientVersion = '1.23.0'
    }
}

But it'd have been nice if Google didn't break our codes every once in awhile out of the blue and wasting hours of development time!

Related