首页 > 解决方案 > Firebase 项目已删除,但在 Android Studio 中仍显示已连接

问题描述

我在 android studio 3.1.3 中有一个项目,我已与 Firebase 连接以进行云消息传递。由于一些问题,我从 firebase 帐户中删除了该项目,并在 Android studio 中反转了完整的过程,例如删除 google json 文件,从中删除与 firebase 相关的依赖项gradle 文件。现在,当我尝试使用 Android Studio 中的助手使用另一个帐户将项目重新连接到 Firebase 时,它​​显示项目已连接并仅提示同步。我如何将我的项目与新帐户连接起来。

我的应用程序模块 gradle

apply plugin: 'com.android.application'  
apply plugin: 'kotlin-android' .  
apply plugin: 'kotlin-android-extensions'  
apply plugin: 'kotlin-kapt'

ext {
support_version = '26.1.0'
} .  
android {   
compileSdkVersion 26  
buildToolsVersion '27.0.3' .  
defaultConfig {  
    applicationId “in.co.test”  
    minSdkVersion 23  
    targetSdkVersion 26  
    versionCode 4  
    versionName "2.4"   
    testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"  
    multiDexEnabled true
}  
buildTypes  
{  
    release {
        minifyEnabled true  
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'  
    }  
} 
packagingOptions {  
    exclude 'META-INF/LICENSE.txt' 
    exclude 'META-INF/NOTICE.txt'  
    exclude 'META-INF/LICENSE'  
    exclude 'META-INF/NOTICE'  
}

dataBinding {
    enabled = true
} 
compileOptions {
    targetCompatibility 1.8
    sourceCompatibility 1.8
}
}

dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')  
implementation "com.android.support:support-v4:$support_version"  
implementation "com.android.support:appcompat-v7:$support_version"  
implementation "com.android.support.constraint:constraint-layout:1.0.2"  
implementation "com.android.support:design:$support_version"  
implementation "com.android.support:support-v4:$support_version"  
implementation "com.andkulikov:transitionseverywhere:1.7.7"  
implementation 'com.github.bumptech.glide:okhttp-integration:4.3.1'  
implementation 'de.hdodenhof:circleimageview:2.2.0'   
annotationProcessor 'com.github.bumptech.glide:compiler:4.3.1'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"  
kapt 'com.github.bumptech.glide:compiler:4.3.1'  

}
repositories {
mavenCentral()
}

标签: androidfirebaseandroid-studioandroid-gradle-plugin

解决方案


感谢@grant 的回复。最后我通过以下步骤解决了:-
1)删除了 google-services.json
2)删除了依赖项:

来自 gradle -project

dependencies{
classpath 'com.google.gms:google-services:3.1.1'classpath 'com.google.gms:google-services:3.1.1'
} 

从 gradle 模块

dependencies{
implementation 'com.google.firebase:firebase-messaging:11.8.0'
}

删除清单文件中的任何服务类条目,创建扩展 FirebaseInstanceIdService。


推荐阅读