2016-09-30 13 views
-1

내 앱에서 SugarOrm을 사용하고 싶습니다.오류 : 프로젝트에 Sugar ORM을 추가 한 후 기호 메소드 getColor (Context, int)를 찾을 수 없습니다.

나는 다음 추가 경우 : Gradle을 파일에

compile 'com.github.satyan:sugar:1.4' 

내 mainfest의 응용 프로그램 이름

android:name="com.orm.SugarApp" 

내가 빌드에 다음과 같은 오류가 발생합니다 :

이 라인에서
Error:(75, 55) error: cannot find symbol method getColor(Context,int) 

:

holder.bg.setBackgroundColor(ContextCompat.getColor(ctx, R.color.primary_move)); 

나는이 2 선없이 이전 버전으로 체크 아웃하는 경우, 내 응용 프로그램 빌드 및 runds 오류없이.

의견이 있으십니까? Android Documentation에서

답변

0

'com.github.satyan:sugar:1.6'을 업데이트했으며 오류가 사라졌습니다.

0

는 :

Helper for accessing features in Context introduced after API level 4 in a backwards compatible fashion.

당신은 정말 이전 버전과의 호환성 필요하십니까? 문맥으로부터 getColor에 액세스 해주세요. 그러나 Context.getColor()을 계속 사용하면서도 주된 문제를 해결할 수 있습니다.