인프런 커뮤니티 질문&답변
Namespace 오류 질문 드립니다.
작성
·
1.2K
0
allprojects {
repositories {
google()
mavenCentral()
/* maven {
url "${project(':background_fetch').projectDir}/libs"
}*/
}
}
rootProject.buildDir = "../build"
subprojects {
project.buildDir = "${rootProject.buildDir}/${project.name}"
}
subprojects {
project.evaluationDependsOn(":app")
}
tasks.register("clean", Delete) {
delete rootProject.buildDir
}위 코드로 FLUTTER 빌드를 실행하면 아래와 같은 오류가 뜹니다.
FAILURE: Build failed with an exception.
* What went wrong:
A problem occurred configuring project ':qr_code_scanner'.
> Could not create an instance of type com.android.build.api.variant.impl.LibraryVariantBuilderImpl.
> Namespace not specified. Specify a namespace in the module's build file. See https://d.android.com/r/tools/upgrade-assistant/set-namespace for information about setting the namespace.
If you've specified the package attribute in the source AndroidManifest.xml, you can use the AGP Upgrade Assistant to migrate to the namespace value in the build file. Refer to https://d.android.com/r/tools/upgrade-assistant/agp-upgrade-assistant for general information about using the AGP Upgrade Assistant.
네임스페이스도 지정되어 있고 AGP도 이상이 없는데 뭐가 문제 일까요 ㅠㅠㅜ?
답변 1
-1
안녕하세요, 인프런 AI 인턴입니다.
cms926863님, 작성하신 오류 메시지를 보면 네임스페이스를 지정하라는 메시지가 표시되고 있습니다. 이 문제는 보통 build.gradle 파일에서 네임스페이스가 제대로 설정되지 않았을 때 발생합니다. 특히, Android Gradle Plugin(AGP)의 최신 버전은 네임스페이스를 정확히 지정해야 하므로, 이 부분을 확인해보세요.
build.gradle파일에서 네임스페이스 설정 확인:module-name/build.gradle파일에 다음과 같이 설정되어 있는지 확인하세요.
android { namespace 'com.example.myapplication' }
AndroidManifest.xml의
package속성 확인:- AndroidManifest.xml 파일의
package속성이 네임스페이스와 일치하는지 확인해 보세요.
- AndroidManifest.xml 파일의
AGP(안드로이드 그레이들 플러그인) 버전 확인:
- 사용 중인 AGP 버전과 네임스페이스 명시 기준이 호환되는지 확인하세요.
- 사용 중인 AGP 버전과 네임스페이스 명시 기준이 호환되는지 확인하세요.
위의 부분을 점검하시면 문제 해결에 도움이 되실 것입니다. 더 많은 정보는 Android의 네임스페이스 설정 가이드에서 확인할 수 있습니다.
도움이 되셨기를 바랍니다. 추가적인 질문이 있으시면 언제든지 문의해 주세요!





네임스페이스가 'com.example.my'라 이렇게 하고 돌렸는데도 아래와 같은 오류가 뜹니다 ㅠㅠ
* What went wrong:
A problem occurred evaluating root project 'android'.
> Could not find method android() for arguments [build_5tibe51tneisgtmxf8s0qar06$_run_closure5@10a1b89a] on root project 'android' of type org.gradle.api.Project.