Задать вопрос
@Chesterfield25

Почему выдаёт ошибку?

В Android studio вылезает ошибка не могу понять почему и как исправить?

Код ошибки
2021-04-16 22:57:52.758 19945-19945/com.buratinoapps.freefacebookvideodownloader E/AndroidRuntime: FATAL EXCEPTION: main
    Process: com.buratinoapps.freefacebookvideodownloader, PID: 19945
    java.lang.RuntimeException: Unable to start activity ComponentInfo{com.buratinoapps.freefacebookvideodownloader/com.buratinoapps.freefacebookvideodownloader.activity.MainActivity}: android.view.InflateException: Binary XML file line #58: Binary XML file line #58: Error inflating class TextView
        at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:2946)
        at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3081)
        at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:78)
        at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:108)
        at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:68)
        at android.app.ActivityThread$H.handleMessage(ActivityThread.java:1831)
        at android.os.Handler.dispatchMessage(Handler.java:106)
        at android.os.Looper.loop(Looper.java:201)
        at android.app.ActivityThread.main(ActivityThread.java:6810)
        at java.lang.reflect.Method.invoke(Native Method)
        at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
        at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:873)
     Caused by: android.view.InflateException: Binary XML file line #58: Binary XML file line #58: Error inflating class TextView
     Caused by: android.view.InflateException: Binary XML file line #58: Error inflating class TextView
     Caused by: java.lang.UnsupportedOperationException: Can't convert value at index 2 to dimension: type=0x1
        at android.content.res.TypedArray.getDimensionPixelSize(TypedArray.java:738)
        at android.widget.TextView.readTextAppearance(TextView.java:3559)
        at android.widget.TextView.<init>(TextView.java:959)
        at android.widget.TextView.<init>(TextView.java:869)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:100)
        at androidx.appcompat.widget.AppCompatTextView.<init>(AppCompatTextView.java:95)
        at androidx.appcompat.app.AppCompatViewInflater.createTextView(AppCompatViewInflater.java:194)
        at androidx.appcompat.app.AppCompatViewInflater.createView(AppCompatViewInflater.java:115)
        at androidx.appcompat.app.AppCompatDelegateImpl.createView(AppCompatDelegateImpl.java:1551)
        at androidx.appcompat.app.AppCompatDelegateImpl.onCreateView(AppCompatDelegateImpl.java:1602)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:776)
        at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:734)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:867)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.rInflate(LayoutInflater.java:870)
        at android.view.LayoutInflater.rInflateChildren(LayoutInflater.java:828)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:519)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:427)
        at android.view.LayoutInflater.inflate(LayoutInflater.java:374)
        at androidx.appcompat.app.AppCompatDelegateImpl.setContentView(AppCompatDelegateImpl.java:696)
        at androidx.appcompat.app.AppCompatActivity.setContentView(AppCompatActivity.java:170)
        at com.buratinoapps.freefacebookvideodownloader.activity.MainActivity.onCreate(MainActivity.java:20)
        at android.app.Activity.performCreate(Activity.java:7224)
        at android.app.Activity.performCreate(Activity.java:7213)
2021-04-16 22:57:52.759 19945-19945/com.buratinoapps.freefacebookvideodownloader E/AndroidRuntime:     at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1272)


XML CODE

<?xml version="1.0" encoding="utf-8"?>
<androidx.coordinatorlayout.widget.CoordinatorLayout
    xmlns:android="http://schemas.android.com/apk/res/android"
    xmlns:tools="http://schemas.android.com/tools"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    tools:context=".activity.MainActivity">

    <ScrollView
        android:layout_width="match_parent"
        android:layout_height="match_parent">

        <RelativeLayout
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="center_horizontal"
            android:orientation="vertical">

        <RelativeLayout
            android:id="@+id/RLTopLayout"
            android:layout_width="match_parent"
            android:layout_height="300dp"
            android:background="@color/bluefb"
            android:visibility="visible">

            <RelativeLayout
                android:id="@+id/LLOpenFacebbook"
                android:layout_width="match_parent"
                android:layout_height="wrap_content"
                android:layout_centerHorizontal="true"
                android:background="@drawable/rectangle_white"
                android:layout_marginStart="15dp"
                android:layout_marginEnd="15dp"
                android:padding="10dp"
                android:layout_centerVertical="true">

                <EditText
                    android:id="@+id/past_link"
                    android:layout_width="match_parent"
                    android:layout_height="60dp"
                    android:background="@drawable/et_back"
                    android:hint="@string/paste_link"
                    android:padding="15dp"
                    android:singleLine="true"
                    android:textColor="@color/black"
                    android:textColorHint="@color/grey"
                    android:textSize="15sp" />

                <LinearLayout
                    android:id="@+id/RLDownloadLayout"
                    android:layout_below="@+id/past_link"
                    android:layout_width="match_parent"
                    android:layout_height="wrap_content"
                    android:layout_marginTop="10dp"
                    android:orientation="horizontal"
                    android:weightSum="2">

                    <TextView
                        android:id="@+id/login_btn"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="2dp"
                        android:layout_weight="1"
                        android:background="@drawable/et_back"
                        android:backgroundTint="@color/bluefb"
                        android:gravity="center"
                        android:padding="14dp"
                        android:text="@string/download"
                        android:textAllCaps="false"
                        android:textColor="@color/white"
                        android:textSize="@dimen/download_txt_size" />

                    <TextView
                        android:id="@+id/tv_paste"
                        android:layout_width="match_parent"
                        android:layout_height="wrap_content"
                        android:layout_margin="2dp"
                        android:layout_weight="1"
                        android:background="@drawable/et_back"
                        android:backgroundTint="@color/bluefb"
                        android:gravity="center"
                        android:padding="14dp"
                        android:text="@string/paste"
                        android:textAllCaps="false"
                        android:textColor="@color/white"
                        android:textSize="@dimen/paste_txt_size" />

                </LinearLayout>

            </RelativeLayout>

        </RelativeLayout>

        </RelativeLayout>

    </ScrollView>

</androidx.coordinatorlayout.widget.CoordinatorLayout>


Проблема заключается в TextView так как без вставки кода TextView всё работает нормально!
Но что именно с ним не так не могу понять.

MainActivity class пустой
  • Вопрос задан
  • 655 просмотров
Подписаться 1 Простой Комментировать
Пригласить эксперта
Ответы на вопрос 1
@Chesterfield25 Автор вопроса
Нашел решение проблемы. С TextView удалил строку

android:textSize="@dimen/paste_txt_size"
Подставив обычное значение
Ответ написан
Комментировать
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Похожие вопросы