-1

I would like to use SugarOrm in my app.

If I add the followings:

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

to the gradle file

and

 android:name="com.orm.SugarApp"

to my mainfest's application name

I get the following error on build:

Error:(75, 55) error: cannot find symbol method getColor(Context,int)

at this line:

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

If I checkout to a previous version without these 2 lines, my application builds and runds without error.

Any suggestions?

Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222

2 Answers2

0

From the Android Documentation:

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

Do you really need that backward compatibility? Try accesing getColor from the context. You can also still useContext.getColor() while you resolve the main issue however

0

I have updated to compile 'com.github.satyan:sugar:1.6' and error is gone.

Adam Varhegyi
  • 11,307
  • 33
  • 124
  • 222