无法添加新的依赖项 gradle

Unable to add new dependencies gradle

我刚刚在 Playstore 上发布了一个应用程序,我只是按照 developer.google.com 上给出的步骤更改了 build.gradle 文件。

然而,从那时起,当我尝试输入一个新的依赖时,我总是得到以下错误:

Error:(48, 13) Failed to resolve: com.github.TakeoffAndroid:MaterialDialogBottomSheet:333ac64d71 Show in File
Show in Project Structure dialog

这是我的 gradle 文件供参考:

apply plugin: 'com.android.application'

android {
signingConfigs {
    config {
        keyAlias 'dsfdsfdsfdsf'
        keyPassword 'fsdkjfdskjfkjdsf'
        storeFile file('C:/Users/Gaurav/AndroidStudioProjects/dsfdsfds.jks')
        storePassword 'kndfkjdsklfjsdk'
    }
}
compileSdkVersion 22
buildToolsVersion '22.0.1'
defaultConfig {
    applicationId "com.sdfdsfdsf.sdfdsfds"
    minSdkVersion 16
    targetSdkVersion 22
    versionCode 1
    versionName "1.0"
}
buildTypes {
    release {
        minifyEnabled false
        proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        signingConfig signingConfigs.config
    }
}
}

repositories {
maven { url "https://jitpack.io" }
}

dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
// support libraries
compile 'com.android.support:appcompat-v7:22.2.0'
compile 'com.android.support:design:22.2.0'
compile 'com.android.support:cardview-v7:22.2.0'
compile 'com.android.support:recyclerview-v7:22.2.0'
// google play services location api
compile 'com.google.android.gms:play-services-location:7.5.0'
// making connection requests
compile 'com.squareup.okhttp:okhttp:2.4.0'
// animation
compile 'com.nineoldandroids:library:2.4.0'
compile 'com.daimajia.easing:library:1.0.1@aar'
compile 'com.daimajia.androidanimations:library:1.1.3@aar'
compile 'com.github.TakeoffAndroid:MaterialDialogBottomSheet:333ac64d71'
}

我还尝试了其他几个依赖项,看看该依赖项是否有问题。然而,所有的失败都以同样的方式进行。请帮我弄清楚,哪里出了问题。

首先确保 "com.github.TakeoffAndroid:MaterialDialogBottomSheet:333ac64d71" .jar/.aar 在您的项目中可用,如果不可用则尝试

1. Go to File->Project Structure
2. Click on "+" sign (insert new module), Select import jar/aar packages, provide the path of your jar.
3.then select your module name and go to dependency tab
4. click on "+" (Add) "module dependency"
5. click Apply and then ok

MaterialDialogBottomSheet 不是库。请从 gradle 依赖项(即 compile'com.github.TakeoffAndroid:MaterialDialogBottomSheet:333ac64d71')中删除该行。 repo 只是对话框的自定义实现,可以用作 BottomSheet。请从我的 github 下载项目 link 和 运行 直接在 Android Studio 中下载项目。如果你想在你的应用程序中集成 BottomSheet,只需从我的项目中复制 activity、layouts、styles(Dialog 样式主题)、anim(Top to Bottom 动画 xml)中的代码。它应该肯定有效。此外,如果您有任何疑问和疑问,请告诉我。谢谢。快乐编码!