I try several times to add dependency to my project and each time give error
the dependency that I want to add them are 'de.hdodenhof:circleimageview:1.3.0'
and 'com.github.bumptech.glide:glide:3.6.1'
so I want to download these and add to my project manually is it possible and if Yes How?
Here is my application's build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 23
buildToolsVersion '24.0.0 rc4'
defaultConfig {
applicationId "ir.esfandune.material"
minSdkVersion 23
targetSdkVersion 23
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
}
packagingOptions {
exclude 'classes.dex'
}
}
repositories {
jcenter()
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
}
dependencies {
compile 'com.android.support:design:23.0.0'
compile 'com.android.support:appcompat-v7:23.0.0'
compile 'com.android.support:cardview-v7:23.0.0'
compile 'com.android.support:recyclerview-v7:23.0.0'
compile 'com.android.support:support-v4:23.0.0'
compile 'com.android.support:multidex:1.0.1'
compile 'com.github.rey5137:material:1.2.1.6-SNAPSHOT'
compile project(':material-dialogs')
compile files('lib/de.hdodenhof/circleimageview/1.3.0/jars/classes.jar')
//*** added from orginal source
compile 'de.hdodenhof:circleimageview:1.3.0'
compile 'com.github.bumptech.glide:glide:3.6.1'
}
in your project panel expand the GradleScripts tab. you will see 2 build.gradle file there. open the second one build.gradle(module:app) file. in the end of the file you will see a section like:
add a new dependency here like this:
just copy this in dependencies
and press 'sync project with gradle files' button
Then use it wherever you want by pasting the code below
download the jar/aar file of your library you want
copy files into libs directory in your app folder for *.jar files: add this code to dependency on your gradle file
for *.aar files: try from projectstructure / new module/ import from aar/jar
good luck
I had a similar problem and as @SaravInfern pointed out in the comments, I solved it by importing the project as a module.
apply plugin: 'com.android.library'
to it (earlier, it might becom.android.library
)compile project(":app")
where,app
is name of the imported module.Build the project then. It should build successfully. You can refer to this blog and this SO thread for more elaborate solution.