Reputation: 822
Seem to be getting this occurring error whenever I run my android application.
The only way to get around it is by rebuilding the project and runs normally again.
If anyone knows the reason for this will be much appreciated
Upvotes: 12
Views: 8315
Reputation: 2273
Under your Project view in Android Studio navigate to the .gradle
folder.
In that folder, if you see more than one version of gradle, such as, for example, 7.0.2 and 6.1.0.
Delete one of the versions, preferably the lower version.
Clean, build, and you run.
It should run each time without the error, or the necessity to clean and build.
Upvotes: 0
Reputation: 1422
For Flutter users,
Although, the problem arises everytime I try to run the project. This problems arises after I added a package in my project. So, that package might be causing some problem.
Upvotes: 3
Reputation: 763
Faced the same issue when ever tried to install the App,
Build -> Clean Project Then Build -> Make Project
even though problem arises again and again then go with the below steps.
Delete .gradle Folder within android Directory
Now, click Run it works fine.
Upvotes: 6