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

3

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!

Threecornered answered 3/10, 2017 at 23:12 Comment(0)
M
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')
Mccallion answered 4/10, 2017 at 5:35 Comment(6)
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!Threecornered
Yep that's correct. You will need to be to be using V3 for the implementation keyword. Thanks for pointing it out.Mccallion
Same compiling crash. Adding googleClientVersion = '1.23.0' resolved the issue ; why such changes have been pushed in force by Google team?Vial
Hi, do you have a tips for this related consequential issue : #46585618Vial
@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 helpVial
@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.0Wendelina
F
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'
Fairly answered 4/10, 2017 at 5:40 Comment(1)
Thanks, AAP...I gave the rating to JamieH, because the googleClientVersion is also needed. :)Threecornered
F
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!

Fivefold answered 5/10, 2017 at 16:36 Comment(1)
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 backendVial

© 2022 - 2024 — McMap. All rights reserved.