我刚刚在 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'
}
我还尝试了其他几个依赖项,看看该依赖项是否有问题。然而,一切都以同样的方式失败。请帮我找出问题所在。
最佳答案
MaterialDialogBottomSheet 不是一个库。请从 gradle 依赖项中删除该行(即 compile'com.github.TakeoffAndroid:MaterialDialogBottomSheet:333ac64d71'
)。该存储库只是对话框的自定义实现,可以用作 BottomSheet。请从我的github下载项目link并直接在 Android Studio 中运行该项目。如果您想将 BottomSheet 集成到您的应用程序中,只需从我的项目中复制 Activity、布局、样式(对话框样式主题)、anim(从上到下动画 xml)中的代码即可。它应该肯定有效。此外,如果您有任何疑问和疑问,请告诉我。谢谢。快乐编码!
关于android - 无法添加新的依赖gradle,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/31106677/