<分区>
我遇到了这个编译错误。我在同一工作区中添加了 google play 服务库。然后成功添加了最新的 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”)。
list :
<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>
编辑:
任何人都可以帮我解决这个问题。谢谢。