본문 바로가기
IT/ERROR

Android "package R does not exist" 오류 발생

by TechTonic 2022. 7. 7.
반응형

package R does not exist 발생 현상

Android Studio 에서 코드 복/붙 후 빌드 시 "package R does not exist" 가 발생되면서 "R" 리소스가 오류로 나타난다.

package R does not exist 발생 현상

스택오버플로우 참고 자료

https://stackoverflow.com/questions/12986301/package-r-does-not-exist

 

package R does not exist

I'm getting the dreaded package R does not exist, it's killing me. The code is fine I have apps in the market running the code. Now it's effecting simple webview applications. o.0 R.string.app_...

stackoverflow.com

package R does not exist 해결 방안

java 파일 상단 패키지명+R 을 import 합니다.

import com.test.test.R;

이후 [ Android Studio > Build > Recompile 'java 파일' ]  메뉴를 실행하여 리소스를 재 컴파일 해줍니다.

그럼 빌드에 성공할 겁니다.

반응형

댓글