【发布时间】:2015-01-19 04:23:23
【问题描述】:
我收到此编译错误。我已在同一工作区中添加了 google play services lib。然后成功添加了最新的 sdk(tools,extras)。
但不知道为什么还会出现这个错误。
import com.google.android.gms.location.LocationClient; -->import cannot be resolved
public class Main extends Activity implements
GooglePlayServicesClient.ConnectionCallbacks,
GooglePlayServicesClient.OnConnectionFailedListener {
private LocationClient mLocationClient; --->LocationClient cannot be resolved to a type
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.main);
mLocationClient = new LocationClient(this, this, this);
}
}
在控制台中:
我收到了,没有找到与给定名称匹配的资源(在“值”处,值为“@integer/google_play_services_version”)。
清单:
<uses-sdk
android:minSdkVersion="16"
android:targetSdkVersion="21" />
<application
android:allowBackup="true"
android:icon="@drawable/ic_launcher"
android:label="@string/app_name"
android:theme="@style/AppTheme" >
<meta-data
android:name="com.google.android.gms.version"
android:value="@integer/google_play_services_version" />
........
</application>
编辑:
任何人都可以帮助我。谢谢。
【问题讨论】:
-
检查库参考。我认为 Google Play 库参考不正确!
-
@BhavinChauhan 完全正确。我很确定。我把它放在同一个工作区
-
根据编辑问题参考很好:) 尝试重新启动 eclipse
-
@BhavinChauhan 我尝试清理并重新启动 eclipse。但它没有用。
标签: android google-maps