2017-06-16 45 views
15

私は今週この問題について驚いています。これについても同様のトピックを検索していますが、それでも問題は解決できません。Google Playサービスが古くなっています。 11011000が必要ですが見つかりました10289574

私は、Polar m600ウェアまたはエミュレータ(Android V 7.1.1およびAPI25)でプログラムを実行しようとしているときに、「Google Playサービスが古いです。11011000が必要ですしかし、10289574が見つかりました。

アンドロイドデベロッパーサイトの「最後に取得した場所を取得する」の部分に従っています。 (サイトhttps://developer.android.com/training/location/retrieve-current.html#play-services用リンク)

は、ここで私は

public class MainActivity extends Activity { 

private FusedLocationProviderClient mFusedLocationClient; 
public Location mLastLocation; 
private TextView mTextView; 


@Override 
protected void onCreate(Bundle savedInstanceState) { 
    super.onCreate(savedInstanceState); 
    setContentView(R.layout.activity_main); 
    final WatchViewStub stub = (WatchViewStub) findViewById(R.id.watch_view_stub); 
    stub.setOnLayoutInflatedListener(new WatchViewStub.OnLayoutInflatedListener() { 
     @Override 
     public void onLayoutInflated(WatchViewStub stub) { 
      mTextView = (TextView) stub.findViewById(R.id.text); 
     } 
    }); 

    mFusedLocationClient = LocationServices.getFusedLocationProviderClient(this); 
    if (ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_FINE_LOCATION) 
      != PackageManager.PERMISSION_GRANTED && ActivityCompat.checkSelfPermission(this, android.Manifest.permission.ACCESS_COARSE_LOCATION) 
      != PackageManager.PERMISSION_GRANTED) { 
     return; 
    } 
    mFusedLocationClient.getLastLocation() 
      .addOnSuccessListener(this, new OnSuccessListener<Location>() { 
       @Override 
       public void onSuccess(Location location) { 
        mLastLocation = location; 
        Log.d("Location is:",""+mLastLocation); 

        if (location != null) { 

        } 
       } 
      }); 

} 
} 

を使用しています私のMainactivityコードがあります。ここに私manifest.xml`は

<uses-feature android:name="android.hardware.type.watch" /> 

<uses-permission android:name="android.permission.ACCESS_FINE_LOCATION" /> 
<uses-permission android:name="android.permission.ACCESS_COARSE_LOCATION" /> 

<application 
    android:allowBackup="true" 
    android:icon="@mipmap/ic_launcher" 
    android:label="@string/app_name" 
    android:supportsRtl="true" 
    android:theme="@android:style/Theme.DeviceDefault"> 
    <meta-data android:name="com.google.android.gms.version" 
     android:value="@integer/google_play_services_version" /> 
    <activity 
     android:name=".MainActivity" 
     android:label="@string/app_name"> 
     <intent-filter> 
      <action android:name="android.intent.action.MAIN" /> 

      <category android:name="android.intent.category.LAUNCHER" /> 
     </intent-filter> 
    </activity> 
</application> 

そして最後にではなく、少なくとも私ですbuild.gradle

android { 
compileSdkVersion 25 
buildToolsVersion "25.0.2" 
defaultConfig { 
    applicationId "ims.fhj.at.testnavigators" 
    minSdkVersion 21 
    targetSdkVersion 25 
    versionCode 1 
    versionName "1.0" 
    multiDexEnabled true 
} 
buildTypes { 
    release { 
     minifyEnabled false 
     proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro' 
    } 
    } 
} 

dependencies { 
compile fileTree(dir: 'libs', include: ['*.jar']) 
compile 'com.google.android.support:wearable:2.0.3' 
compile 'com.google.android.gms:play-services-wearable:11.0.1' 
compile 'com.google.android.gms:play-services:11.0.1'} 
+0

これを確認してください。https://stackoverflow.com/a/41104004/3111083 –

答えて

0

これはWearで長年問題となっています(たとえばAndroid Wear Google Play Servicesを参照)。

最高の解決策は、最新のPlayサービスリリースを使用しないことです。 1つの選択肢は、対象となるプロダクションデバイスをカバーするような最小限のバージョンを見つけることです。あなたの場合、これは10.2の範囲のもののように聞こえる。あるいは、必要なすべての機能を含む最低のリリースを選んでください(個人的には9.8.0を使用しています)。 https://developers.google.com/android/guides/releases

2

あなたはウェアラブルのGradleファイルでAPIをダウングレードする必要があります。

は参考のために、ここでプレイサービスのリリース履歴です。

問題は、お使いの端末に最新のGoogle Playサービスアプリケーションがないことです。このに変更、それを修正するには

compile 'com.google.android.gms:play-services-wearable:10.0.0' 
compile 'com.google.android.gms:play-services:10.0.0' 
22

は、AndroidのバージョンOでエミュレータネクサス5倍を作成する - API 26 - x86またはAndroidのバージョンヌガー - API 24 - のx86 Nexus 5x

enter image description here

エミュレータで3つの点をクリックすると、拡張されたウィンドウが開き、Google Play +アップデートがクリックされます。これにより、Google Playサービスが11.0.55の最新のアップデートに更新されます。

enter image description here

+2

これは正しい答えです!ありがとう。参考までに、更新するGoogleアカウントを使用してエミュレータにログインする必要があります – JCricket

+4

着用のエミュレータには「Google Play」タブの設定がありません – ken

+0

あなたは正しいです。ごめんなさい。 –

1

私のソリューションは、スーパー奇妙です: 後藤設定 - >アプリケーション - >システムアプリ - > Googleは私のバージョンは私の時計は、ブート時に更新されているため奇妙です10xxxxxたストア を再生します。そこで、私は[アップデートを削除]をクリックし、バージョンが11xxxxxxに変更されました。

0

ここでの問題は、Googleプレイサービス(バージョン)のエミュレータとgradleファイルの不一致です。

それは二つの方法によって解決することができます。

  1. Googleはエミュレータのサービス(バージョン)を再生gradleファイルにサービス (バージョン)のGoogle Playのバージョンをダウングレードすることで、ミスマッチを削除します。

  2. エミュレータでGoogle Playサービスをアップグレードしてください。

関連する問題