skip to Main Content

Im trying to fix this but idk why this v31 file keeps generating colors codes (see in SS) when I run my code, I keep deleting the color resources so that my code will run. just want to know how to stop it from doing that

Here is a screenshot of the error and the file
Here is a screenshot of the error and the file

2

Answers


  1. Please follow this;

    File –> Project Structure –> app(inside Modules) –> Dependencies — Click "+" –> Library dependency –> Search "appcompat" and click "com.android.support:appcompat-v7(com.android.support:appcompat-v7:27.1.1)" –> click OK.

    This should solve your error!

    Login or Signup to reply.
  2. Those color resources were added in Android 12 (API 31) so you’ll want to compile with SDK v31 or newer

    android {
        compileSdkVersion 31
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search