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

社会主义新天地 提交于 2019-12-18 12:18:22

问题


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!


回答1:


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')



回答2:


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'



回答3:


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!



来源:https://stackoverflow.com/questions/46554771/cannot-find-symbol-method-setbatchpathstring-in-the-generated-source-from-ge

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!