해결된 질문
작성
·
979
·
수정됨
답변 4
0
build gradle(module)은
plugins {
id 'com.android.application'
id 'org.jetbrains.kotlin.android'
//id 'com.google.gms.google-services'
}
android {
namespace 'com.example.FoodAdventure'
compileSdk 33
defaultConfig {
applicationId "com.example.FoodAdventure"
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'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.8.0'
implementation 'androidx.appcompat:appcompat:1.6.1'
implementation 'com.google.android.material:material:1.5.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.4'
implementation 'com.android.identity:identity-credential:+'
implementation 'com.google.android.gms:play-services-maps:18.1.0'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.5'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.5.1'
implementation platform('com.google.firebase:firebase-bom:32.1.1')
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.firebase:firebase-auth-ktx:21.0.3'
//implementation 'com.google.firebase:firebase-auth-ktx:22.0.0'
}
그부분이 왜 압축파일에 빠졌는지 잘모르겠지만 그부분은 아니에요.. 그부분은 프로젝트마다 빠짐없이 해줬던 부분이거든요.. 제가 gradle(module) 안에 plugins에 //id 'com.google.gms.google-services' 이걸 주석처리해놨거든요. 제가 봤던 글에는 저걸 넣어주라고 했는데 저게 들어가면 자꾸 아래와같은 에러가 나와서 주석처리해서 일단 남겼던건데 저것때문인거같기도하고.. 오늘도 하루종일 이것저것 시도해보고 챗지피티로도 찾아봤는데 챗지피티는 파이어베이스 초기화문제라고 답변을하는데 챗지피티가 알려준대로해도 잘안되더라구요..ㅜㅜ
org.gradle.internal.execution.WorkValidationException: A problem was found with the configuration of task ':app:processDebugGoogleServices' (type 'GoogleServicesTask').
- Gradle detected a problem with the following location: 'D:\android_project\MyApplication\app\build\generated\res\google-services\debug'.
Reason: Task ':app:mergeDebugResources' uses this output of task ':app:processDebugGoogleServices' without declaring an explicit or implicit dependency. This can lead to incorrect results being produced, depending on what order the tasks are executed.
Possible solutions:
1. Declare task ':app:processDebugGoogleServices' as an input of ':app:mergeDebugResources'.
2. Declare an explicit dependency on ':app:processDebugGoogleServices' from ':app:mergeDebugResources' using Task#dependsOn.
3. Declare an explicit dependency on ':app:processDebugGoogleServices' from ':app:mergeDebugResources' using Task#mustRunAfter.
Please refer to https://docs.gradle.org/8.0/userguide/validation_problems.html#implicit_dependency for more details about this problem.
at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.build(WorkValidationException.java:133)
at org.gradle.internal.execution.WorkValidationException$BuilderWithSummary.get(WorkValidationException.java:115)
at org.gradle.internal.execution.steps.ValidateStep.throwValidationException(ValidateStep.java:162)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:86)
at org.gradle.internal.execution.steps.ValidateStep.execute(ValidateStep.java:49)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:71)
at org.gradle.internal.execution.steps.CaptureStateBeforeExecutionStep.execute(CaptureStateBeforeExecutionStep.java:45)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.executeWithNonEmptySources(SkipEmptyWorkStep.java:177)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:81)
at org.gradle.internal.execution.steps.SkipEmptyWorkStep.execute(SkipEmptyWorkStep.java:53)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:32)
at org.gradle.internal.execution.steps.RemoveUntrackedExecutionStateStep.execute(RemoveUntrackedExecutionStateStep.java:21)
at org.gradle.internal.execution.steps.legacy.MarkSnapshottingInputsStartedStep.execute(MarkSnapshottingInputsStartedStep.java:38)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:36)
at org.gradle.internal.execution.steps.LoadPreviousExecutionStateStep.execute(LoadPreviousExecutionStateStep.java:23)
at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:75)
at org.gradle.internal.execution.steps.CleanupStaleOutputsStep.execute(CleanupStaleOutputsStep.java:41)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.lambda$execute$0(AssignWorkspaceStep.java:32)
at org.gradle.api.internal.tasks.execution.TaskExecution$4.withWorkspace(TaskExecution.java:287)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:30)
at org.gradle.internal.execution.steps.AssignWorkspaceStep.execute(AssignWorkspaceStep.java:21)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:37)
at org.gradle.internal.execution.steps.IdentityCacheStep.execute(IdentityCacheStep.java:27)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:42)
at org.gradle.internal.execution.steps.IdentifyStep.execute(IdentifyStep.java:31)
at org.gradle.internal.execution.impl.DefaultExecutionEngine$1.execute(DefaultExecutionEngine.java:64)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.executeIfValid(ExecuteActionsTaskExecuter.java:146)
at org.gradle.api.internal.tasks.execution.ExecuteActionsTaskExecuter.execute(ExecuteActionsTaskExecuter.java:135)
at org.gradle.api.internal.tasks.execution.FinalizePropertiesTaskExecuter.execute(FinalizePropertiesTaskExecuter.java:46)
at org.gradle.api.internal.tasks.execution.ResolveTaskExecutionModeExecuter.execute(ResolveTaskExecutionModeExecuter.java:51)
at org.gradle.api.internal.tasks.execution.SkipTaskWithNoActionsExecuter.execute(SkipTaskWithNoActionsExecuter.java:57)
at org.gradle.api.internal.tasks.execution.SkipOnlyIfTaskExecuter.execute(SkipOnlyIfTaskExecuter.java:74)
at org.gradle.api.internal.tasks.execution.CatchExceptionTaskExecuter.execute(CatchExceptionTaskExecuter.java:36)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.executeTask(EventFiringTaskExecuter.java:77)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:55)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter$1.call(EventFiringTaskExecuter.java:52)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:204)
at org.gradle.internal.operations.DefaultBuildOperationRunner$CallableBuildOperationWorker.execute(DefaultBuildOperationRunner.java:199)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:66)
at org.gradle.internal.operations.DefaultBuildOperationRunner$2.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:157)
at org.gradle.internal.operations.DefaultBuildOperationRunner.execute(DefaultBuildOperationRunner.java:59)
at org.gradle.internal.operations.DefaultBuildOperationRunner.call(DefaultBuildOperationRunner.java:53)
at org.gradle.internal.operations.DefaultBuildOperationExecutor.call(DefaultBuildOperationExecutor.java:73)
at org.gradle.api.internal.tasks.execution.EventFiringTaskExecuter.execute(EventFiringTaskExecuter.java:52)
at org.gradle.execution.plan.LocalTaskNodeExecutor.execute(LocalTaskNodeExecutor.java:42)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:338)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$InvokeNodeExecutorsAction.execute(DefaultTaskExecutionGraph.java:325)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:318)
at org.gradle.execution.taskgraph.DefaultTaskExecutionGraph$BuildOperationAwareExecutionAction.execute(DefaultTaskExecutionGraph.java:304)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.execute(DefaultPlanExecutor.java:463)
at org.gradle.execution.plan.DefaultPlanExecutor$ExecutorWorker.run(DefaultPlanExecutor.java:380)
at org.gradle.internal.concurrent.ExecutorPolicy$CatchAndRecordFailures.onExecute(ExecutorPolicy.java:64)
at org.gradle.internal.concurrent.ManagedExecutorImpl$1.run(ManagedExecutorImpl.java:49)
예상가는 문제가 패키지명 밖에 없는거같은데
package com.test.myapplication
이렇게 되어있는데 패키지명을
com.sulhong.myfbauth
뭐 이런식으로 만드셔서 새롭게 파이어베이스 프로젝트를 만들어보시겠어요?
가능하면 Firebase 프로젝트를 만드는 과정도 함께 스크린샷으로 공유해주시면 좋을 것 같습니다.
이번에도 안되시면 주말에 같이 화면공유하면서 해보시죠.
안되시면 주말 오후 8-10시 사이에 편하신 시간과 연락처를 메일로 알려주시면 연락드리겠습니다.
코드를 보내주신 메일로 보내주세요.
0
build gradle(project)는
buildscript {
repositories {
google() // Google's Maven repository
mavenCentral() // Maven Central repository
}
}
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
id 'com.google.gms.google-services' version '4.3.10' apply false
}
0
일단 코드는 아래 처럼 돼있구요.
package com.example.FoodAdventure.Activity
import android.content.ContentValues.TAG
import android.content.Intent
import androidx.appcompat.app.AppCompatActivity
import android.os.Bundle
import android.util.Log
import android.widget.Toast
import com.example.FoodAdventure.databinding.ActivityLoginBinding
import com.google.firebase.auth.FirebaseAuth
import com.google.firebase.auth.ktx.auth
import com.google.firebase.ktx.Firebase
class LoginActivity : AppCompatActivity() {
private lateinit var binding: ActivityLoginBinding
private lateinit var auth: FirebaseAuth
override fun onCreate(savedInstanceState: Bundle?) {
super.onCreate(savedInstanceState)
binding = ActivityLoginBinding.inflate(layoutInflater)
val view = binding.root
setContentView(view)
auth = Firebase.auth
}
}
0
안녕하세요.
에러 코드에 빨간색으로 표시된 부분과 파란색으로 표시되어 있는 부분을 중점으로 스크린샷을 공유해주시겠어요?
색상으로 표시된 부분에 원인이 나와있을 것 같습니다.
작성한 코드도 공유해주세요.
해결했습니다. 이것저것 다시 처음부터 해보다가 두가지 문제가 있었음을 발견했습니다.
첫번째는 build gradle에서 apply plugin: 'com.google.gms.google-services' 이걸 안넣어준거고 두번째가 이번에러의 주요원인이었던건데 버전을 잘못넣었던겁니다.
가이드에는 com.google.gms.google-services 4.3.15 버전이라고 나와있는데
제가 이것저것 찾아보다가 해결했다는글을 보고 거기있는 버전까지 복사해놓고 그걸가지고 계속 붙여넣고있었는데 그버전이 4.3.10 버전이어서 문제가 생긴거같습니다.. 몇일동안 고생해서 이런실수는 다시는 하지않을거같아요,.ㅠㅠ
코드를 확인해보니 google-services.json이 빠진 것 같은데
이 부분을 확인해보시겠어요?