1

My project is not building after changing the gradle link in gradle.project If the value is -

 dependencies {
        classpath 'com.android.tools.build:gradle:3.0.1'
        classpath 'com.google.gms:google-services:3.1.0'
    }
}

then it works but if I change classpath 'com.android.tools.build:gradle:3.0.1' to classpath 'com.android.tools.build:gradle:3.1.0' then I get an error.

Error:

Caused by: java.lang.IllegalArgumentException: couldn't make a guess for com.example.example.databinding.ContentClassApplicationMyClass1Binding

and error in xml at

        android:layout_height="?attr/actionBarSize"

and

 style="?borderlessButtonStyle"

How can I update the gradle and fix the issues?

Please refer to this link for more code:

Caused by: java.lang.IllegalArgumentException: couldn't make a guess for com.example.example.databinding.ContentClassApplicationMyClass1Binding

jason
  • 3,932
  • 11
  • 52
  • 123
  • share complete complete codes – Abhinav Gupta Mar 28 '18 at 10:46
  • @AbhinavGupta I've shared the link of the where I've shared the entire code - https://stackoverflow.com/questions/49528437/caused-by-java-lang-illegalargumentexception-couldnt-make-a-guess-for-com-exa/49529522?noredirect=1#comment86071123_49529522 – jason Mar 28 '18 at 10:50
  • @AbhinavGupta I'm still getting the same error! – jason Mar 28 '18 at 11:41
  • @AbhinavGupta Can I share something over here which ca help you debug the issue? – jason Mar 28 '18 at 11:48
  • Having same issue ( cannot resolve android:layout_height="?attr/actionBarSize" ) with google-services:3.1.0. To confirm I remove classpath 'com.google.gms:google-services:3.1.0' and the error is gone. – Puni Mar 28 '18 at 11:50
  • @jason need logcats – Abhinav Gupta Mar 28 '18 at 11:51
  • have you read this :- https://developer.android.com/topic/libraries/data-binding/index.html – Abhinav Gupta Mar 28 '18 at 11:53
  • @Puni I've removed **classpath 'com.google.gms:google-services:3.1.0' ** and **apply plugin: 'com.google.gms.google-services'** but I'm still getting this error : **Caused by: java.lang.IllegalArgumentException: couldn't make a guess for com.example.example.databinding.ContentClassApplicationMyClass1Binding** – jason Mar 28 '18 at 11:58
  • @AbhinavGupta yes! I've been using it for the last 5 months and the code works when I don't update classpath from 3.0.1 to 3.1. ALso, I'm using databinding only to access the object and settext and stuff. – jason Mar 28 '18 at 12:03
  • don't change use3.0.1 – Abhinav Gupta Mar 28 '18 at 12:04
  • @AbhinavGupta Yup. I'm doing the same but I'm still unable to understand where the problem is! – jason Mar 28 '18 at 12:04
  • without seeing your whole code I can not able to say anything because I had lot of confusion like this that's why i asked for teamviewer – Abhinav Gupta Mar 28 '18 at 12:06
  • @AbhinavGupta Hmm.. cool. I'll ping when I get free. Please let me know if you are free then! – jason Mar 28 '18 at 12:09
  • 1
    okay iwill tell you – Abhinav Gupta Mar 28 '18 at 12:10
  • @json sorry I didn't make myself clear before, what I meant is I'm having same issue like you do and the problem is with google-services:3.1.0. removing google-services:3.1.0 is not the solution because I need those for adding firebase – Puni Mar 28 '18 at 12:12
  • @Puni Oh ok. Same here. Did you find any solution for the same? – jason Mar 28 '18 at 12:15
  • @jason have you solved the issue? I am facing same – Sunny Jul 05 '18 at 13:13
  • @johnsmithNope but someone mentioned to change all classnames to Capital letters – jason Jul 12 '18 at 20:50
  • @johnsmith Please let me know if you solve it. – jason Jul 12 '18 at 20:51

0 Answers0