我开发了一个使用Firebase云消息传递服务的应用程序
当我在android studio模拟器API 25上运行该应用程序时,它可以正常工作并获取注册令牌,但是当我在bluestacks应用程序播放器API 19上对其进行调试时,
-已安装Google服务-
bluestacks显示了一个错误“ FirebaseInstanceId:backgroundsyncfailed:PHONE_REGISTRATION_ERROR
渐变应用文件
apply plugin: 'com.android.application'
android {
configurations.all {
resolutionStrategy.force 'com.google.code.findbugs:jsr305:1.3.9'}
compileSdkVersion 26
buildToolsVersion "26.0.3"
useLibrary 'org.apache.http.legacy'
defaultConfig {
applicationId "com.dania.Test"
minSdkVersion 16
targetSdkVersion 26
versionCode 1
versionName "2.2"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
packagingOptions {
exclude 'META-INF/DEPENDENCIES'
exclude 'META-INF/NOTICE'
exclude 'META-INF/LICENSE'
exclude 'META-INF/license.txt'
exclude 'META-INF/notice.txt'
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:multidex:1.0.1'
compile 'com.android.support:appcompat-v7:26.1.0'
compile 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.android.support:design:26.1.0'
compile 'com.firebase:firebase-client-android:2.5.2'
compile 'com.google.firebase:firebase-database:10.2.0'
compile 'com.google.firebase:firebase-messaging:10.2.0'
}
apply plugin: 'com.google.gms.google-services'
声明服务的清单文件
<service android:name=".FireBaseService">
<intent-filter>
<action android:name="com.google.firebase.MESSAGING_EVENT" />
</intent-filter>
</service>
<service
android:name=".FCMTokenRefreshListenerService"
android:exported="false">
<intent-filter>
<action android:name="com.google.firebase.INSTANCE_ID_EVENT" />
</intent-filter>
</service>
<service android:name=".FCMRegistrationService" />
答案 0 :(得分:0)
问题出在蓝筹股本身和Google服务中 我删除了Blue Stacks应用程序播放器并从中删除所有应用程序,然后在将google服务更新到版本13.2.87后重新安装了它,我安装了我的应用程序 它开始正常获取令牌而没有问题