2017-06-16 15 views
15

Tôi đã gặp rắc rối với vấn đề này trong tuần này. Đã tìm kiếm các chủ đề tương tự về vấn đề này nhưng vẫn không thể giải quyết được vấn đề của tôi.Dịch vụ của Google Play đã lỗi thời. Yêu cầu 11011000 nhưng tìm thấy 10289574

Các Prolem là khi tôi đang cố gắng chạy chương trình của tôi trên Polar m600 mặc hoặc giả lập mặc (Android V 7.1.1 và API25) they'r cho tôi thông báo này "Google Play dịch vụ lỗi thời. Yêu cầu 11011000 nhưng tìm thấy 10289574 ".

Tôi đã theo dõi phần "Nhận vị trí được biết cuối cùng" trong trang web dành cho nhà phát triển Android. (Link cho các trang web https://developer.android.com/training/location/retrieve-current.html#play-services)

Đây là mã MainActivity của tôi mà tôi đang sử dụng

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) { 

        } 
       } 
      }); 

} 
} 

Dưới đây là manifest.xml` tôi

<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> 

Và cuối cùng nhưng không kém phần quan của tôi 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

Kiểm tra https://stackoverflow.com/a/41104004/3111083 –

Trả lời

0

Đây là sự cố liên tục xảy ra với Wear trong nhiều năm (xem ví dụ Android Wear Google Play Services).

Giải pháp tốt nhất có vẻ là không sử dụng bản phát hành Dịch vụ của Play mới nhất. Một tùy chọn là tìm phiên bản tối thiểu có vẻ như bao gồm các thiết bị sản xuất được nhắm mục tiêu của bạn; trong trường hợp của bạn, điều này nghe có vẻ giống như một cái gì đó trong phạm vi 10.2. Ngoài ra, chọn bản phát hành thấp nhất bao gồm tất cả các chức năng bạn cần (cá nhân tôi đang sử dụng 9.8.0).

Để tham khảo, đây là dịch vụ chơi phát hành lịch sử: https://developers.google.com/android/guides/releases

2

Bạn cần phải hạ cấp API trong tập tin gradle đeo được.

Sự cố là thiết bị của bạn không có ứng dụng Dịch vụ của Google Play được cập nhật.

Để khắc phục nó thay đổi thành này:

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

Tạo emulator Nexus 5x với phiên bản Android O - api 26 - x86 hoặc Android phiên bản Nougat - api 24 - x86 Nexus 5x

enter image description here

Sau đó nhấp vào 3 dấu chấm trong trình mô phỏng và điều này sẽ mở cửa sổ mở rộng, nhấp vào Google Play + cập nhật. Và điều đó sẽ cập nhật Dịch vụ của Google Play lên bản cập nhật mới nhất 11.0.55 hôm nay.

enter image description here

+2

Đây là câu trả lời đúng! Cảm ơn. FYI, bạn sẽ phải đăng nhập vào trình giả lập bằng tài khoản Google để cập nhật – JCricket

+4

Trình giả lập mặc không có tab "Google Play" trong cài đặt – ken

+0

Bạn nói đúng. Lấy làm tiếc. –

1

Giải pháp của tôi là siêu lạ: Chuyển đến Cài đặt -> Ứng dụng -> System Apps -> Google Play Store phiên bản của tôi là 10xxxxx là lạ bởi vì đồng hồ của tôi được cập nhật khi khởi động. Vì vậy, tôi đã nhấp vào Remove Update và phiên bản đã thay đổi thành 11xxxxxx.

0

Vấn đề ở đây là sự không phù hợp của dịch vụ google play (phiên bản) trên trình giả lập và tệp gradle.

Nó có thể được giải quyết bằng hai cách:

  1. Tháo không phù hợp bằng cách hạ thấp các phiên bản của google play dịch vụ (phiên bản) trong gradle tập tin vào Dịch vụ Google Play (phiên bản) của giả lập .

  2. Nâng cấp Dịch vụ của Google Play trên trình mô phỏng.

Các vấn đề liên quan