Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/android/232.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Can';不要在仿真器android studio上使用Google Play服务_Android_Android Studio_Android Emulator - Fatal编程技术网

Can';不要在仿真器android studio上使用Google Play服务

Can';不要在仿真器android studio上使用Google Play服务,android,android-studio,android-emulator,Android,Android Studio,Android Emulator,我不能在Android Studio中将Google Play服务和模拟器一起使用。我给你我的build.gradle和manifest文件: build.gradle: apply plugin: 'com.android.application' android { compileSdkVersion 23 buildToolsVersion "23.0.0" repositories { mavenCentral() } def

我不能在Android Studio中将Google Play服务和模拟器一起使用。我给你我的build.gradle和manifest文件:

build.gradle:

apply plugin: 'com.android.application'

android {
    compileSdkVersion 23
    buildToolsVersion "23.0.0"

    repositories {
        mavenCentral()
    }

    defaultConfig {
        applicationId "fr.myapp"
        minSdkVersion 16
        targetSdkVersion 22
        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.android.support:appcompat-v7:22.2.1'
    compile 'com.facebook.android:facebook-android-sdk:4.0.1'
    compile 'com.google.android.gms:play-services:7.8.0'
    compile 'com.android.support:multidex:1.0.1'
}
我的AndroidManifest的一部分(我不显示所有活动):


在xml中,我只有一个google按钮:com.google.android.gms.common.SignInButton

当我启动我的应用程序时,当我到达包含按钮的活动时,我有以下消息:“除非你更新Google Play services,否则应用程序不会运行。”。我也尝试过(我尝试过一些解决方案)“如果没有Google Play服务,这个应用程序将无法运行,因为您的手机中缺少这些服务。”

我发现了一些关于这个问题的问题,但它总是说最后一个模拟器没有这个问题。但是在AndroidStudio上使用默认的Nexus5(API22)仿真器会给我带来这些错误。因此,我尝试安装最后一个apk google play services文件,在成功安装后,我启动了该应用程序,但这次出现了以下错误:“该应用程序依赖于google play services,而您的设备不支持该服务。请与制造商联系以获取帮助。”我还尝试使用我创建的虚拟设备,对于API 22和23,我有相同的错误

我不明白,因为我认为Google play服务的错误在上一个API中已经不存在了


感谢您的帮助。

也许可以尝试使用包含谷歌API的图像x86创建模拟器

    <uses-permission android:name="android.permission.INTERNET" />
    <uses-permission android:name="android.permission.GET_ACCOUNTS" />
    <uses-permission android:name="android.permission.USE_CREDENTIALS" />

    <application
        android:name="android.support.multidex.MultiDexApplication"
        android:allowBackup="true"
        android:icon="@mipmap/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.facebook.sdk.ApplicationId"
            android:value="@string/app_id" />
        <activity
            android:name=".SettingsActivity"
            android:label="@string/title_activity_settings" >
        </activity>
        <activity
            android:name="com.facebook.FacebookActivity"
            android:configChanges="keyboard|keyboardHidden|screenLayout|screenSize|orientation"
            android:label="@string/app_name"
            android:theme="@android:style/Theme.Translucent.NoTitleBar" />
    </application>

</manifest>