DataBinding not working when i Upgrade Android Studio 2.3 - java

When I update android studio I have an error about dataBinding:
Error:(1, 0) android/databinding/tool/DataBindingBuilder
this is my build gradle app:
apply plugin: 'com.android.application'
dependencies {
'com.android.databinding:compiler:2.3.0'
}
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "com.example.theodhor.retrofit2"
minSdkVersion 17
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.1.0'
compile 'com.squareup.okhttp3:logging-interceptor:3.4.0'
compile 'com.squareup.retrofit2:retrofit:2.1.0'
compile 'com.squareup.retrofit2:converter-gson:2.1.0'
compile 'com.squareup:otto:1.3.8'
compile 'com.google.code.gson:gson:2.6.2'
compile 'com.android.support:design:25.0.1'
testCompile 'junit:junit:4.12'
compile 'org.apache.httpcomponents:httpclient:4.5.3'
exclude module: "httpclient"
classpath 'com.android.tools.build:gradle:1.5.0-beta2'
}
I get this error:
Error:(1, 0) android/databinding/tool/DataBindingBuilder Open File
FAILURE: Build failed with an exception. * Where: Build file '/Users/marco/Downloads/Retrofit-master/app/build.gradle' line: 1 * What went wrong: A problem occurred evaluating project ':app'. > android/databinding/tool/DataBindingBuilder * Try: Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output. BUILD FAILED Total time: 0.686 secs
I don't know why I have this problem.
Who can help me?
Thanks everybody!!!

Related

Error during Building an APK file in Android Studio

I was trying to build an apk for my project but i am facing this error and
Error:Execution failed for task
':app:transformClassesWithDexForDebug'.
com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException:
java.util.concurrent.ExecutionException: com.android.dex.DexException:
Multiple dex files define Lcom/google/android/gms/internal/zzajl;
i also added multiDexEnabled true but still getting error
Error:Execution failed for task
':app:transformClassesWithJarMergingForDebug'.
com.android.build.api.transform.TransformException: java.util.zip.ZipException: duplicate entry:
com/google/android/gms/internal/zzaix.class
Below is my Build.gradle file
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "in.package.name"
minSdkVersion 14
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
multiDexEnabled true
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
compile 'com.google.android.gms:play-services-ads:11.0.1'
testCompile 'junit:junit:4.12'
// Adding support library for this demo app
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:multidex:1.0.1'
compile 'com.google.firebase:firebase-database:9.6.1'
}
apply plugin: 'com.google.gms.google-services'
Please suggest me some solution
Thanks
Use SAME version
compile 'com.google.android.gms:play-services-ads:11.0.1'
compile 'com.google.firebase:firebase-database:11.0.1'
Then Clean-Rebuild and Restart IDE .
Try cleaning the project first - ./gradlew clean

Getting error "Execution failed for task ':app:transformClassesWithDexForDebug"

Need help.
Error:Execution failed for task ':app:transformClassesWithDexForDebug'. > com.android.build.api.transform.TransformException: com.android.ide.common.process.ProcessException: java.util.concurrent.ExecutionException: com.android.dex.DexException: Multiple dex files define Lcom/google/android/gms/inte
The application runs on api level 23 but gives the above error for api 16 which is my minsdk.
my gradle file :
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.2"
defaultConfig {
applicationId "com.example.raghavkishan.financialplanner"
minSdkVersion 16
targetSdkVersion 25
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'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2',
{
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.3.1'
compile 'com.android.support:design:25.3.1'
compile 'com.android.support:support-vector-drawable:25.3.1'
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
compile 'com.android.support.constraint:constraint-layout:1.0.2'
testCompile 'junit:junit:4.12'
}
apply plugin: 'com.google.gms.google-services'
Thanks.
First clean project and rebuild,then add following code in your project's app level build.gradle file:
defaultConfig {
multiDexEnabled true
}
In your build.gradle file,
dependencies contains following lines:
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-database:10.0.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
Instead this change to following lines:
compile 'com.google.firebase:firebase-auth:10.2.1'
compile 'com.google.firebase:firebase-database:10.2.1'
compile 'com.google.android.gms:play-services-auth:10.2.1'
just make sure each version have same values.

ERROR :Execution failed for task ':app:processDebugResources'

When I try to build my project, the Messages Gradle Build reports these messages:
FAILURE: Build failed with an exception.
What went wrong:
Execution failed for task ':app:processDebugResources'.
java.lang.IllegalArgumentException (no error message)
Gradle file
android {
compileSdkVersion 25
buildToolsVersion '25.0.2'
defaultConfig {
applicationId "com.example.bolt.skola"
minSdkVersion 17
targetSdkVersion 25
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 fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile 'com.android.support:appcompat-v7:25.2.0'
compile 'com.android.support:design:25.2.0'
compile 'com.android.support:support-v4:25.2.0'
compile 'com.roughike:bottom-bar:1.3.9'
compile 'com.google.android.gms:play-services-identity:10.2.0'
compile 'com.google.android.gms:play-services-plus:10.2.0'
compile 'com.google.android.gms:play-services-gcm:10.2.0'
testCompile 'junit:junit:4.12'
}
Most probably you have an item in your XML without a proper ID
<Button android:id="#+id/"/>
It's hard for the compiler to detect the cause.
Go to Manifest file and check the package name -
package="com.shaon.rastarchele.leet.subcse"> like this
for example see the image attach
I edited my package name to solve the problem.

Android Studio / Gradle errors

My project worked just fine, and out of a sudden when I tried to rebuild it, I got these errors:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies, :buttonstyle:generateDebugSources, :buttonstyle:mockableAndroidJar, :buttonstyle:prepareDebugUnitTestDependencies, :buttonstyle:generateDebugAndroidTestSources]
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
This is my build gradle file:
apply plugin: 'com.android.application'
android {
compileSdkVersion 25
buildToolsVersion "25.0.1"
defaultConfig {
applicationId "ba.application.travel"
minSdkVersion 19
targetSdkVersion 25
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
externalNativeBuild {
cmake {
cppFlags "-std=c++11"
}
}
dexOptions {
javaMaxHeapSize "4g"
}
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
externalNativeBuild {
cmake {
path "CMakeLists.txt"
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets'] } }
}
dependencies {
compile fileTree(include: ['*.jar'], dir: 'libs')
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
compile group: 'com.fasterxml.jackson.core', name: 'jackson-databind', version: '2.0.1'
compile project(':buttonstyle')
compile 'com.android.support:design:25.0.1'
compile 'com.android.support:appcompat-v7:25.0.1'
compile 'com.android.support:percent:25.0.1'
compile 'com.ashokvarma.android:bottom-navigation-bar:1.3.0'
compile 'com.android.support:support-v4:25.0.1'
compile 'com.android.support:gridlayout-v7:25.0.1'
compile 'com.android.support:cardview-v7:25.0.1'
compile 'com.android.support:recyclerview-v7:25.0.1'
compile 'com.akexorcist:RoundCornerProgressBar:2.0.3'
compile 'com.github.aakira:expandable-layout:1.4.2#aar'
compile 'com.github.grennis:ExpandableRecyclerView:0.9.3'
compile 'com.github.markushi:circlebutton:1.1'
testCompile 'junit:junit:4.12'
}
Try enabling multidex support. Refer the below link to know the steps to enable multidex support in your project.
Enabling multidex support
I solved it by changing an image format from .jpg to .png

Java util ConcurrentException: ProcessException in android

I am getting frustrated. Everything was fine in my project. Then i wanted to implement google custom tab and added dependency. But as soon as I sync the project it is showing the error. I tried to remove the dependency but still the problem is occurring. I have searched in google and stackoverflow. All i got is about multiDex. I have added that too but nothing is changed.
The error and stack trace:
Information:Gradle tasks [:app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:mockableAndroidJar, :app:prepareDebugUnitTestDependencies]
Error:java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
Error:Execution failed for task ':app:mergeDebugResources'.
Error: java.util.concurrent.ExecutionException: com.android.ide.common.process.ProcessException:
The dependency code:
apply plugin: 'com.android.application'
apply plugin: 'android-apt'
apply plugin: 'realm-android'
android {
compileSdkVersion 24
buildToolsVersion "24.0.2"
defaultConfig {
applicationId "razon.tasktodo"
minSdkVersion 16
targetSdkVersion 24
versionCode 1
versionName "1.0"
multiDexEnabled true
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
compile fileTree(dir: 'libs', include: ['*.jar'])
androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
exclude group: 'com.android.support', module: 'support-annotations'
})
repositories {
mavenCentral()
maven {
url 'http://dl.bintray.com/gigamole/maven/'
}
maven { url "https://jitpack.io" }
}
compile 'com.android.support:design:24.2.1'
compile 'com.android.support:appcompat-v7:24.2.1'
compile 'com.github.rey5137:material:1.2.4'
compile 'com.github.halysongoncalves:pugnotification:1.8.1'
compile 'me.drakeet.materialdialog:library:1.3.1'
compile 'com.github.devlight.navigationtabstrip:navigationtabstrip:+'
compile 'com.android.support:support-v4:24.2.1'
compile 'com.jakewharton:butterknife:8.1.0'
compile 'jp.wasabeef:recyclerview-animators:2.2.5'
compile 'com.github.armcha:SpaceNavigationView:1.5.0'
compile 'com.github.devlight:infinitecycleviewpager:1.0.2'
compile 'com.android.support:multidex:1.0.1'
testCompile 'junit:junit:4.12'
apt 'com.jakewharton:butterknife-compiler:8.1.0'
}
Please help me to get rid of it.

Categories

Resources