내가이 실수를 매핑 : 내가 여기있는 많은 것들을 시도구글 플레이 서비스가 내 응용 프로그램을 실행하려고하면
"Google Play 서비스를 업데이트하지 않는 한이 응용 프로그램이 실행되지 않습니다"를하지만, 아무것도. Android Studio의 도움으로 애플리케이션을 생성했습니다. Froyo에 대한 Google Play 서비스 및 12 권의 Google Play 서비스에 Rev 22을 다운로드했습니다. 내 Proyect는 Api 17이며 프로젝트를 전화로 실행할 때 표시됩니다.
매니페스트
<?xml version="1.0" encoding="utf-8"?>
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.example.googlemaps.googlemaps" >
<uses-permission android:name="android.permission.INTERNET" />
<uses-permission android:name="android.permission.ACCESS_NETWORK_STATE" />
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" />
<uses-permission android:name="com.google.android.providers.gsf.permission.READ_GSERVICES" />
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" />
<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" />
<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" />
<meta-data
android:name="com.google.android.maps.v2.API_KEY"
android:value="@string/google_maps_key" />
<activity
android:name=".MapsActivity"
android:label="@string/title_activity_maps" >
<intent-filter>
<action android:name="android.intent.action.MAIN" />
<category android:name="android.intent.category.LAUNCHER" />
</intent-filter>
</activity>
</application>
</manifest>
MainActivity는 구글이 6.5 Play 서비스의 업데이트 된 버전을 실행하지 않기 때문에 당신이 점점 오류가
package com.example.googlemaps.googlemaps;
import android.app.Dialog;
import android.location.Location;
import android.os.Bundle;
import android.support.v4.app.FragmentActivity;
import com.google.android.gms.common.ConnectionResult;
import com.google.android.gms.common.GooglePlayServicesUtil;
import com.google.android.gms.maps.CameraUpdateFactory;
import com.google.android.gms.maps.GoogleMap;
import com.google.android.gms.maps.GoogleMap.OnMyLocationChangeListener;
import com.google.android.gms.maps.SupportMapFragment;
import com.google.android.gms.maps.model.LatLng;
import com.google.android.gms.maps.model.MarkerOptions;
public class MapsActivity extends FragmentActivity implements OnMyLocationChangeListener {
private GoogleMap mMap; // Might be null if Google Play services APK is not available.
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_maps);
int status = GooglePlayServicesUtil.isGooglePlayServicesAvailable(getBaseContext());
if(status!=ConnectionResult.SUCCESS){
int requestCode=10;
Dialog dialog=GooglePlayServicesUtil.getErrorDialog(status, this, requestCode);
dialog.show();
}
else{
SupportMapFragment fm=(SupportMapFragment)getSupportFragmentManager().findFragmentById(R.id.map);
mMap=fm.getMap();
mMap.setMyLocationEnabled(true);
mMap.setOnMyLocationChangeListener(this);
}
}
@Override
public void onMyLocationChange(Location location) {
// TODO Auto-generated method stub
// TextView tvLocation=(TextView)findViewById(R.id.textView1);
double latitude=location.getLatitude();
double longitude=location.getLongitude();
LatLng latLng=new LatLng(latitude,longitude);
mMap.moveCamera(CameraUpdateFactory.newLatLng(latLng));
mMap.animateCamera(CameraUpdateFactory.zoomTo(15));
// tvLocation.setText("Latitude:"+latitude+", Longitude:"+longitude);
}
}
그래서 무엇이 문제입니까? 귀하의 휴대 전화에서 응용 프로그램을 실행하면 괜찮아 보이는 것으로 나타났습니다. Google Play 서비스는 일부 이전 API 및 Android 에뮬레이터에서 지원되지 않으므로 먼저 요구 사항을 확인하십시오. 도움이되는지 확인하십시오. –
안녕하세요, 에뮬레이터에서도 표시하고 싶습니다. API 버전은 17 (4.4.2) – Simpson
여기에 작성된 답변을 시도해보십시오 : [** Link **] (http://stackoverflow.com/questions/22141043/google-play-services-missing-in-emulator-android -4-4-2) –