Skip to content
This repository was archived by the owner on Dec 27, 2024. It is now read-only.

Error inflating class <unknown> #567

@dragitpro

Description

@dragitpro

Hello i'm triying to update the library to last version but since Version 2.0.0 , im facing an Error inflating class , i dont have this problem in Version 2.0.0-rc1.

    View view = View.inflate(getBaseContext(),R.layout.activity_description, null);
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout
	xmlns:android="http://schemas.android.com/apk/res/android"
	xmlns:app="http://schemas.android.com/apk/res-auto"
    android:id="@+id/constraintLayout2"
    android:background="?attr/colorBackgroundFloating"
    android:layout_width="match_parent"
    android:layout_height="match_parent"
    android:isScrollContainer="false">
	<FrameLayout
        android:id="@+id/main_media_frame"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"
        android:background="@android:color/black"
        app:layout_constraintBottom_toTopOf="@+id/card_view"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toTopOf="parent">
		<com.google.android.exoplayer2.ui.StyledPlayerView
            android:id="@+id/exoplayer"
            android:layout_width="match_parent"
            android:layout_height="wrap_content"
            android:gravity="top"
            app:player_layout_id="@layout/exo_simple_player_view"
            app:controller_layout_id="@layout/exo_playback_control_view"/>
	</FrameLayout>
	<androidx.cardview.widget.CardView
        android:id="@+id/card_view"
        android:layout_width="0dp"
        android:layout_height="0dp"
        app:cardCornerRadius="4dp"
        app:cardElevation="4dp"
        app:layout_constraintBottom_toBottomOf="parent"
        app:layout_constraintEnd_toEndOf="parent"
        app:layout_constraintStart_toStartOf="parent"
        app:layout_constraintTop_toBottomOf="@+id/main_media_frame">
		<androidx.constraintlayout.widget.ConstraintLayout
            android:id="@+id/constraintLayout_card"
            android:layout_width="match_parent"
            android:layout_height="match_parent"
            android:background="?attr/colorBackgroundFloating">
			<androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/source"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_marginStart="10dp"
                android:layout_marginTop="2dp"
                android:fontFamily="@font/obel"
                android:gravity="center_horizontal"
                android:maxLines="1"
                android:text="@string/source"
                android:textColor="?attr/colorSecondary"
                android:textSize="12sp"
                app:layout_constraintBottom_toBottomOf="@+id/circleView"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
			<androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/circleView"
                android:layout_width="40dp"
                android:layout_height="40dp"
                android:layout_marginStart="4dp"
                android:gravity="center_vertical"
                app:layout_constraintStart_toEndOf="@+id/source"
                app:layout_constraintTop_toTopOf="parent" />
			<androidx.appcompat.widget.AppCompatImageView
                android:id="@+id/like"
                android:layout_width="36dp"
                android:layout_height="36dp"
                android:layout_marginTop="8dp"
                android:layout_marginEnd="8dp"
                android:layout_marginBottom="8dp"
                app:layout_constraintBottom_toBottomOf="@+id/circleView"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintTop_toTopOf="parent" />
			<androidx.recyclerview.widget.RecyclerView
                android:id="@+id/rvprog"
                android:layout_width="match_parent"
                android:layout_height="0dp"
                android:background="?attr/colorBackgroundFloating"
                app:layout_constraintBottom_toTopOf="@id/adView2"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/circleView" />
			<ProgressBar
                android:id="@+id/progress_bar_loading_recycler_description"
                android:layout_width="match_parent"
                android:layout_height="match_parent"
                android:layout_marginStart="75dp"
                android:layout_marginTop="75dp"
                android:layout_marginEnd="75dp"
                android:layout_marginBottom="75dp"
                android:indeterminateTint="?attr/colorAccent"
                app:layout_constraintBottom_toTopOf="@id/adView2"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/circleView" />
			<androidx.appcompat.widget.AppCompatTextView
                android:id="@+id/programmenotavailable"
                android:layout_width="0dp"
                android:layout_height="wrap_content"
                android:gravity="center_horizontal"
                android:maxLines="2"
                android:textColor="?attr/colorSecondary"
                android:visibility="gone"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent"
                app:layout_constraintTop_toBottomOf="@+id/circleView" />
			<androidx.appcompat.widget.LinearLayoutCompat
				xmlns:ads="http://schemas.android.com/apk/res-auto"
                android:id="@+id/adView2"
                android:layout_width="wrap_content"
                android:layout_height="wrap_content"
                android:layout_alignParentBottom="true"
                android:layout_centerHorizontal="true"
                android:background="#00000000"
                ads:adSize="SMART_BANNER"
                ads:adUnitId="@string/adbannedescription"
                app:layout_constraintBottom_toBottomOf="parent"
                app:layout_constraintEnd_toEndOf="parent"
                app:layout_constraintStart_toStartOf="parent" />
			</androidx.constraintlayout.widget.ConstraintLayout>
		</androidx.cardview.widget.CardView>
	</androidx.constraintlayout.widget.ConstraintLayout>
Process: com.live.test, PID: 2398
java.lang.RuntimeException: Unable to start activity ComponentInfo{com.live.test/com.live.test.gui.DescriptionActivity}: android.view.InflateException: Binary XML file line #2 in com.live.test:layout/activity_description: Binary XML file line #2 in com.live.test:layout/activity_description: Error inflating class <unknown>
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3622)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3786)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2257)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:233)
    at android.app.ActivityThread.main(ActivityThread.java:8030)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
 Caused by: android.view.InflateException: Binary XML file line #2 in com.live.test:layout/activity_description: Binary XML file line #2 in com.live.test:layout/activity_description: Error inflating class <unknown>
 Caused by: android.view.InflateException: Binary XML file line #2 in com.live.test:layout/activity_description: Error inflating class <unknown>
 Caused by: java.lang.reflect.InvocationTargetException
    at java.lang.reflect.Constructor.newInstance0(Native Method)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:343)
    at android.view.LayoutInflater.createView(LayoutInflater.java:852)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:1004)
    at android.view.LayoutInflater.createViewFromTag(LayoutInflater.java:959)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:657)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:532)
    at android.view.LayoutInflater.inflate(LayoutInflater.java:479)
    at android.view.View.inflate(View.java:26947)
    at com.live.test.gui.DescriptionActivity.onCreate(DescriptionActivity.java:208)
    at android.app.Activity.performCreate(Activity.java:8006)
    at android.app.Activity.performCreate(Activity.java:7990)
    at android.app.Instrumentation.callActivityOnCreate(Instrumentation.java:1329)
    at android.app.ActivityThread.performLaunchActivity(ActivityThread.java:3595)
    at android.app.ActivityThread.handleLaunchActivity(ActivityThread.java:3786)
    at android.app.servertransaction.LaunchActivityItem.execute(LaunchActivityItem.java:85)
    at android.app.servertransaction.TransactionExecutor.executeCallbacks(TransactionExecutor.java:135)
    at android.app.servertransaction.TransactionExecutor.execute(TransactionExecutor.java:95)
    at android.app.ActivityThread$H.handleMessage(ActivityThread.java:2257)
    at android.os.Handler.dispatchMessage(Handler.java:106)
    at android.os.Looper.loop(Looper.java:233)
    at android.app.ActivityThread.main(ActivityThread.java:8030)
    at java.lang.reflect.Method.invoke(Native Method)
    at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:631)
    at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:978)
 Caused by: java.lang.UnsupportedOperationException: Failed to resolve attribute at index 13: TypedValue{t=0x2/d=0x7f0400e6 a=-1}
    at android.content.res.TypedArray.getDrawableForDensity(TypedArray.java:1025)
    at android.content.res.TypedArray.getDrawable(TypedArray.java:1009)
    at android.view.View.<init>(View.java:5586)
    at android.view.ViewGroup.<init>(ViewGroup.java:708)
    at android.view.ViewGroup.<init>(ViewGroup.java:704)
    at android.view.ViewGroup.<init>(ViewGroup.java:700)

2022-04-17 09:12:16.637 2398-2398/com.live.test E/AndroidRuntime: at androidx.constraintlayout.widget.ConstraintLayout.(ConstraintLayout.java:567)
... 25 more

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions