when I want to add this library:
implementation 'com.github.bumptech.glide:glide:4.9.0'
My android take this error:
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.github.bumptech.glide:glide:4.9.0.
and this is my app module
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.mahdi.chatapp"
minSdkVersion 16
targetSdkVersion 27
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-config:16.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'de.hdodenhof:circleimageview:3.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
}
apply plugin: 'com.google.gms.google-services'
Have you added this code in Gradle file
repositories {
mavenCentral()
google()
}
to use latest version of glide i.e. above version 4,
you have to add one extra dependency(glide compiler)
dependencies {
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
and in repositories you have to add
repositories {
mavenCentral()
google()
}
reference: https://github.com/bumptech/glide
You have not added the annotationProcessor
repositories {
mavenCentral()
maven { url 'https://maven.google.com' }
}
dependencies {
compile 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
}
This is the code for downloading glide given in the Glide documentation. See this link: http://bumptech.github.io/glide/doc/download-setup.html#gradle
Related
I am getting the following error our of no where
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not find any matches for com.onesignal:OneSignal:[3.9.1,3.99.99] as no versions of com.onesignal:OneSignal are available.
I can not figure out why this would be happening. Any help would be greatly appreciated.
Here is my entire gradle file.
buildscript {
repositories {
maven { url 'https://plugins.gradle.org/m2/' }
}
dependencies {
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:[0.11.0, 0.99.99]'
}
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
repositories {
maven { url 'https://maven.google.com' }
}
apply plugin: 'com.android.application'
android {
useLibrary 'org.apache.http.legacy'
compileSdkVersion 28
defaultConfig {
applicationId "-----"
minSdkVersion 15
targetSdkVersion 28
versionCode 65
versionName "1.0.65"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
manifestPlaceholders = [
onesignal_app_id: '-----',
onesignal_google_project_number: 'REMOTE'
]
}
buildTypes {
release {
minifyEnabled false
shrinkResources false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '26.0.2'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.android.gms:play-services-ads:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.github.apl-devs:appintro:v4.2.3'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.5'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.1'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-ads:11.8.0'
implementation 'com.onesignal:OneSignal:[3.9.1, 3.99.99]'
implementation 'com.android.volley:volley:1.1.1'
implementation 'de.hdodenhof:circleimageview:3.1.0'
compile 'com.google.zxing:core:3.2.1'
compile 'com.journeyapps:zxing-android-embedded:3.2.0#aar'
}
apply plugin: 'com.google.gms.google-services'
I just had this issue too.
I changed version to just 3.1.9 like below and everything worked fine.
I mean like this:
compile 'com.onesignal:OneSignal:3.9.1'
change the line as like this
implementation 'com.onesignal:OneSignal:3.9.1'
for me work also! thanks
INFO: Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
I integrated ButterKnife into my project, since then it has been impossible for me to build it
I've tried different versions of the library but nothing seems to work
Here is the error during the build:
Could not find com.jakewharton:butterknife-compiler:7.0.1.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.pom
- https://dl.google.com/dl/android/maven2/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.jar
- https://jcenter.bintray.com/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.pom
- https://jcenter.bintray.com/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.jar
- https://jitpack.io/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.pom
- https://jitpack.io/com/jakewharton/butterknife-compiler/7.0.1/butterknife-compiler-7.0.1.jar
Required by:
project :app
And this is my build.gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.toto"
minSdkVersion 19
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//Retrofit Dependencies
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
// Butter Knife
implementation 'com.jakewharton:butterknife:7.0.1'
implementation 'com.android.support:support-annotations:28.0.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:7.0.1'
// ZXing
implementation 'com.github.tobrun:QR-Vision-Fragment:master-SNAPSHOT'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
}
I have already added the jitpack repositories in the project build.gradle:
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
}
}
try this
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
If you are building an old android project and do not want to upgrade your butterknife dependency then add this to your gradle(app level) file. It wokred for me. Happy Coding :)
android {
...
defaultConfig {
javaCompileOptions {
annotationProcessorOptions {
includeCompileClasspath = true
}
}
}
}
Use This:
compile 'com.jakewharton:butterknife:8.7.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.7.0'
from this butterknife-compiler version 7.0.1 not listed(founded) in mvn repository
so use the latest lib version
implementation 'com.jakewharton:butterknife:10.1.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:10.1.0'
I try to add Crashlytics to my project but Gradle is not syncing well.
This is my build.gradle:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
// These docs use an open ended version so that our plugin
// can be updated quickly in response to Android tooling updates
// We recommend changing it to the latest version from our changelog:
// https://docs.fabric.io/android/changelog.html#fabric-gradle-plugin
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.smartvibes.smartbeat"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.android.volley:volley:1.1.0'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
implementation 'com.squareup.okio:okio:1.7.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'org.florescu.android.rangeseekbar:rangeseekbar-library:0.4.0'
implementation 'org.osmdroid:osmdroid-android:6.0.3'
implementation 'io.nlopez.smartlocation:library:3.3.3'
implementation 'io.nlopez.smartlocation:rx:3.3.3'
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.MikeOrtiz:TouchImageView:1.4.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'com.jakewharton.rxbinding:rxbinding:0.4.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9#aar' {
transitive = true;
}
}
This is what I added in my manifest:
<meta-data
android:name="io.fabric.ApiKey"
android:value="my key"
/>
I manually changed
compile ('com.crashlytics.sdk.android:crashlytics:2.9.9#aar') {
transitive = true;
}
To
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9#aar' {
transitive = true;
}
Because compile is not supported anymore.
The error when I try to sync it is:
ERROR: Could not find method com.crashlytics.sdk.android:crashlytics:2.9.9#aar() for arguments [build_ebny41u4h7onhh3ybv447hi4b$_run_closure3$_closure8#7d0b1f54] on object of type org.gradle.api.internal.artifacts.dsl.dependencies.DefaultDependencyHandler.
Open File
I Googled on this issue but could not find an appropriate solution.
Anyone knows how to deal with this?
You are almost there. Just need to write this with ( ) :
implementation ('com.crashlytics.sdk.android:crashlytics:2.9.9#aar') {
transitive = true;
}
I have done all the solution but none of them worked. Whenever I add this library in my project. I face error like
unable to resolve this library (disable offline work option)).
After disabling it, the error come
No cached version available in offline mode(Enable offline work option)).
How I resolve it pls help
This is my gradle file(module app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.amazone_ecommerce"
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
api 'com.google.firebase:firebase-messaging:17.4.0'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.7'
implementation 'com.google.firebase:firebase-database:16.1.0'
implementation 'com.github.jd-alexander:android-flat-button:v1.1'
implementation 'com.rengwuxian.materialedittext:library:2.1.4'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'io.paperdb:paperdb:2.1'
implementation 'com.github.rey5137:material:1.2.4'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.firebaseui:firebase-ui-database:1.2.0'
implementation 'com.squareup.picasso:picasso:2.3.2'
implementation 'com.cepheuen.elegant-number-button:lib:1.0.2'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:+'
implementation 'com.github.mancj:MaterialSearchBar:0.7.1'
implementation 'com.stepstone.apprating:app-rating:2.0.0'
implementation 'com.squareup.retrofit2:retrofit-converters:2.5.0'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
}
apply plugin: 'com.google.gms.google-services'
This is my gradle file(root level)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.1'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url 'https://jitpack.io' }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
You should try this as it's stated in the documentation:
dependencies {
implementation 'com.github.d-max:spots-dialog:1.1#aar'
}
That's a newer version of the lib. I think this should solve your problem.
Best
I developed an Android application on Android Studio 3.2.1 and I imported aar module to read UAE Id cards, I can run the application on my device without any problem.
I tried to generate an APK (debug/signed) file for my application but I get this error:
Program type already present: com.acs.smartcard.BufferOverflowException
where com.acs.smartcard is the module package name.
My app build.gradle file:
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.+'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
repositories {
maven { url 'https://maven.fabric.io/public' }
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "biz.wasel.driver"
minSdkVersion 17
targetSdkVersion 28
versionCode 3
versionName "1.0.4"
multiDexEnabled true
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test:rules:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-intents:3.0.2'
implementation 'android.arch.lifecycle:extensions:1.1.1'
implementation 'com.android.volley:volley:1.1.0'
implementation 'com.google.code.gson:gson:2.8.4'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.android.gms:play-services-maps:15.0.1'
implementation 'com.google.android.gms:play-services-location:15.0.1'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.jakewharton:butterknife:8.8.1'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'com.github.dmytrodanylyk.circular-progress-button:library:1.1.3'
implementation 'me.philio:pinentryview:1.0.6'
implementation 'com.poovam:pin-edittext-field:1.0.3'
implementation 'com.android.support:support-compat:28.0.0'
implementation 'com.daimajia.easing:library:2.0#aar'
implementation 'com.daimajia.androidanimations:library:2.3#aar'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.ramotion.cardslider:card-slider:0.2.0'
implementation 'com.android.support:preference-v7:28.0.0'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.yarolegovich:discrete-scrollview:1.4.7'
implementation 'net.gotev:uploadservice:3.4.2'
implementation 'com.github.esafirm.android-image-picker:imagepicker:1.13.1'
implementation 'android.arch.paging:runtime:1.0.0'
implementation 'com.github.ome450901:SimpleRatingBar:1.4.2'
implementation('com.crashlytics.sdk.android:crashlytics:2.9.4#aar') {
transitive = true;
}
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.android.support:multidex:1.0.3'
implementation 'com.github.gmazzo:nestedscroll-maps:0.4'
implementation 'com.hanks.animatecheckbox:library:0.1'
implementation 'com.sothree.slidinguppanel:library:3.4.0'
implementation 'com.hbb20:ccp:2.1.2'
implementation 'com.github.Binary-Finery:Bungee:master-SNAPSHOT'
implementation 'com.github.gcacace:signature-pad:1.2.1'
implementation 'com.facebook.shimmer:shimmer:0.1.0#aar'
implementation project(':acs-plugin-release')
implementation project(':EIDAToolkit')
}
apply plugin: 'com.google.gms.google-services'
and my project level build.gradle is
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.0.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'https://jitpack.io' }
maven { url 'http://maven.microblink.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Note:
When I commented
implementation project(':acs-plugin-release')
form app build.gradle I can generate APK without any problem, but I need this module to finish the app.
I tried a lot of solutions from here and here, but they didn't work!
Any help, please ?!
Thank you