3

Below is my crashing log.

The crash is happening when I select some text in a textview. Unfortunately this log does not contain any references to my program. Any ideas to debug it?

Also the final line is not a typo, the log just ends there. With the help of Bugsense that is the best log I can get.

05-07 21:58:15.350  21098-21098/my.package E/AndroidRuntime﹕ FATAL EXCEPTION: main
    android.view.InflateException: Binary XML file line #17: Error inflating class 
at android.view.LayoutInflater.createView(LayoutInflater.java:613)
at com.android.internal.policy.impl.PhoneLayoutInflater.onCreateView(PhoneLayoutInflater.java:56)
at android.view.LayoutInflater.onCreateView(LayoutInflater.java:660)
at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:685)
at android.view.LayoutInflater.inflate(LayoutInflater.java:466)
at android.view.LayoutInflater.inflate(LayoutInflater.java:396)
at android.view.LayoutInflater.inflate(LayoutInflater.java:352)
at android.widget.Editor$ActionPopupWindow.initContentView(Editor.java:2963)
at android.widget.Editor$PinnedPopupWindow.(Editor.java:2248)
at android.widget.Editor$ActionPopupWindow.(Editor.java:2936)
at android.widget.Editor$ActionPopupWindow.(Editor.java:2936)
at android.widget.Editor$HandleView.showActionPopupWindow(Editor.java:3157)
at android.widget.Editor$SelectionModifierCursorController.showActionPopupWindow(Editor.java:3687)
at android.widget.Editor.onTouchEvent(Editor.java:1135)
at android.widget.TextView.onTouchEvent(TextView.java:7430)
at android.view.View.dispatchTouchEvent(View.java:7190)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at android.view.ViewGroup.dispatchTransformedTouchEvent(ViewGroup.java:2280)
at android.view.ViewGroup.dispatchTouchEvent(ViewGroup.java:2023)
at com.android.internal.policy.impl.PhoneWindow$DecorView.superDispatchTouchEvent(PhoneWindow.java:1931)
at com.android.internal.policy.impl.PhoneWindow.superDispatchTouchEvent(PhoneWindow.java:1385)
at android.app.Activity.dispatchTouchEvent(Activity.java:2396)
at com.android.internal.policy.impl.PhoneWindow$DecorView.dispatchTouchEvent(PhoneWindow.java:1879)
at android.view.View.dispatchPointerEvent(View.java:7370)
at android.view.ViewRootImpl.deliverPointerEvent(ViewRootImpl.java:3182)
at android.view.ViewRootImpl.deliverInputEvent(ViewRootImpl.java:3127)
at android.view.ViewRootImpl.doProcessInputEvents(ViewRootImpl.java:4164)
at android.view.ViewRootImpl.enqueueInputEvent(ViewRootImpl.java:4143)
at android.view.ViewRootImpl$WindowInputEventReceiver.onInputEvent(ViewRootImpl.java:4235)
at android.view.InputEventReceiver.dispatchInputEvent(InputEventReceiver.java:171)
at android.view.InputEventReceiver.nativeConsumeBatchedInputEvents(Native Method)
at android.view.InputEventReceiver.consumeBatchedInputEvents(InputEventReceiver.java:163)
at android.view.ViewRootImpl.doConsumeBatchedInput(ViewRootImpl.java:4214)
at android.view.ViewRootImpl$ConsumeBatchedInputRunnable.run(ViewRootImpl.java:4254)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:725)
at android.view.Choreographer.doCallbacks(Choreographer.java:555)
at android.view.Choreographer.doFrame(Choreographer.java:523)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:711)
at android.os.Handler.handleCallback(Handler.java:615)
at android.os.Handler.dispatchMessage(Handler.java:92)
at android.os.Looper.loop(Looper.java:213)
at android.app.ActivityThread.main(ActivityThread.java:4787)
at java.lang.reflect.Method.invokeNative(Native Method)
at java.lang.reflect.Method.invoke(Method.java:511)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:556)
at dalvik.system.NativeStart.main(Native Method) Caused by: java.lang.reflect.InvocationTargetException
at java.lang.reflect.Constructor.constructNative(Native Method)
at java.lang.reflect.Constructor.newInstance(Constructor.java:417)
at android.view.LayoutInflater.createView(LayoutInflater.java:587)
... 61 more Caused by: java.lang.ArrayIndexOutOfBoundsException: length=15; index=513
at android.content.res.StringBlock.get(StringBlock.java:64)
at android.content.res.XmlBlock$Parser.getPooledString(XmlBlock.java:458)
at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:720)
at android.content.res.TypedArray.getString(TypedArray.java:124)
at android.widget.TextView.(TextView.java:800)
at android.widget.TextView.(TextView.java:450)
... 64 more

Reproduction:

I have a TextView with android:textIsSelectable="true". If I click shortly I select the text and manipulate the handles copy the text etc... If I long-click (I guess 1-2 seconds is enought) I get the crash. It looks like it's my Xperia's Phone problem that I test the app and not my apps problem. Am I correct?

The textview:

<TextView
    android:id="@+id/Description"
    android:layout_below="@id/HeaderDivider"
    android:layout_width="fill_parent"
    android:layout_height="wrap_content"
    android:layout_margin="10dp"
    android:fontFamily="sans-serif"
    android:textSize="13.5sp"
    android:layout_marginTop="13dp"
    android:autoLink="web|email|phone"
    android:textIsSelectable="true"
    android:textColor="#343434" />

And the theme it uses is MyTheme.TranslucentActionBar:

<style name="MyTheme.TranslucentActionBar">
    <item name="android:actionBarStyle">        @style/MyTheme.ActionBar.Transparent</item>
    <item name="android:windowActionBarOverlay">true</item>
    <item name="android:windowContentOverlay">  @null</item>
</style>

<style name="MyTheme.ActionBar.Transparent" >
    <item name="android:background">@android:color/transparent</item>
</style>

<style name="MyTheme" parent="android:Theme.Holo.Light">
    <item name="android:fontFamily">            sans-serif-light</item>
    <item name="android:windowBackground">      @color/white</item>
    <item name="android:editTextBackground">    @drawable/edit_text_holo_light</item>
    <item name="android:textColorHighlight">    #99d04e36</item>
    <item name="android:textColorLink">         @color/LightRed</item>
    <item name="android:autoCompleteTextViewStyle">     @style/AutoCompleteTextViewP</item>
    <item name="android:listChoiceIndicatorMultiple">   @drawable/btn_check_holo_light</item>
    <item name="android:listChoiceIndicatorSingle">     @drawable/btn_radio_holo_light</item>
    <item name="android:buttonStyle">           @style/ButtonP</item>
    <item name="android:imageButtonStyle">      @style/ImageButtonP</item>
    <item name="android:listChoiceBackgroundIndicator"> @drawable/list_selector_holo_light</item>
    <item name="android:activatedBackgroundIndicator">  @drawable/activated_background_holo_light</item>
    <item name="ptrHeaderStyle">                @style/P.PtrHeader</item>
    <item name="spbStyle">                      @style/SmoothProgressBarP</item>
</style>
Diolor
  • 13,181
  • 30
  • 111
  • 179
  • Please Post your xml files –  May 07 '14 at 19:05
  • @TDMaster Which ones do you recommend? – Diolor May 07 '14 at 19:06
  • 1
    post the end of the stacktrace. – njzk2 May 07 '14 at 19:07
  • since you inflate this TextView somewhere can you post any files realted –  May 07 '14 at 19:07
  • @staaar : can't you see `PhoneLayoutInflater` is in `com.android.internal.policy.impl`? – njzk2 May 07 '14 at 19:07
  • @Diolor : the reference to your program is probably later in the stacktrace (after the caused by). Are you sure you can't get that part of the log? – njzk2 May 07 '14 at 19:08
  • @njzk2 Surprisingly that's where my log ends. It's not a typo. Any ideas to get the rest? – Diolor May 07 '14 at 19:08
  • InvocationTargetException is usually a wrapper to a NPE – zgc7009 May 07 '14 at 19:09
  • @Diolor : but can't you reproduce that issue? – njzk2 May 07 '14 at 19:14
  • @njzk2 I can reproduce it everytime I select some text from a particular view. The logcat just dies always at that line. – Diolor May 07 '14 at 19:20
  • yes, apparently a logcat message is limited to 4096 bytes, which is probably what is happening here. – njzk2 May 07 '14 at 19:24
  • anyway, invocationtargetexception is usually something about either `android:onClick` method that crashes for another reason, or a custom view class that crashes during initialization. I would go for the second one in your case. Do you have any custom views? – njzk2 May 07 '14 at 19:25
  • @njzk2 Only one, which I do not believe interferes with the rest layout (`fr.castorflex.android.smoothprogressbar.SmoothProgressBar`). Take a look at my updated log. I think it's my phone's problem and not an app problem. – Diolor May 08 '14 at 02:09
  • what android version is it running? do you use a custom theme/style for that textview? – njzk2 May 08 '14 at 12:53
  • @njzk2 The phones runs on API 16, app targets 19. I do, updated my question. `fontFamily` could be a candidate but it's fine with 16. Thanks for your effort here. – Diolor May 08 '14 at 15:12
  • I would try to remove stuff until it stops crashing – njzk2 May 08 '14 at 15:18

0 Answers0