Devganiya Hitesh
Devganiya Hitesh

Reputation: 1207

Error running 'app': Unknown error in Android studio 3.1

I have updated my android studio to new stable version 3.1. After build project not able to run.

Let me know if anyone have face same issue or find any solution.

My event log show this error

Upvotes: 32

Views: 15058

Answers (7)

Ahmad Dosada
Ahmad Dosada

Reputation: 1

I have tried all the methods listed in your problem answers, but none of them have worked. Until I decided to try Invalidates Caches, and checked all the optional checklists available (in the Android Studio Jellyfish 2023.3.1 version there are 3 optional checklists). After that I run again and the problem was resolved

Upvotes: 0

xarlymg89
xarlymg89

Reputation: 2617

The solution that worked for me was a combination of other answers here.

I had upgraded to the most recent stable version of Android Studio at the time, 3.1. Along with that, Android Studio prompted a dialog asking me if I wanted to upgrade my Gradle from 3.x to 4.4, and I accepted as well.

After that I got the error of this question, and then I did this:

  1. Open menu Run -> Edit configurations...
  2. In the Before launch: section, select any options you have listed (each option has the Android symbol), and remove them with the - symbol
  3. Add the option Gradle-aware Make, with the value assembleDebug
  4. Clean and rebuild your whole project

Upvotes: 9

Stephen Chang
Stephen Chang

Reputation: 29

Run "Build-> Clean Project" normally will fix this problem.

Upvotes: 0

Hoby
Hoby

Reputation: 1077

just clean and rebuild your project

Upvotes: 2

Chelo
Chelo

Reputation: 443

Just go to "Run/edit configurations.../" and scroll down to bottom of the window and here you see an option "Before launch..." First, remove whatever already inside the little window and then click on (+) icon and select "Gradle-aware Make" and then type "assembleDebug" and select the first option or that you need. This will solve your problem.

Upvotes: 30

ernie
ernie

Reputation: 350

Try deleting both your build folders in your project manually and rebuild. This usually happens when you update gradle version, in my experience.

Upvotes: 16

Ionut
Ionut

Reputation: 11

I had the same problem. I change in build.gradle 'compile' with 'implementation', then clean and rebuild the project. Now it starts with no problem.

Upvotes: 1

Related Questions