0

I have had an application with working Firestore. Then I tried adding Google Speech to Text to the application and suddenly Firestore connection stops working. Here I will post before and after app/build.gradle script in a hope that anyone could see the issue. I will not post the parts of the script that did not change.

Before:

dependencies {
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'androidx.browser:browser:1.2.0'
    implementation 'com.squareup.okhttp3:okhttp:4.8.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'dev.dworks.libs:astickyheader:0.1.0'
    implementation 'se.emilsjolander:stickylistheaders:2.7.0'
    implementation 'com.github.wangjiegulu:AndroidBucket:1.0.4'
    implementation 'com.android.support:preference-v7:29.0.0'
    implementation "androidx.appcompat:appcompat:1.1.0"
    implementation 'com.google.firebase:firebase-analytics:17.5.0'
    implementation 'com.android.support:support-v4:29.0.0'
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation 'com.google.firebase:firebase-firestore:21.6.0'
}

After

dependencies {
    implementation 'androidx.legacy:legacy-support-v13:1.0.0'
    implementation 'androidx.browser:browser:1.2.0'
    implementation 'com.squareup.okhttp3:okhttp:4.8.0'
    implementation 'com.google.code.gson:gson:2.8.6'
    implementation 'dev.dworks.libs:astickyheader:0.1.0'
    implementation 'se.emilsjolander:stickylistheaders:2.7.0'
    implementation 'com.github.wangjiegulu:AndroidBucket:1.0.4'
    implementation 'com.android.support:preference-v7:29.0.0'
    implementation "androidx.appcompat:appcompat:1.2.0"
    //implementation 'com.google.firebase:firebase-analytics:17.5.0'
    implementation 'com.android.support:support-v4:29.0.0'
    implementation 'com.android.support:support-annotations:28.0.0'
    implementation fileTree(include: '*.jar', dir: 'libs')
    implementation ('com.google.firebase:firebase-firestore:21.6.0') {
        exclude(group: 'com.google.firebase', module: 'firebase-database-collection')
        exclude(group: 'com.google.firebase', module: 'firebase-auth-interop')
        exclude(group: 'com.google.firebase', module: 'firebase-common')
    }
    implementation 'com.google.api.grpc:grpc-google-cloud-speech-v1:1.23.0'
    implementation 'com.google.firebase:firebase-admin:6.2.0'
}
configurations.implementation.exclude(group: 'com.google.firebase', module: 'protolite-well-known-types')
configurations.implementation.exclude(group: 'com.google.guava', module: 'guava-jdk5')
configurations.implementation.exclude(group: 'com.google.protobuf', module: 'protobuf-javalite')
configurations.implementation.exclude(group: 'com.google.firebase', module: 'firebase-auth-interop')
configurations.implementation.exclude(group: 'com.google.firebase', module: 'firebase-common')*/
configurations.implementation.exclude(group: 'com.google.android.gms', module: 'play-services-basement')

The change produces the following error: java.lang.IllegalStateException: FirebaseApp with name [DEFAULT] doesn't exist.

What could be causing me these issues?

Miha Bogataj
  • 298
  • 2
  • 19
  • 1
    As per this [Stackoverflow post](https://stackoverflow.com/questions/37342403/firebaseapp-with-name-default-doesnt-exist) it seems that you should add the line : apply plugin: 'com.google.gms.google-services' at the bottom of your app level build.gradle file. Then rebuild the project. – Andie Vanille Sep 21 '20 at 20:35
  • As I mentioned Firebase already worked for me, therefore it was added before trying to implement Google Speech to Text. – Miha Bogataj Sep 22 '20 at 06:10

0 Answers0