英文:
How to sync ExoPlayer library in Android?
问题
我的应用在同步ExoPlayer库时崩溃。最初,当我使用Android Studio 3.6时,出现了崩溃,而没有任何原因给我以下错误:
最近我将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)
英文:
My app crashed when it comes to sync ExoPlayer library. At first, it crashes when I had Android Studio 3.6 and for no reason it gave me following errors:
enter image description here
but recently I updated Android Studio to 4.0 so I can sync ExoPlayer libraries and no problem when running app
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'
but when I add XML code as you see in the following
<com.google.android.exoplayer2.ui.SimpleExoPlayerView
android:id="@+id/video_view"
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
and run my app it crashes and gives me the following error:
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)
答案1
得分: 2
确保你已经实施了以下所有步骤:
1- 添加仓库:
你应该按照以下写入的顺序添加这些仓库。(buld.gradle:project)
repositories {
google()
mavenCentral()
}
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
}
}
英文:
Make Sure you are implemented all below steps :
1- Add repositories:
you should add add these repos exactly with writted order. (buld.gradle:project)
repositories {
google()
mavenCentral()
}
2- Add ExoPlayer full module dependency
implementation 'com.google.android.exoplayer:exoplayer:2.11.4'
3- Turn on Java 8 support (buld.gradle - module:app)
android{
...
compileOptions {
targetCompatibility JavaVersion.VERSION_1_8
}
}
答案2
得分: 0
跟进@Yasin的回答。
随着谷歌决定在2022年停用jcenter
,您可能会遇到另一个问题——您当前的旧版本ExoPlayer只提供在jcenter
上,而不在google
上。因此,我建议您尽快迁移到最新版本的ExoPlayer,即v15
,这个版本保证可以在google
上找到。
英文:
Follow up on @Yasin's answer.
With Google's decision to sunset jcenter
in 2022, you might run into another problem - that is your current old version of ExoPlayer is only provided on jcenter
but not on google
. So I would suggest you to migrate to latest version of ExoPlayer, i.e. v15
, as soon as possible - which is guaranteed to be found on google
.
通过集体智慧和协作来改善编程学习和解决问题的方式。致力于成为全球开发者共同参与的知识库,让每个人都能够通过互相帮助和分享经验来进步。
评论