我在网站上发现了很长时间,但我找不到解决问题的方法。模拟器告诉我除非我更新谷歌播放服务,否则应用程序将无法运行。我在sdk管理器中安装了google play服务,我认为这是一个问题,但我不知道它是什么。
这是我的gradle项目:
buildscript
{
repositories
{
jcenter()
}
dependencies
{
classpath 'com.android.tools.build:gradle:2.2.3'
classpath 'com.google.gms:google-services:3.0.0'
}
}
allprojects
{
repositories
{
jcenter()
}
}
task clean(type: Delete)
{
delete rootProject.buildDir
}
这是我的gradle应用程序:
apply plugin: 'com.android.application'
android
{
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig
{
applicationId "com.example.utente.myfirebase"
minSdkVersion 15
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner
"android.support.test.runner.AndroidJUnitRunner"
}
buildTypes
{
release
{
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-
rules.pro'
}
}
}
dependencies
{
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
testCompile 'junit:junit:4.12'
compile 'com.google.firebase:firebase-auth:10.0.1'
}
apply plugin: 'com.google.gms.google-services'
模拟器的详细信息:
Name: Nexus_5_API_22 CPU/ABI: Google APIs Intel Atom (x86) Path:
C:\Users\Utente\.android\avd\Nexus_5_API_22.avd Target: google_apis [Google
APIs] (API level 22) Skin: nexus_5 SD Card: 100M hw.dPad: no
runtime.network.speed: full hw.accelerometer: yes hw.device.name: Nexus 5
vm.heapSize: 64 skin.dynamic: yes hw.device.manufacturer: Google hw.gps: yes
hw.initialOrientation: Portrait image.androidVersion.api: 22 hw.audioInput:
yes image.sysdir.1: system-images\android-22\google_apis\x86\ tag.id:
google_apis showDeviceFrame: yes hw.camera.back: emulated hw.mainKeys: no
AvdId: Nexus_5_API_22 hw.camera.front: emulated hw.lcd.density: 480
avd.ini.displayname: Nexus 5 API 22 hw.gpu.mode: auto hw.device.hash2:
MD5:2fa0e16c8cceb7d385183284107c0c88 hw.ramSize: 1536 hw.trackBall: no
hw.battery: yes hw.cpu.ncore: 2 hw.sdCard: yes tag.display: Google APIs
runtime.network.latency: none hw.keyboard: yes hw.sensors.proximity: yes
disk.dataPartition.size: 800M hw.sensors.orientation: yes avd.ini.encoding:
UTF-8 hw.gpu.enabled: yes