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

元气小坏坏 提交于 2019-12-20 11:03:44

问题


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.


回答1:


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.




回答2:


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




回答3:


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

I had upgraded yesterday to the most recent stable version of Android Studio, 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



回答4:


just clean and rebuild your project




回答5:


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.




回答6:


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



来源:https://stackoverflow.com/questions/49513356/error-running-app-unknown-error-in-android-studio-3-1

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!