19

After updating Android Studio to 3.3 V I am getting the following error:

enter image description here

Android Studio build fails

I have updated all the gradle dependencies.

Are there any solutions to this?

Hasini
  • 327
  • 4
  • 19
primo
  • 1,340
  • 3
  • 12
  • 40
  • 2
    Please add code and data as text ([using code formatting](//stackoverflow.com/editing-help#code)), not images. Images: A) don't allow us to copy-&-paste the code/errors/data for testing; B) don't permit searching based on the code/error/data contents; and [many more reasons](//meta.stackoverflow.com/a/285557). Images should only be used, in addition to text in code format, if having the image adds something significant that is not conveyed by just the text code/error/data. – double-beep Apr 30 '19 at 05:24
  • 1
    how this is off topic. Many more questions are there which describes same problem – primo Apr 30 '19 at 05:54
  • Please see my comment above for possible explanations. Questions similar to yours might need closure, too. – double-beep Apr 30 '19 at 05:55
  • If you have any solution to this it is welcomed otherwise just tell me where to search for this kind of error which is faced by many users – primo Apr 30 '19 at 05:58
  • After reading your comment I should say from where should I add the code if I dont know which part of code is throwing me this error. – primo Apr 30 '19 at 05:59
  • 5
    The traceback tells you which part of the code to examine. Please note also that wildly different bugs could give rise to the same symptom (as witnessed by the completely different answers you received). Posting your error message as an image adds insult to injury by making it impossible to search, copy/paste, etc. This is simply unlikely to provide reliable help to future visitors in its current form. If you still need clarifications for how to interpret the Stack Overflow [posting guidance](/help/how-to-ask), please raise a new question on [meta]. – tripleee Apr 30 '19 at 06:17
  • "Reopen question".I dont think so question should be closed after 2 months of asking and recievind almost 6500 views and community cannot dis regard this that this problem is faced by many users that is the only reason it is viewd by this much users.Many users have commented and answered their own way to solve this problem. – primo Apr 30 '19 at 09:44
  • I agree - debugging questions should only be closed when they do not "include the desired behavior, a specific problem or error and the shortest code necessary to reproduce it in the question itself. Questions without a clear problem statement are not useful to other readers." . However, the formatting (text as image is silly, just copy and paste it into a code chunk delimited by ```) and the lack of minimal reproducible example are still problems. – asachet Jun 04 '19 at 11:27
  • Update Studio Android 3.4.2 and Gradle it will resolved – Ravv Jul 10 '19 at 14:27
  • @primo did you find the solution for this error? – Nirmal Prajapat Jul 11 '19 at 08:39
  • @Nirmal Prajapat I converted my project to androidx – primo Jul 11 '19 at 10:10
  • @primo I have already migrated my project to androidx, still getting this issue. – Nirmal Prajapat Jul 11 '19 at 10:28
  • so you can check your logs it will show you where exactly the error is – primo Jul 11 '19 at 10:35

3 Answers3

22

I solved this problem by disabling instant run.

Ayoub
  • 493
  • 3
  • 8
  • 1
    its working for me... – Muhammad Waleed Jun 10 '19 at 03:53
  • Me too.. But why it's not working in the first place? I miss Instant Run feature :") – aldok Jun 18 '19 at 04:24
  • this is how to disable that https://stackoverflow.com/questions/46999669/how-to-disable-instant-run-for-android-studio-3-0 – Lasitha Lakmal Jul 19 '19 at 16:12
  • I too tried out with following options and its worked for me. try following work arounds if instant fix not work 1. Preferences->Build,Execution,Deployment->Instant Run->Uncheck Enable Instant Run 2. Update dependencies versions to comply with target SDK version. If you notice any version missmatches try with second option first and if it not resolved moved to first option. – eranda.del Jul 22 '19 at 00:51
  • I actually solved by enabling instant run after migrating to androidx. Not sure if toggling it one way or the other is the answer, but thats what worked for me. – Robert Bentley Aug 16 '19 at 15:59
  • Sorry but It doesn't work for me, and I'm still facing the same issue. – Sujeet Oct 04 '19 at 09:53
  • It is actually related to a specific version of the gradle, later on i upgraded gradle then enable it again and worked just fine, so consider upgrading the gradle pluging to 3.5.1 and gradle to 5.4.1 and you can leave the instant run as it is, this should solve your problem. – Ayoub Oct 05 '19 at 14:30
9

I had a similar problem, when I added a ButterKnife library:

implementation 'com.jakewharton:butterknife:10.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.0.0'

But, then I notice that version did not work very well and changed it by (GRADLE):

implementation 'com.jakewharton:butterknife:8.4.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.4.0'

Maybe you need to check the version of some library you are using.

Oscar Albert
  • 803
  • 8
  • 13
  • 4
    Yes you might be correct but migrating to androidx solved my problem. Infact after that also this error occurs when there is a simple error in layout or code file. – primo Feb 11 '19 at 06:15
  • Don't try to migrating to androidx blindly. I resolved problem just down grading the butterknife version from 10.0.0 to 8.4.0. It worked – GS Nayma Jul 14 '19 at 14:11
  • For me this one worked: implementation 'com.jakewharton:butterknife:7.0.1' annotationProcessor 'com.jakewharton:butterknife:7.0.1' – Lucky Rana Jul 25 '19 at 07:50
2

I had the exact same error.

I had changed the parameters of one of my class constructors - I added another parameter to the constructor but did not change where I was previously using that constructor.

drinu16
  • 775
  • 2
  • 11
  • 25