0

After adding EditText to my layout xml my android application's error reporting gives such an exception on some user devices.

android.view.InflateException: Binary XML file line #76: Error inflating class <unknown>
        at android.view.LayoutInflater.createView(LayoutInflater.java:513)
        at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:563)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:618)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:621)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:407)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:320)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:276)
        at com.android.internal.policy.impl.PhoneWindow.setContentView(PhoneWindow.java:200)
        at android.app.Dialog.setContentView(Dialog.java:421)
        at myobfuscated.d.dt.<init>(ProGuard:52)...

I cannot reproduce this on my own phone, but I'm getting complaints from other users. If some of you have experienced such a problem before, pls give me a hint on how to reproduce/resolve it.

and here is that part of my layout xml file that starting from line #76

<EditText android:hint="Message your friend"
            android:textSize="15sp" android:paddingLeft="4dp" android:id="@+id/msgTextField"
            android:layout_width="180dp" android:layout_height="100dp"
            android:layout_below="@+id/gift_layout"
            android:layout_centerHorizontal="true" android:layout_marginTop="15dp"
            android:maxLength="100"
            android:background="@drawable/input_name"
            android:scrollY="10dp" />
Ruzanna
  • 9,766
  • 4
  • 18
  • 23
  • Please edit your question to include the relevant portion of your layout resource file, clearly indicating which is the "line #76" that is triggering your error. – CommonsWare Oct 15 '12 at 14:58
  • pls provide us with layout xml file content – ra. Oct 15 '12 at 14:58
  • @Ruzanna: Post your code, that will help to answer your question. – Abdul Rahman Oct 15 '12 at 15:01
  • I've edited the question and added that part of layout. thanks. – Ruzanna Oct 15 '12 at 15:22
  • Look here http://stackoverflow.com/questions/8244390/error-inflating-class-unknown-which-i-know-is-a-webview, ensure it is not your case (Memory Leaks, Out Of memory). – ra. Oct 15 '12 at 15:29
  • @ra: actually before there were no such exception before adding Edittext part. that's why I think the pointed one is not my case. – Ruzanna Oct 15 '12 at 15:33
  • I have had similar behaviour (ML, caused by managed cursors). Try to figure out with help of eclipse plugin: *Memory Analyzer* - http://download.eclipse.org/mat/1.1/update-site/ – ra. Oct 15 '12 at 15:37
  • I think part of the reason you cant reproduce this is that your code is being run thru proguard. If you arent, you should be testing with your production version of your binary. – petey Oct 15 '12 at 15:44
  • @ra: thanks, I'll try with memory analyzer, will be back as soon as I get some results. – Ruzanna Oct 15 '12 at 17:37
  • @forgivegod: my release version of app is being obfuscated by proguard. I'm trying app in release as well as debug mode, but with no success in reproducing the exception. btw, as I an see from error reporting the the exception is specific to android 2.2, 2.2.1 versions. I have tried on 2.2.1, but everything was fine. :( – Ruzanna Oct 15 '12 at 17:38
  • Try to figure out exact model of device where it happens, OS version, MEM, etc – ra. Oct 15 '12 at 18:44

1 Answers1

0

The problem was in android:scrollY="10dp" attribute. It caused the above mentioned problem/exception on some models of phones. Though I couldn't reproduce it by myself but after removing that atribute the exception went off and I've got no complaints from the users anymore.

Ruzanna
  • 9,766
  • 4
  • 18
  • 23