android srudio 导入第三方库失败

新建了一个项目,implementation 'com.github.hegaojian:JetpackMvvm:1.2.7' ,编译的时候报错,报错信息如下:

  • What went wrong:
    Execution failed for task ':app:mergeDebugNativeLibs'.

    Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
    Could not find com.github.hegaojian:JetpackMvvm:1.2.7.
    Searched in the following locations:

     - https://dl.google.com/dl/android/maven2/com/github/hegaojian/JetpackMvvm/1.2.7/JetpackMvvm-1.2.7.pom
     - https://repo.maven.apache.org/maven2/com/github/hegaojian/JetpackMvvm/1.2.7/JetpackMvvm-1.2.7.pom
    

    Required by:

       project :app
    
  • 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.

img

maven { url "https://jitpack.io" }
是要写在allprojects下面的

你是否完成了第一步, 以及检查第二步是否有拼写错误

1.如何集成

  • 1.1 在root's build.gradle中加入Jitpack仓库
allprojects {
    repositories {
        ...
        maven { url 'https://jitpack.io' }
    }
}
  • 1.2 在app's build.gradle中添加依赖
dependencies {
  ...
  implementation 'com.github.hegaojian:JetpackMvvm:1.2.7'
}

参考:

GitHub - hegaojian/JetpackMvvm: 一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目 :chicken::basketball:一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目 - GitHub - hegaojian/JetpackMvvm: 一个Jetpack结合MVVM的快速开发框架,基于MVVM模式集成谷歌官方推荐的JetPack组件库:LiveData、ViewModel、Lifecycle、Navigation组件 使用Kotlin语言,添加大量拓展函数,简化代码 加入Retrofit网络请求,协程,帮你简化各种操作,让你快速开发项目 https://github.com/hegaojian/JetpackMvvm


如有问题及时沟通

com.github.hegaojian:JetpackMvvm:1.2.7
这个库文件应该没有传到gradle的官网服务器上,建议自己把jar下载下来后,拷贝到app的lib目录下