如何在Android中同步ExoPlayer库?

问题描述 投票:1回答:1

我的应用程序在同步ExoPlayer库时崩溃了。最初,当我拥有Android Studio 3.6时它崩溃了,并且无缘无故地给了我以下错误:enter image description here

enter image description here

但是最近我将Android Studio更新到4.0,因此我可以同步ExoPlayer库,并且在运行应用程序时没有问题

implementation 'com.google.android.exoplayer:exoplayer-core:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.11.4'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.11.4'

但是当我添加XML代码时,如下所示

<com.google.android.exoplayer2.ui.SimpleExoPlayerView
        android:id="@+id/video_view"
        android:layout_width="match_parent"
        android:layout_height="wrap_content"/>

并运行我的应用程序,它崩溃并给我以下错误:

2020-05-30 12:39:59.271 18182-18182/? E/Zygote: isWhitelistProcess - Process 
is Whitelisted
2020-05-30 12:39:59.271 18182-18182/? E/libpersona: scanKnoxPersonas
2020-05-30 12:39:59.271 18182-18182/? E/libpersona: Couldn't open the File - 
/data/system/users/0/personalist.xml - No such file or directory
2020-05-30 12:40:00.364 18182-18182/com.example.myapplication A/libc: Fatal 
signal 11 (SIGSEGV), code 
1, fault addr 0xb5a9f98 in tid 18182 (e.myapplication), pid 18182 
(e.myapplication)
java android android-mediaplayer exoplayer
1个回答
0
投票

请确保您已完成以下所有步骤:

1-添加存储库:

您应该添加完全按书面顺序添加这些存储库。 (buld.gradle:project)

repositories {
    google()
    jcenter()
}

2-添加ExoPlayer完整模块依赖性

    implementation 'com.google.android.exoplayer:exoplayer:2.11.4'

3-开启Java 8支持(buld.gradle-module:app)

  android{
     ...
    compileOptions {
      targetCompatibility JavaVersion.VERSION_1_8
    }
 }
© www.soinside.com 2019 - 2024. All rights reserved.