0

when I run my project in android studio every time I have this error. As you know BuildConfig is in Build file which we shouldn't edit. What should I do ?

class BuildConfig is public, should be declared in a file named BuildConfig.java
Simson
  • 3,373
  • 2
  • 24
  • 38
  • Does this answer your question? [BuildConfig is public, should be declared in a file named BuildConfig.java](https://stackoverflow.com/questions/59438157/buildconfig-is-public-should-be-declared-in-a-file-named-buildconfig-java) – starball Apr 23 '23 at 23:03

1 Answers1

0

Check to see you have BuildConfig file or not. It should be here: enter image description here

And in that file this code is written.

  public final class BuildConfig {
  public static final boolean DEBUG = Boolean.parseBoolean("true");
  public static final String APPLICATION_ID = "com.example.mytestapplication";
  public static final String BUILD_TYPE = "debug";
  public static final String FLAVOR = "";
  public static final int VERSION_CODE = 1;
  public static final String VERSION_NAME = "1.0";
}

As you said it can't be edited.

MMG
  • 3,226
  • 5
  • 16
  • 43
  • I checked the file was duplicated then I deleted to copy it works fine thank you –  Mar 17 '20 at 20:00