- Cannot locate tasks that match 'app:installDebug' as task 'installDebug' is ambiguous in project ':app'. Candidates are: 'installDevDebug', 'installDevDebugAndroidTest', 'installPrdDebug', 'installPrdDebugAndroidTest'.
- 이와 같은 오류가 발생하였습니다. 해당 문제는 fiebase 설정 중 google-services.json 파일을 개발 환경과 운영 환경을 각각 분리할 때에 적용하는 flavorDimensions 오류였습니다.
FAILURE: Build failed with an exception.
* What went wrong:
Cannot locate tasks that match'app:installDebug'as task 'installDebug'is ambiguous in project ':app'. Candidates are: 'installDevDebug', 'installDevDebugAndroidTest', 'installPrdDebug', 'installPrdDebugAndroidTest'.
* Try:
> Run gradlew tasks toget a list of available tasks.
>For more on name expansion, please refer to<https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:name_abbreviation>in the Gradle documentation.
> 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.>Get more help at<https://help.gradle.org>.
BUILD FAILED in4s
error Failed to install the app. Command failed with exit code 1: ./gradlew app:installDebug -PreactNativeDevServerPort=8081 FAILURE: Build failed with an exception. * What went wrong:
Cannot locate tasks that match'app:installDebug'as task 'installDebug'is ambiguous in project ':app'. Candidates are: 'installDevDebug', 'installDevDebugAndroidTest', 'installPrdDebug', 'installPrdDebugAndroidTest'. * Try:
> Run gradlew tasks toget a list of available tasks.
>For more on name expansion, please refer to<https://docs.gradle.org/8.6/userguide/command_line_interface.html#sec:name_abbreviation>in the Gradle documentation.
> 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.>Get more help at<https://help.gradle.org>. BUILD FAILED in4s.
info Run CLI with--verbose flag for more details.
error Command failed with exit code 1.
info Visit <https://yarnpkg.com/en/docs/cli/run>for documentation about this command.
- 아래와 같이 개발과 운영 환경에 따라서, 분리를 하는 작업을 수행하였습니다. - 개발의 경우는 dev 디렉터리에 있는 dev/google-services.json 파일을 바라보게 하며, 운영의 경우는 prd 디렉터리에 있는 prd/google-services.json 파일을 바라보도록 구성하였습니다.
💡 해결방안 접근 -2 - 위에 글에서 확인할 수 있듯이 productFlavors로 지정하여서 dev인 경우는 installDevDebug를 수행하며, prd인 경우는 installPrdDebug를 수행하는 것을 확인하였습니다. - 이에 따라서 package.json 파일 내에서 해당 파일들이 각각 수행되도록 지정을 합니다.