I followed the migration guide from Eclipse to Android Studio carefully and the only error that I am getting is "cannot resolve symbol common" and is happening on these lines:
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
Does anyone know why this would be happening?
Most often “R cannot be resolved” error appears if there is an issue with some of your resource files. Due to this error, you are unable to build your application. That's why we need to solve this error as it not getting away by just doing a simple restart or hitting Alt+Enter.
As before cannot resolve symbol means the java compiler cannot find the symbol it shows you on the symbol line. In this case it cannot find a method called Println for the object out .
The build tool (gradle) can't find the google_play_services library, that define the relevant classes. Update your build.gradle file, so that it finds the library (at the right path):
[EDIT 2: since 6.5, you can selectively add needed Google Play Services APIs ]
dependencies {
compile 'com.google.android.gms:play-services-base:9.4.0'
compile 'com.google.android.gms:play-services-XXX:9.4.0'
}
[EDIT: newer method, a 'native' support is now provided]
Open SDK Manager, download and install Google Play Services and Google Repository Edit build.gradle to add:
dependencies {
compile 'com.google.android.gms:play-services:3.1.36'
}
[Old method]
Check that google-plays-services is a module in your project, and that its build.gradle contains:
dependencies {
compile files('libs/google-play-services.jar')
}
In your module build.gradle:
dependencies {
compile project(':google-play-services')
}
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With