본문 바로가기
IT/ERROR

Android No matching client found for package name

by TechTonic 2022. 7. 19.
반응형

No matching client found for package name 오류 발생 원인

Android Studio에서 Google Service를 사용하는 프로젝트의 패키지 명을 변경(또는 복제해서 사용)하였을 경우 해당 오류가 발생됩니다.. 이유는 Google Service를 사용하기 위해 추가한 google-services.json 파일에 이전 패키지 명이 등록되어 있기 때문입니다.

Execution failed for task ':app:processDebugGoogleServices'.
> No matching client found for package name 'com.sarin.prod.dontremote'

* Try:
> Run with --stacktrace option to get the stack trace.
> Run with --info or --debug option to get more log output.
> Run with --scan to get full insights.

 

No matching client found for package name 해결 방법

등록된 google-services.json 파일을 삭제 및 Google Service Plugins 을 주석 처리 해주면 됩니다.

1. google-services.json 파일 삭제

프로젝트 구조

프로젝트 타입을 Project 로 변경한다.

Google-service.json 파일 확인

이전 프로젝트에서 등록했던 google-service.json 파일이 보일 것입니다.

해당 파일을 삭제해주면 되지만 Android Studio 상에서는 해당 파일이 열려있는 상태라 삭제되지 않습니다..

Android Studio 종료 후 탐색기를 통해 삭제해 주도록 합시다.

2. google service plugins 주석

Google Service 사용을 위해 plugins 추가한 build.gradle(app) , build.gradle(project) 두 파일에서 해당 내용들을 주석처리 해야 합니다.

 

build.gradle (app)

plugins {
    id 'com.android.application'
    //id 'com.google.gms.google-services'	<-- 여기
}

...

dependencies {

	...
   
    //implementation platform('com.google.firebase:firebase-bom:30.1.0')  <-- 여기
    //implementation 'com.google.firebase:firebase-analytics'			<-- 여기



}

 

build.gradle (project)

plugins {
    id 'com.android.application' version '7.2.1' apply false
    id 'com.android.library' version '7.2.1' apply false
    //id 'com.google.gms.google-services' version '4.3.10' apply false  <-- 여기
}

task clean(type: Delete) {
    delete rootProject.buildDir
}

위 두 가지 사항 처리 후 빌드 시 정상처리됨을 확인할 수 있다.

 

반응형

댓글