I am beginner to android studio and I am trying to import a remote dependency for a library of DatePickerDialog (link for its github) but the import doesn't work for me.
I tried to import it by the Group Id (com.github.wdullaer) and Artifact Name (MaterialDateTimePicker) as it shows in the ProjectStructure/dependencies
I tried - import com.github.wdullaer.MaterialDateTimePicker
I also tried - import com.wdullaer.MaterialDateTimePicker
and more but the import does not work but
here is my 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
}
and here is the DateTimePicker implementation:
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
}
if any one knows how can I import it it will be very helpful
that is wrong:
implementation 'com.github.wdullaer:MaterialDateTimePicker:v4.2.3'
first of all dont use v
near version, so just remove it
also you got wrong path, read again guide - you should use this:
implementation 'com.wdullaer:materialdatetimepicker:4.2.3'