【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )
  K1I6GvxBEuyy 2023年11月02日 101 0



文章目录

  • 一、jcenter 仓库问题
  • 1、报错信息
  • 2、解决方案
  • 二、查找并配置 ijkplayer 源
  • 三、手动在本地配置 ijkplayer 依赖库


今天早上编译 Android 程序 , 发现无法编译通过 ijkplayer 依赖无法正常下载 ;

项目中使用了如下依赖 :

implementation 'tv.danmaku.ijk.media:ijkplayer-java:0.8.8'
    implementation 'tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8'
    implementation 'tv.danmaku.ijk.media:ijkplayer-exo:0.8.8'

上周还能运行 , 周末回来 , 周一无法运行 ;

记录下排查流程 ;

ijkplayer 远程仓库无法使用 , 在本地配置 ijkplayer 库 ;






一、jcenter 仓库问题



1、报错信息



编译后 , 先报 jcenter 仓库问题 , 该仓库已经停用

> Could not resolve tv.danmaku.ijk.media:ijkplayer-java:0.8.8.
         > Could not get resource 'https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-java/0.8.8/ijkplayer-java-0.8.8.pom'.

完整报错信息 :

FAILURE: Build completed with 9 failures.

1: Task failed with an exception.
-----------
* What went wrong:
Execution failed for task ':app:dataBindingMergeDependencyArtifactsDebug'.
> Could not resolve all files for configuration ':app:debugCompileClasspath'.
   > Could not resolve tv.danmaku.ijk.media:ijkplayer-java:0.8.8.
     Required by:
         project :app
      > Could not resolve tv.danmaku.ijk.media:ijkplayer-java:0.8.8.
         > Could not get resource 'https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-java/0.8.8/ijkplayer-java-0.8.8.pom'.
            > Could not GET 'https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-java/0.8.8/ijkplayer-java-0.8.8.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8.
     Required by:
         project :app
      > Could not resolve tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8.
         > Could not get resource 'https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-armv7a/0.8.8/ijkplayer-armv7a-0.8.8.pom'.
            > Could not GET 'https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-armv7a/0.8.8/ijkplayer-armv7a-0.8.8.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target
   > Could not resolve tv.danmaku.ijk.media:ijkplayer-exo:0.8.8.
     Required by:
         project :app
      > Could not resolve tv.danmaku.ijk.media:ijkplayer-exo:0.8.8.
         > Could not get resource 'https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-exo/0.8.8/ijkplayer-exo-0.8.8.pom'.
            > Could not GET 'https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-exo/0.8.8/ijkplayer-exo-0.8.8.pom'.
               > sun.security.validator.ValidatorException: PKIX path building failed: sun.security.provider.certpath.SunCertPathBuilderException: unable to find valid certification path to requested target

* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. Run with --scan to get full insights.
==============================================================================

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_java



2、解决方案



报错中提示 https://jcenter.bintray.com/tv/danmaku/ijk/media/ijkplayer-java/0.8.8/ijkplayer-java-0.8.8.pom 无法访问 , 在浏览器中输入该网址 , 查看网站是否能访问 ;

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_依赖库_02

直接将 根目录下 build.gradle 中的 buildscript 和 allprojects 下的 jcenter 仓库注释掉 , 这个仓库已经停止服务 , 无法访问 ;

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_根目录_03

注释之后 , 显示开始下载 ijkplayer 的依赖 , 等待一段时间 , 看是否能下载完毕 ;

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_原力计划_04

继续下载 , 还是失败 ;

Failed to resolve: tv.danmaku.ijk.media:ijkplayer-armv7a:0.8.8
Show in Project Structure dialog
Affected Modules: app

Failed to resolve: tv.danmaku.ijk.media:ijkplayer-exo:0.8.8
Show in Project Structure dialog
Affected Modules: app

Failed to resolve: tv.danmaku.ijk.media:ijkplayer-java:0.8.8
Show in Project Structure dialog
Affected Modules: app






二、查找并配置 ijkplayer 源



https://mvnrepository.com/ 网站中查询 Maven 依赖 ,

搜索 ijkplayer ,

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_根目录_05

点进去之后 , 发现有 三个仓库 可供下载 ;

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_原力计划_06

点击 Repository 一栏中的 Spring Plugins 按钮 , 可以查看该仓库的地址 https://repo.spring.io/plugins-release/ ;

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_ijkplayer_07

将该仓库配置到 根目录下的 build.gradle 中的 allprojects 中 ,

maven { url "https://repo.spring.io/plugins-release/" }

完整的配置如下 : 之前的 jcenter 已经被注释 ;

allprojects {
    repositories {
        google()
        mavenCentral()
        //jcenter() // Warning: this repository is going to shut down soon
        // ijkplayer 仓库
        maven { url "https://repo.spring.io/plugins-release/" }
    }
}






三、手动在本地配置 ijkplayer 依赖库



参考在 专栏中编译的 ijkplayer 依赖库版本 , 将编译后的依赖库导入到本地 ;

依赖库下载地址 :



将目录中的 ijkplayer-armv7a , ijkplayer-java , tools 目录 , 拷贝到 Android Studio 的根目录 ;

【错误记录】记录处理 ijkplayer 依赖问题 ( jcenter 仓库问题 | 查找并配置 ijkplayer 源 | 手动在本地配置 ijkplayer 依赖库 )_ijkplayer_08

打开 根目录下的 build.gradle 目录 , 将其拷贝到 主应用的 根目录下的 build.gradle 中 , 最终可编译成功 ;

ext {
    compileSdkVersion = 25
    buildToolsVersion = "25.0.3"

    targetSdkVersion = 25

    versionCode = 800800
    versionName = "0.8.8"
}


【版权声明】本文内容来自摩杜云社区用户原创、第三方投稿、转载,内容版权归原作者所有。本网站的目的在于传递更多信息,不拥有版权,亦不承担相应法律责任。如果您发现本社区中有涉嫌抄袭的内容,欢迎发送邮件进行举报,并提供相关证据,一经查实,本社区将立刻删除涉嫌侵权内容,举报邮箱: cloudbbs@moduyun.com

  1. 分享:
最后一次编辑于 2023年11月08日 0

暂无评论

推荐阅读
  2Vtxr3XfwhHq   2024年05月17日   51   0   0 Java
  Tnh5bgG19sRf   2024年05月20日   104   0   0 Java
  8s1LUHPryisj   2024年05月17日   46   0   0 Java
  aRSRdgycpgWt   2024年05月17日   47   0   0 Java
K1I6GvxBEuyy
作者其他文章 更多