The code was working fine before adding action bar in project. The added library is **appcompat_v7**. After adding action bar the following problems occurred

Code:

private static final HttpTransport HTTP_TRANSPORT = new NetHttpTransport();

Error:
NetHttpTransport cannot be resolved to a type.
HttpTransport cannot be resolved to a type

Code:

@Key
public String id;

Error: Key cannot be resolved to a type

I think the error happened because the imports are not working. The imports are

com.google.api.client.googleapis.GoogleHeaders;
com.google.api.client.http.GenericUrl;
com.google.api.client.http.HttpRequest;
com.google.api.client.http.HttpRequestFactory;
com.google.api.client.http.HttpRequestInitializer;
com.google.api.client.http.HttpTransport;
com.google.api.client.http.javanet.NetHttpTransport;
com.google.api.client.http.json.JsonHttpParser;
com.google.api.client.json.jackson.JacksonFactory;

com.google.api.client.util.Key;
有帮助吗?

解决方案 2

Adding httpclient-4.0.2-sources.jar and jar for google places api can solve the problem

其他提示

Please check your Android SDK Tools and Android SDK Platform-tools. And upgarde to Android SDK Tools Rev. 22.3 and Android SDK Platform-tools to 19 if not available.

许可以下: CC-BY-SA归因
不隶属于 StackOverflow
scroll top