본문 바로가기
안드로이드/오류수정

안드로이드 Cannot access class 'retrofit2.Retrofit' 에러

by 안드뽀개기 2022. 1. 10.
반응형

새로운 프로젝트의 구조를 잡던 중에 Dagger 라이브러리를 추가하고 빌드를 했더니 (Dagger component파일이 생성을 위해 빌드를 함) 다음과 같은 에러가 발생했다.

 

영문을 알 수가 없어서 구글링 해보니 나와 같은 증상을 겪은 사람이 있었다.
https://stackoverflow.com/questions/47124987/dagger-2-cannot-access-retrofit

 

Dagger 2 cannot access Retrofit

I'm trying to provide an instance of Retrofit to my Repository using Dagger 2 (with Android module). Buy I'm facing the error: Error:cannot access Retrofit Other instances like Picasso was inje...

stackoverflow.com

 

build.gradle(app수준)에서 retrofit의 의존성을 다음과 같이 수정했고 문제가 해결되었다.

수정 전

 

수정 후

반응형