“从生成的端点生成的源中找不到符号方法setBatchPath(String)”

时间:2022-08-16 23:07:39

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:

由于未知原因,当我尝试构建我的Google App Engine端点时,我在Android Studio生成的所有API java文件中都出现了这些错误:

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)

错误:(400,5)错误:方法没有覆盖或实现超类型的方法错误:(402,29)错误:找不到符号方法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.

我做了一些初步的故障排除,发现java文件中有一个Builder类,它扩展了AbstractGoogleJsonClient.Builder。我查看了Builder类的源代码,但是找不到该方法。

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

为什么突然间我得到这些错误?帮帮我!

3 个解决方案

#1


36  

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.

并在我的应用程序gradle文件中更新此版本。

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

#2


7  

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

面临同样的问题。我将谷歌客户端库升级到1.23.0并且工作正常(之前为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


2  

We already had these in our backend build.gradle:

我们已经在后端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!

但是,如果谷歌每隔一段时间就不会破坏我们的代码并且浪费了几个小时的开发时间,那就太好了!

#1


36  

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.

并在我的应用程序gradle文件中更新此版本。

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

#2


7  

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

面临同样的问题。我将谷歌客户端库升级到1.23.0并且工作正常(之前为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


2  

We already had these in our backend build.gradle:

我们已经在后端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!

但是,如果谷歌每隔一段时间就不会破坏我们的代码并且浪费了几个小时的开发时间,那就太好了!