Skip to content

How to put Firestore/Firebase in CoroutinesExample.kt (Kotlin) Project #397

Description

@neuberfran

Hi,

photo01

I stay trying this: https://firebase.google.com/docs/android/setup?hl=pt-br#kotlin+ktx

and I'm having the error on the screen above

Even if I try things like below(i.e. google-services directly) I get error

plugins {
    java
    kotlin("jvm") version "1.7.10"
    application
    google-services
}

group = "com.pi4j"
version = "0.2"

application {
    mainClass.set("CoroutinesExampleKt")
}

repositories {
    mavenCentral()
}

dependencies {
    // Import the Firebase BoM
    implementation(platform("com.google.firebase:firebase-bom:32.3.1"))

    // When using the BoM, you don't specify versions in Firebase library dependencies

    // Add the dependency for the Firebase SDK for Google Analytics
    implementation("com.google.firebase:firebase-analytics-ktx")

    // TODO: Add the dependencies for any other Firebase products you want to use
    // See https://firebase.google.com/docs/android/setup#available-libraries
    // For example, add the dependencies for Firebase Authentication and Cloud Firestore
    implementation("com.google.firebase:firebase-auth-ktx")
    implementation("com.google.firebase:firebase-firestore-ktx")
    // Esses abaixo vieram do jfran
    //implementation 'com.google.firebase:firebase-firestore:21.4.3'
    //implementation 'com.google.firebase:firebase-auth:19.3.1'
    val pi4jVersion: String by rootProject.extra
    val slf4jVersion: String by rootProject.extra
    val kotlinCoroutinesVersion: String by rootProject.extra
    implementation(project(":lib"))
    implementation("com.pi4j:pi4j-core:$pi4jVersion")
    implementation("com.pi4j:pi4j-plugin-raspberrypi:$pi4jVersion")
    implementation("com.pi4j:pi4j-plugin-pigpio:$pi4jVersion")
    implementation("com.pi4j:pi4j-plugin-gpiod:$pi4jVersion")
    implementation("com.pi4j:pi4j-plugin-linuxfs:$pi4jVersion")
    implementation("com.pi4j:pi4j-plugin-mock:$pi4jVersion")
    implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:$kotlinCoroutinesVersion")
    implementation("org.slf4j:slf4j-api:$slf4jVersion")
    implementation("org.slf4j:slf4j-simple:$slf4jVersion")
    testImplementation(kotlin("test"))
}

tasks.getByName<Test>("test") {
    useJUnitPlatform()
}

tasks.withType<org.jetbrains.kotlin.gradle.tasks.KotlinCompile> {
    kotlinOptions.jvmTarget = "11"
}

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions