Ruben Meiring
Ruben Meiring

Reputation: 363

Error inflating class TextView causes a acticity not to launch

I am using Firebase Test Lab to test my app and i get this error on several devices

This stops one of my activities to launch, I am an new to android I do not know how to fix this any help would be appreciated

android.view.InflateException: Binary XML file line #27: Error inflating class TextView
     FATAL EXCEPTION: main
Process: com.smartpractice.dukatholesmartapp, PID: 6608
android.view.InflateException: Binary XML file line #27: Error inflating class TextView
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:763)
    at android.view.LayoutInflater.rInflate(LayoutInflater.java:806)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:504)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:414)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:365)
    at android.widget.Toast.makeText(Toast.java:262)
    at es.dmoral.toasty.Toasty.custom(Toasty.java:300)
    at es.dmoral.toasty.Toasty.info(Toasty.java:174)
    at es.dmoral.toasty.Toasty.info(Toasty.java:162)
    at com.smartpractice.myapplication.SecondActivity$5.onResponse(SecondActivity.java:209)
    at com.smartpractice.myapplication.SecondActivity$5.onResponse(SecondActivity.java:206)
    at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:82)
    at com.android.volley.toolbox.StringRequest.deliverResponse(StringRequest.java:29)
    at com.android.volley.ExecutorDelivery$ResponseDeliveryRunnable.run(ExecutorDelivery.java:102)
    at android.os.Handler.handleCallback(Handler.java:739)
    at android.os.Handler.dispatchMessage(Handler.java:95)
    at android.os.Looper.loop(Looper.java:135)
    at android.app.ActivityThread.main(ActivityThread.java:5254)
    at java.lang.reflect.Method.invoke(Native Method)
    at java.lang.reflect.Method.invoke(Method.java:372)
    at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
Caused by: java.lang.ArrayIndexOutOfBoundsException: length=16; index=19
    at android.content.res.StringBlock.get(StringBlock.java:65)
    at android.content.res.XmlBlock$Parser.getPooledString(XmlBlock.java:458)
    at android.content.res.TypedArray.loadStringValueAt(TypedArray.java:991)
    at android.content.res.TypedArray.getString(TypedArray.java:176)
    at androidx.appcompat.widget.TintTypedArray.getString(TintTypedArray.java:143)
    at androidx.appcompat.widget.AppCompatTextHelper.updateTypefaceAndStyle(AppCompatTextHelper.java:449)
    at androidx.appcompat.widget.AppCompatTextHelper.loadFromAttributes(AppCompatTextHelper.java:204)
    at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:105)
    at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
    at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:182)
    at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:103)
    at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1407)
    at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1457)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:725)

Here is the line where the error occurs I am not sure Which line causes the error * Line 27 from the error

*<TextView
        android:id="@+id/textView"
        android:layout_width="match_parent"
        android:layout_height="48dp"
        android:fontFamily="@font/nunito"
        android:gravity="center_horizontal"
        android:text="@string/welcome_to_smartpractice"
        android:textSize="24sp"
        app:fontFamily="@font/nunito"
        app:layout_alignSelf="baseline"
         />

Upvotes: 0

Views: 113

Answers (1)

DHAVAL A.
DHAVAL A.

Reputation: 2321

Please check caused by tag in your error log first.

It clearly says java.lang.ArrayIndexOutOfBoundsException.

So I suggest you to reverify your code of SecondActivity.java file near line 209 where you are getting some item from list.

Upvotes: 1

Related Questions