我是android studio的初学者,我试图为一个DatePickerDialog库导入一个远程依赖关系( link for its github ) but the import doesn't work for me.
我试着通过Group Id(com.github.wdullaer)和Artifact Name(MaterialDateTimePicker)来导入它,因为它显示在ProjectStructure/dependencies中。
我试着--导入com.github.wdullaer.MaterialDateTimePicker
我也试过 --导入com.wdullaer.MaterialDateTimePicker
和更多,但进口不工作
这里是我的gradle。
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
maven { url 'https://jitpack.io' }
dependencies {
classpath "com.android.tools.build:gradle:7.0.4"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.6.10"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
task clean(type: Delete) {
delete rootProject.buildDir
而这里是DateTimePicker的实现。
plugins {
id 'com.android.application'
id 'kotlin-android'
android {
compileSdk 32
defaultConfig {
applicationId "com.example.speedq"
minSdk 21
targetSdk 32
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
kotlinOptions {
jvmTarget = '1.8'
buildFeatures {
viewBinding true
dependencies {
implementation 'com.github.wdullaer:MaterialDateTimePicker:v4.2.3' // this is the implementation I cant import
如果有人知道我怎样才能导入它,那将是非常有帮助的。