Android商店中缺少Google Play商店物品

问题描述:

有没有人成功将位置服务构建到Android物品中?我正在尝试使用LocationServices,但无法连接到Google Play。Android商店中缺少Google Play商店物品

抱怨“W/GooglePlayServicesUtil:Google Play商店缺失。”和ConnectionResult是{statusCode = SERVICE_INVALID,分辨率=空,消息=空}

我已经在Android的东西(英特尔爱迪生)上设置wifi,它可以成功地获取网页。

以下是我的gradle文件。

apply plugin: 'com.android.application' 

android { 
    compileSdkVersion 25 
    buildToolsVersion '25.0.2' 

    defaultConfig { 
     applicationId "com.example.androidthings.myproject" 
     minSdkVersion 24 
     targetSdkVersion 25 
     versionCode 1 
     versionName "1.0" 
     multiDexEnabled true 
    } 
    buildTypes { 
     release { 
      shrinkResources true 
      minifyEnabled true 
      proguardFiles getDefaultProguardFile('proguard-android.txt'), 
        'proguard-rules.pro' 
     } 
    } 
} 

dependencies { 
    compile 'com.google.android.gms:play-services:10.2.6' 
    provided 'com.google.android.things:androidthings:0.4-devpreview' 
} 

我的第一个问题在*。许多人认为你的帮助!

compile 'com.google.android.gms:play-services:10.2.6' 

Android Things Developer Preview 4不支持10.2.6。它支持10.0.0,如the release notes所述。我的猜测是,您的Java代码(未在您的问题中显示)正在通过试图升级Play Services以匹配10.2.6的代码路径,这就是您遇到错误的地方。

+1

@Larry,也可以参考[在这里,**支持谷歌服务**部分](https://developer.android.com/things/sdk/index.html) – Onik

Android Things不包括Google Play商店,它负责自动更新设备上的Play服务。由于设备上的Play服务版本是静态的,所以应用程序无法将客户端SDK定位到与目标版本捆绑在一起的版本。来源: - https://developer.android.com/things/sdk/index.html