19

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!

Johnny Wu
  • 1,297
  • 15
  • 31

3 Answers3

38

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')
JamieH
  • 4,788
  • 6
  • 28
  • 29
  • I didn't have any luck getting the "implementation" to work (on 2.3.3), so compile 'com.google.api-client:google-api-client:1.23.0' works for me. Thanks! – Johnny Wu Oct 04 '17 at 11:39
  • Yep that's correct. You will need to be to be using V3 for the implementation keyword. Thanks for pointing it out. – JamieH Oct 04 '17 at 15:27
  • Same compiling crash. Adding googleClientVersion = '1.23.0' resolved the issue ; why such changes have been pushed in force by Google team? – LearningPath Oct 04 '17 at 18:23
  • Hi, do you have a tips for this related consequential issue : https://stackoverflow.com/questions/46585118/android-studio-cannot-deploy-backend-execution-failed-for-task-apptransform – LearningPath Oct 05 '17 at 12:10
  • @RafiqAhmad, i upgraded to V2 and indeed this solution was not satisfactory. I implemented some changes listed in the warnings during build and now it is ok. Check the above link to my question on SO if it can help – LearningPath Oct 09 '17 at 10:41
  • @mg3 Just update these dependencies compile 'com.google.api-client:google-api-client:1.23.0' compile group: 'com.google.http-client', name: 'google-http-client-android', version: '1.23.0' problem is solved.Previously it was 1.22.0 – Rafiq Ahmad Oct 09 '17 at 11:09
7

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'
AAP
  • 1,246
  • 12
  • 21
2

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!

doctorram
  • 1,112
  • 14
  • 13
  • 3
    Happy to see i am not the only frustrated guy by the situation...but i am still investigating as above solution doesnt work with Endpoints Frameworks V2 in backend – LearningPath Oct 05 '17 at 21:42