GoogleCloudPlatform / gradle-appengine-templates

Freemarker based templates that build with the gradle-appengine-plugin
438 stars 205 forks source link

Builder class not found #89

Open narko opened 7 years ago

narko commented 7 years ago

Following the tutorial step by step fails to solve the Builder class required to call the Endpoint from Android. A similar issue has been reported here: https://stackoverflow.com/questions/25748095/android-studio-appengine-endpoint-does-not-include-builder/26679579#26679579

I had this issue while doing this tutorial: https://github.com/udacity/ud867/tree/master/FinalProject

In my case, I could solve the issue by adding the following Gradle dependencies:

compile('com.google.api-client:google-api-client:1.22.0')  {
    exclude(group: 'xpp3', module: 'xpp3')
    exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
    exclude(group: 'junit', module: 'junit')
    exclude(group: 'com.google.android', module: 'android')
}
compile(group: 'com.google.http-client', name: 'google-http-client-android',
        version: '1.22.0') {
    exclude(group: 'com.google.android', module: 'android')
    exclude(group: 'org.apache.httpcomponents', module: 'httpclient')
}
loosebazooka commented 7 years ago

I've only seen this when the IDE fails to resolve all the dependencies correctly. Have you tried doing a clean rebuild and sync?

narko commented 7 years ago

Yes. Only adding the gradle dependencies fixed the problem in my case.

loosebazooka commented 7 years ago

Another way to analyze the issue is to remove the extra depedencies and then run "gradle dependencies" to inspect the dependencies and see if it is actually an issue from gradle or something to do with the IDE.