Skip to content

java.lang.NoClassDefFoundError: Could not initialize class android.media.MediaPlayer #21

Description

@Ahmed-Ganna

At layout editor mode , i`am facing this issue when layout is rendering
java.lang.NoClassDefFoundError: Could not initialize class android.media.MediaPlayer
 at com.keenfin.audioview.AudioView.initMediaPlayer(AudioView.java:141)   at com.keenfin.audioview.AudioView.onAttachedToWindow(AudioView.java:221)

Xml code :
<com.keenfin.audioview.AudioView
android:id="@+id/audioView"
android:layout_width="0dp"
android:layout_height="wrap_content"
android:background="@drawable/audio_view_bg"
app:customLayout="@layout/audio_view"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/constraintLayout"/>

I think isInEditMode() functions is not working properly ins this case

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions