Grable build fails while enabling data binding to the project - android

I'm trying to use databinding for my app but gradle build fails. I'm not able to resolve this. Need your help.
Error i'm facing
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.android.databinding:library:3.1.0.
Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve com.android.databinding:adapters:3.1.0.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve com.android.databinding:library:3.1.0.
app level gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.dell.pitchpls"
minSdkVersion 21
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'
}
}
buildToolsVersion '27.0.3'
dataBinding{
enabled = true
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.0'
implementation 'com.android.support:support-v4:26.1.0'
implementation 'com.android.support:cardview-v7:26.1.0'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.firebaseui:firebase-ui-database:3.0.0'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.squareup.okhttp:okhttp: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'
Project level gradle file
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.0'
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()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

Related

Unable to resolve dependency for ':app#debug/compileClasspath':Could not resolve project :PGSDKVR4.AggrePay-android

This is my 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'
android {
compileSdkVersion 26
defaultConfig {
applicationId "apps.com.athulyacustomer"
minSdkVersion 19
targetSdkVersion 26
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 project(":PGSDKVR4")
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.0.2'
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.support:cardview-v7:26.1.0'
implementation 'com.android.support:recyclerview-v7:26.1.0'
implementation 'com.android.support:design:26.1.0'
implementation 'com.mcxiaoke.volley:library:1.0.19'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation 'com.github.nipun-birla:BoxLoaderView:0.0.1'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.weiwangcn.betterspinner:library-material:1.1.0'
implementation('com.crashlytics.sdk.android:crashlytics:2.6.8#aar') {
transitive = true;
}
}
repositories {
maven { url "https://jitpack.io" }
maven { url 'https://maven.fabric.io/public' }
}
Getting the below mentioned error after syncing the gradle with the project folder.
ERROR: Unable to resolve dependency for ':app#debug/compileClasspath': Could not resolve project :PGSDKVR4.
ERROR: Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath': Could not resolve project :PGSDKVR4.
Have added the plugin according to the documentation and sample app present on the below mentioned links.
https://github.com/paymentgatewayintegration/sampleapp
Please do let me know how can i can find a solution to this error.
Awaiting for your replies.
update dependencies in your projects build.gradle file
dependencies {
classpath 'com.android.tools.build:gradle:3.1.4'
classpath 'com.google.gms:google-services:3.2.1'
}

Android Studio Gradle - Unable to solve dependency

I'm getting the following errors when trying to add implementation 'com.android.support:cardview-v7:27.1.1' to my build.gradle (app):
Unable to resolve dependency for ':app#debug/compileClasspath': Could not
resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#debugAndroidTest/compileClasspath':
Could not resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#debugUnitTest/compileClasspath':
Could not resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#release/compileClasspath': Could not
resolve com.android.support:cardview-v7:27.1.1.
Unable to resolve dependency for ':app#releaseUnitTest/compileClasspath':
Could not resolve com.android.support:cardview-v7:27.1.1.
Here is my App gradle:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 27
defaultConfig {
applicationId "afinal.recipe.p.recipe1"
minSdkVersion 22
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.android.support:support-media-compat:27.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
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.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-core:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'de.hdodenhof:circleimageview:3.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
implementation 'com.android.support:recyclerview-v7:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
}
apply plugin: 'com.google.gms.google-services'
And my Project gradle:
// 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.2.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()
maven {
url "https://maven.google.com"
}
mavenCentral()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I've already been stuck on this for a while and tried a variety of solutions with no success such as ensuring offline mode isn't checked and changing
apply plugin: 'com.android.application'
to:
apply plugin: 'com.android.library'
and, without success, deleting:
applicationId "afinal.recipe.p.recipe1"
Thanks in advance for any help, would be greatly appreciated.

Getting error each time building the project

Whenever I open or rebuild my project the warning and sometimes the error comes:
Configuration 'compile' is obsolete and has been replaced with 'implementation' and 'api'.
It will be removed at the end of 2018.
It is showing the warning in build.gradle which has this code:
apply plugin: 'com.android.application'
android {
compileSdkVersion 27
defaultConfig {
applicationId "com.espoir.myappid"
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'
}
}
}
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:support-v4:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.google.firebase:firebase-messaging:11.8.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:27.1.1'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
}
apply plugin: 'com.google.gms.google-services'
Can anyone help me resolve this please? Thanks
Update Project level build.gradle libraries to the latest version.
Update
Upgrade you both class path to the latest versions
Like This:
YourProjectName/build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.2.0'
}
}
allprojects {
repositories {
google()
jcenter()
maven { url "https://jitpack.io"}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}

dex is not merged for android studio. Have gone through a lot of answers. Still don't get the solution

apply plugin: 'com.android.application'
android {
compileSdkVersion 26
defaultConfig {
applicationId "com.example.souravsaikia.chattingapp"
minSdkVersion 23
targetSdkVersion 26
multiDexEnabled true
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile 'com.android.support:multidex:1.0.3'
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.android.support:appcompat-v7:26.1.0'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.google.firebase:firebase-auth:16.0.1'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-storage:16.0.1'
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:design:26.1.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
api 'com.theartofdev.edmodo:android-image-cropper:2.5.1'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.firebaseui:firebase-ui-database:4.2.1'
implementation 'com.android.support:recyclerview-v7:26.1.0'
compile 'com.google.android.gms:play-services-auth:16.0.1'
}
apply plugin: 'com.google.gms.google-services'
This is the app level gradle file.
Also here is the code for project level gradle.
buildscript {
repositories {
apply plugin: 'announce'
google()
jcenter()
maven {
url "https://maven.google.com"
}
}
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
}
Sorry to repeat the same question. But I have gone through most of the answers here. But still could not find the appropriate solution for the problem. I have been stuck in this problem for two days. So help would be appreciated.
Error log:
Error:Execution failed for task ':app:transformDexArchiveWithExternalLibsDexMergerForDebug'.
java.lang.RuntimeException: com.android.builder.dexing.DexArchiveMergerException: Unable to merge dex
I changed compileSdkVersion to 27 and targetSdkVersion to 27. Also the appcompat,design and recyclerView dependencies to 27.1.1. It worked for me.

After updating Gradle dependencies failed to resolve Firebase modules

I have updated my project to latest dependencies, also changed compile to implementations and gradle plugins and i have this error
Failed to resolve: firebase-analytics Open File
Failed to resolve: play-services-tasks Open File
Failed to resolve: play-services-ads-identifier Open File
Failed to resolve: play-services-stats Open File
Failed to resolve: play-services-basement Open File
Module
apply plugin: 'com.android.application'
android {
compileSdkVersion 28
buildToolsVersion '27.0.3'
defaultConfig {
applicationId "my.id"
minSdkVersion 16
targetSdkVersion 28
versionCode 36
versionName "2.04"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary = true
//multiDexEnabled true
}
buildTypes {
release {
debuggable false
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
signingConfig signingConfigs.config
}
debug {
}
}
productFlavors {
}
}
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 files('libs/chartboost.jar')
implementation 'com.android.support:appcompat-v7:27.1.1'
implementation 'com.android.support:percent:27.1.1'
implementation 'com.android.support:design:27.1.1'
implementation 'com.android.support.constraint:constraint-layout:1.1.1'
implementation 'com.android.support:support-v4:27.1.1'
implementation 'com.jakewharton:butterknife:8.8.1'
implementation 'com.github.polok:clicknumberpicker:0.1.2'
implementation 'com.android.volley:volley:1.0.0'
implementation 'com.kila.apprater_dialog.lars:apprater-dialog:1.0.5'
implementation 'com.android.support:cardview-v7:27.1.1'
implementation 'com.google.firebase:firebase-core:16.0.0'
implementation 'com.google.firebase:firebase-crash:16.0.0'
implementation 'com.google.firebase:firebase-database:16.0.1'
implementation 'com.google.firebase:firebase-ads:15.0.1'
implementation 'com.google.firebase:firebase-messaging:17.0.0'
implementation 'com.android.billingclient:billing:1.0'
testImplementation 'junit:junit:4.12'
annotationProcessor 'com.jakewharton:butterknife-compiler:8.8.1'
}
apply plugin: 'realm-android'
apply plugin: 'com.google.gms.google-services'
Project
buildscript {
repositories {
jcenter()
google()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.1.2'
classpath 'com.google.gms:google-services:4.0.1'
classpath "io.realm:realm-gradle-plugin:3.5.0"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
jcenter()
google()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Tried a lot of combinations, can someone help?

Categories

Resources