[Issue][Firebase + android] Error while evaluating property 'extraGeneratedResDir' of task ':app:mapDebugSourceSetPaths'

shleecloud·2023년 6월 24일
0

증상

프로젝트 생성하고 곧바로 연결한 Firebase에서 에러가 발생한다.
파이어베이스로 안드로이드 앱 연동하는 과정에서 발생한 에러와 해결법을 공유한다.
Caused by: org.gradle.api.internal.tasks.properties.PropertyEvaluationException: Error while evaluating property 'extraGeneratedResDir' of task ':app:mapDebugSourceSetPaths'.

해결

'com.google.gms.google-services' 플러그인의 버전을 4.3.14 로 올린다.

Gradle setup

build.gradle (Project: fb-login-test)

 // Top-level build file where you can add configuration options common to all sub-projects/modules.
plugins {
    id 'com.android.application' version '8.0.2' apply false
    id 'com.android.library' version '8.0.2' apply false
    id 'org.jetbrains.kotlin.android' version '1.8.20' apply false
    // * setup firebase
    id 'com.google.gms.google-services' version '4.3.14' apply false <<<< 버전을 올린다
}

build.gradle (Module :app)

plugins {
    id 'com.android.application'
    id 'org.jetbrains.kotlin.android'
    id 'com.google.gms.google-services' // setup firebase
}

android {
    namespace 'com.shleecloud.fb_login_test'
    compileSdk 33

    defaultConfig {
        applicationId "com.shleecloud.fb_login_test"
        minSdk 24
        targetSdk 33
        versionCode 1
        versionName "1.0"

        testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
    }

    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
        }
    }
    compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_8
        targetCompatibility JavaVersion.VERSION_1_8
    }
    kotlinOptions {
        jvmTarget = '1.8'
    }
}

dependencies {
    // * setup firebase
    implementation platform('com.google.firebase:firebase-bom:32.1.1')
    implementation 'com.google.firebase:firebase-analytics-ktx'
    implementation 'com.google.firebase:firebase-auth-ktx'

    // * setup android
    implementation 'androidx.core:core-ktx:1.10.1'
    implementation 'androidx.appcompat:appcompat:1.6.1'
    implementation 'com.google.android.material:material:1.9.0'
    implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
    testImplementation 'junit:junit:4.13.2'
    androidTestImplementation 'androidx.test.ext:junit:1.1.5'
    androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
}

참고자료

profile
블로그 옮겼습니다. https://shlee.cloud

0개의 댓글