Closed. This question is not reproducible or was caused by typos. It is not currently accepting answers.
This question was caused by a typo or a problem that can no longer be reproduced. While similar questions may be on-topic here, this one was resolved in a way less likely to help future readers.
Closed 3 years ago.
Improve this question
I am trying to build my android project in android studio 3.0.1 but before it loads completely it shows me error Fail to resolve com.github and When i click on Show in file cursor points me to implementation 'com.github.clans:fab:1.6.2' this dependency in build.gradle(Module:app)
this is my build.gradle (Module App).
apply plugin: 'com.android.application'
apply plugin: 'com.google.firebase.firebase-perf'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "xxx.xx.xxxx"
minSdkVersion 21
targetSdkVersion 28
versionCode 5
versionName "2.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
}
}
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.2'
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.github.clans:fab:1.6.2'
implementation 'com.android.volley:volley:1.1.0'
implementation('es.voghdev.pdfviewpager:library:1.0.4') {
exclude group: 'com.android.support'
exclude module: 'appcompat-v7'
exclude module: 'support-v4'
}
implementation 'com.github.rieved :glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
//implementation 'com.github.bumptech.glide:okhttp3-integration:1.4.0#aar'
implementation 'com.google.android.ads.consent:consent-library:1.0.6'
implementation 'com.android.support:design:28.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services-ads:16.0.0'
implementation 'com.android.support:customtabs:28.0.0'
implementation 'com.android.support:multidex:1.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'org.jsoup:jsoup:1.8.3'
implementation 'com.github.darsh2:MultipleImageSelect:v0.0.4'
api 'com.theartofdev.edmodo:android-image-cropper:2.7.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.google.firebase:firebase-core:16.0.6'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation 'com.github.florent37:tutoshowcase:1.0.1'
implementation 'com.github.deano2390:MaterialShowcaseView:1.2.0'
implementation 'com.linsea:universalvideoview:1.1.0#aar'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.9'
implementation 'com.google.firebase:firebase-perf:16.2.3'
}
apply plugin: 'com.google.gms.google-services'
i have surfed on net and i have tried different solutions like adding
allprojects {
repositories {
google()
jcenter()
}
}
this is my build.gradle (gradle.properties)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
mavenCentral()
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'com.google.gms:google-services:4.2.0'
classpath 'io.fabric.tools:gradle:1.26.1'
classpath 'com.google.firebase:firebase-plugins:1.1.5'
}
}
allprojects {
repositories {
google()
jcenter()
maven {
url "https://jitpack.io"
}
maven{
url "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
but this does not work.
Finally, I got the issue. The main issue is you have a space in your dependency implementation on this line
implementation 'com.github.rieved :glide:4.8.0'
Remove this line from dependency and add this for using Glide
implementation 'com.github.bumptech.glide:glide:4.9.0'
Hope this will solve your problem.
Related
It's frustrating when you do all what the Android Studio suggests and still get errors with not enough of what to do. I'm revisiting a project and running on Android Studio 3.3 beta 1. After applying the suggested updates, the app gradle file looks like this:
apply plugin:'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '28.0.3'
defaultConfig {
minSdkVersion 15
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
testOptions {
unitTests.returnDefaultValues = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
androidTestImplementation('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
implementation 'com.android.support:appcompat-v7:28.0.0'
implementation 'com.android.support:support-v4:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-vector-drawable:28.0.0'
implementation 'com.android.support:gridlayout-v7:28.0.0'
implementation 'com.android.support:cardview-v7:28.0.0'
implementation 'com.android.support:recyclerview-v7:28.0.0'
implementation 'com.android.support:design:28.0.0'
implementation 'com.android.support:support-annotations:28.0.0'
implementation 'com.github.bumptech.glide:glide:4.4.0'
implementation 'com.google.firebase:firebase-messaging:17.3.4'
implementation "com.google.android.gms:play-services-gcm:16.0.0"
implementation 'com.google.android.gms:play-services-location:16.0.0'
implementation 'com.google.android.gms:play-services-places:16.0.0'
testImplementation 'junit:junit:4.12'
implementation 'com.google.android.apps.muzei:muzei-api:2.0'
}
apply plugin: 'com.google.gms.google-services'
When I go to SDK Manager, everything is installed:
And in the gradle.build:
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.0-alpha01'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.3.0'
}
}
What should I do? any suggestions are appreciated.
You are missing part of your top-level build.gradle file. It should resemble:
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
In particular, you are missing the allprojects closure, which sets the repositories for dependency resolution in each of the modules. As a result, your module's build.gradle file does not know where to look for those dependencies.
I use firebase database, storage, auth and google cloud vision.
I got this error
Multiple dex files define Lcom/google/common/reflect/Types$WildcardTypeImpl;
I think that this project gradle conflicts
this is my gradle(Module:app)
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
buildToolsVersion "27.0.3"
defaultConfig {
applicationId "*************************"
minSdkVersion 19
targetSdkVersion 27
versionCode 1
versionName "1.0"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
buildTypes.each {
it.buildConfigField 'String', 'API_KEY', '"**********************"'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testCompile 'junit:junit:4.12'
implementation 'com.google.api-client:google-api-client-android:1.23.0' exclude module: 'httpclient'
implementation 'com.google.http-client:google-http-client-gson:1.23.0' exclude module: 'httpclient'
implementation 'com.google.apis:google-api-services-vision:v1-rev369-1.23.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:appcompat-v7:27.1.1'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.android.support:animated-vector-drawable:27.1.1'
implementation 'com.android.support:support-media-compat:27.1.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.firebaseui:firebase-ui-storage:3.2.2'
implementation 'com.jaredrummler:colorpicker:1.0.1'
implementation 'com.android.support:multidex:1.0.3'
//firebase 구글 로그인 원래 16.0.2
implementation 'com.google.android.gms:play-services-auth:16.0.0'
// ++++++++ 2018.11.08 ++++++++
implementation 'com.android.support:design:27.1.1'
implementation 'com.firebaseui:firebase-ui-database:0.6.2'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'org.parceler:parceler-api:1.1.11'
annotationProcessor 'org.parceler:parceler:1.1.11'
//////////
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'com.google.firebase:firebase-firestore:17.1.1'
implementation 'com.google.firebase:firebase-storage:16.0.3'
implementation 'com.google.firebase:firebase-auth:16.0.4'
implementation 'com.google.firebase:firebase-messaging:17.3.3'
implementation 'com.google.firebase:firebase-config:16.0.1'
implementation 'com.google.firebase:firebase-invites:16.0.4'
implementation 'com.google.firebase:firebase-ads:16.0.1'
implementation 'com.google.firebase:firebase-appindexing:16.0.2'
implementation 'com.google.firebase:firebase-perf:16.1.2'
implementation 'com.google.firebase:firebase-functions:16.1.1'
implementation 'com.google.firebase:firebase-ml-vision:17.0.1'
implementation 'com.google.firebase:firebase-ml-model-interpreter:16.2.2'
}
apply plugin: 'com.google.gms.google-services'
this is my gradle(Project)
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
dependencies {
// classpath 'com.android.tools.build:gradle:2.2.3'
// classpath 'com.google.gms:google-services:3.1.0'
classpath 'com.android.tools.build:gradle:3.0.1'
classpath 'com.google.gms:google-services:4.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
mavenCentral()
maven {
url 'https://maven.google.com/'
name 'Google'
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
What can I do? ;(
I think gradle has some problems, but I dont' know what to do.
I put almost all codes found from googling
Help me :(
FirebaseUI has transistive dependencies on Firebase and Google Play libraries. It's important to specify a compatible set of libraries in your build.
You are using the most recent versions of the Firebase libraries, but very old versions of FirbaseUI. As a first step, make these changes to use a compatible version of FirebaseUI:
implementation 'com.firebaseui:firebase-ui-storage:4.2.1'
...
implementation 'com.firebaseui:firebase-ui-database:4.2.1'
I try to import a retrofit library to my gradle file but unfortunately, I am facing too many errors.
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#release/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath': Could not resolve com.squareup.retrofit2:retrofit:2.4.0.
EDIT
This is my app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.example.practice"
minSdkVersion 19
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'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
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.android.support:design:27.1.1'
implementation 'com.dinuscxj:recyclerrefreshlayout:2.0.5'
implementation 'com.makeramen:roundedimageview:2.3.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.aurelhubert:ahbottomnavigation:2.1.0'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.3'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.firebaseui:firebase-ui-database:4.1.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.jakewharton:butterknife:8.8.1'
implementation 'com.jakewharton.timber:timber:4.7.1'
implementation 'com.squareup.picasso:picasso:2.71828'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.vanniktech:emoji-one:0.5.1'
implementation 'net.danlew:android.joda:2.9.9.3'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
}
apply plugin: 'com.google.gms.google-services'
This is my project build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:4.0.1'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I added the latest version of the retrofit2 but still get these errors. I have search for possible solutions but I can't find anything. Can someone help me with this problem?
Can you add this plugins are your app build.gradle file
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
And Can u change project build.gradle file like below code in allprojects
allprojects {
repositories {
google()
maven { url "https://jitpack.io" }
jcenter()
} }
Try this
implementation('com.squareup.retrofit2:retrofit:2.1.0') {
// exclude Retrofit’s OkHttp dependency module and define your own module import
exclude module: 'okhttp'
}
implementation 'com.google.code.gson:gson:2.8.2'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.4.1'
implementation 'com.squareup.okhttp3:okhttp:3.4.1'
and project build.gradle
allprojects {
repositories {
jcenter()
google()
mavenCentral()
maven { url 'https://jitpack.io' }
}
}
Add your build Gradle file
'com.squareup.retrofit2:retrofit:2.4.0'
Try adding this to the module (i.e. app) level gradle:
repositories {
maven {
mavenCentral()
}
}
Also you can try:
Go to File/Invalidate Cache-Restart
I have found a solution. I forgot to uncheck the offline work in Settings -> Build, Execution, Deployment -> Gradle -> Offline Work
Note.
This not duplicate of this question but the extension as there are few more error I got and the solution in that question stated was not solving my errors.
Problem:
Recently I am migrating my older project to upper version. I have updated Android Studio to 3.1 and Using API 27 with Gradle 4.4. I have changed the depricated compile to implementation now I am facing a very weird error. I am telling weird as I have tried many solution stated in other question and answers but nothing helped me. Beside the :app#debug/compileClasspath I am getting also the following errors
:app#debugAndroidTest/compileClasspath
:app#debugUnitTest/compileClasspath
:app#release/compileClasspath
:app#releaseUnitTest/compileClasspath
I think all errors are related. I am getting this long list of error with every libraries.
Here is my app build.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.epp.app.myproject"
minSdkVersion 19
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'
}
}
}
repositories {
mavenCentral()
maven { url uri('https://jitpack.io') }
maven { url "https://oss.sonatype.org/content/repositories/snapshots/" }
maven {url uri('https://oss.sonatype.org/content/repositories/snapshots/')}
google()
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.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.android.volley:volley:1.1.0'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.github.rey5137:material:1.2.4'
implementation 'com.github.gabrielemariotti.cards:cardslib-core:2.1.0'
implementation 'com.github.gabrielemariotti.cards:cardslib-cards:2.1.0'
implementation 'com.github.gabrielemariotti.cards:cardslib-recyclerview:2.1.0'
implementation 'com.github.gabrielemariotti.cards:cardslib-extra-staggeredgrid:2.1.0'
implementation 'com.github.ksoichiro:android-observablescrollview:1.5.0'
implementation 'devlight.io:navigationtabbar:1.2.5'
implementation('com.mikepenz:materialdrawer:6.0.7#aar') {
transitive = true
}
implementation 'com.android.support:support-annotations:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.github.Netural:RemoteAppControl:1.0.0'
implementation 'com.michaelpardo:activeandroid:3.1.0-SNAPSHOT'
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
}
Here is my module build.gradle
buildscript {
repositories {
jcenter()
mavenCentral()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.1'
}
}
allprojects {
repositories {
jcenter()
mavenCentral()
}
}
repositories {
jcenter()
mavenCentral()
google()
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I have found a solution for this. There was a repository conflict. Removing mavenCentral() from buildScript of module build.gradle works like a wonder.
Hello suddenly my android project shows this error
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
Before some days everything worked fine and I just opened it again after some days and shows me this
I have tried all the possible solutions I found here but nothing worked can you help me on this?
Here is my byuild.gradle
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.fire.stmtfadmin"
minSdkVersion 17
targetSdkVersion 26
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
allprojects {
repositories {
jcenter()
maven { url 'https://jitpack.io' }
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
//noinspection GradleCompatible
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.google.firebase:firebase-storage:11.0.4'
compile 'com.android.support:cardview-v7:+'
implementation 'com.google.firebase:firebase-messaging:11.0.4'
implementation 'com.google.firebase:firebase-database:11.0.4'
implementation 'com.firebaseui:firebase-ui-database:2.3.0'
implementation 'com.google.firebase:firebase-auth:11.0.4'
compile 'com.theartofdev.edmodo:android-image-cropper:2.6.+'
compile 'id.zelory:compressor:2.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
implementation 'com.android.support:support-v4:26.1.0'
compile 'com.yqritc:recyclerview-multiple-viewtypes-adapter:1.1.0'
compile 'com.squareup.picasso:picasso:2.5.2'
compile 'com.github.StevenDXC:DxLoadingButton:2.0'
compile 'com.github.dmytrodanylyk:android-morphing-button:98a4986e56' // commit hash
compile 'de.hdodenhof:circleimageview:2.1.0'
compile 'com.android.support:multidex:1.0.0'
compile 'br.com.simplepass:loading-button-android:1.12.1'
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.google.android.gms:play-services-maps:11.0.4'
}
apply plugin: 'com.google.gms.google-services'
// 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.0.1'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
classpath 'com.google.gms:google-services:3.1.0'
}
}
allprojects {
repositories {
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
To use the 11.4.0 version of Firebase, you need to add maven url to your build.gradle file like this:
allprojects {
repositories {
jcenter()
maven {
url "https://maven.google.com" // Google's Maven repository
}
}
}
This is probably because you're using the following dependencies:
compile 'com.android.support:cardview-v7:+'
where it means you want to use the latest version. The latest version 27.1.0.
Try using:
implementation 'com.android.support:cardview-v7:26.1.0'
And never use + for your dependency version. So you can reproduce and debug the same build if there is any problem in the future.
thank you all for your replies but the only solution that worked for me was to add this line to build.gradle(Module:app):
implementation 'android.arch.lifecycle:extensions:1.1.0'
i hope this will help the others