I'm getting a list of random errors when I re-run my app in Android Studio, both with "run app" and "apply changes". I have to clean and rebuild, then it works. Error like these:
Program type already present: androidx.transition.R
Duplicate resources
error: class BuildConfig is public, should be declared in a file named BuildConfig.java
Program type already present: androidx.recyclerview.R$drawable
Program type already present: androidx.lifecycle.extensions.R$style
Type loadImageToStorage$2
is defined multiple times:
Why am I constantly getting these messages? Its slowing down my work tremendously.
It mainly seems to be about duplicate resources, but it always clears when I go do "build" and then run it.
I have uninstalled Android Studio completely, and reinstalled, and I still have the same problem. Running on mac.
Thanks so much.
Cleaning an Android project simply deletes the build directory. It removes the . class files that are generated when you compile your project and then recompiles again.
Difference between make and rebuild is "clean" task. When you do rebuild project it performs clean too.
Your issue is some files are missing, don't delete the Gradle file and any inbuild files and classes. If you need this project try to undo what you did, or try to recover revert it back if your project is connected with the version controller.
Try following ways in order of listing:
Make Project
from Build menu.File
menu and select Invalidate Cache/restart
. distributionUrl
in gradle-wrapper.properties to some other versions (higher one preferred).distributionUrl=https\://services.gradle.org/distributions/gradle-5.6.4-all.zip
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With