Error in build.gradle "should not contain a package statement

3

Yesterday I saved everything and today when I open the project it tells me this error. I never saw it and I do not know what it could be. I think that fontprovidercerts is missing some characters but the truth is that I do not know what they are. I appreciate any help.

    /* AUTO-GENERATED FILE.  DO NOT MODIFY.
    *
    * This class was automatically generated by the
    * gradle plugin from the resource data it found. It
    * should not be modified by hand.
    */
    package android.support.customview;

    public final class R {
    private R() {}

    public static final class attr {
        private attr() {}

        public static final int alpha = 0x7f030027;
        public static final int font = 0x7f0300d7;
        public static final int fontProviderAuthority = 0x7f0300d9;
        public static final int fontProviderCerts = 0x7f0
    }
}
    
asked by Juampi 04.12.2018 в 13:13
source

2 answers

0

The class is automatically generated and should not be modified manually. What you can do is: click on File -> Invalidate cache and restart

Then click on Build -> Rebuild project

    
answered by 04.12.2018 / 13:54
source
1

Actually what happened is that you possibly had an incorrect resource name

Remember that the resource nomenclature, only files with names containing lowercase characters from "a" to "z" and numeric characters from 0 to 9 are allowed.

If you defined a name that is not allowed, it will not allow you to build the project until it is corrected.

If it is already corrected, simply build the project again.

Build > Rebuild project

If you updated Android Studio and your project worked without problem, perform

File > Invalidate cache and restart

Review:

Numerous errors in R for changing the Gradle version (ANDROID STUDIO)

    
answered by 04.12.2018 в 20:15