Suddenly my android studio gradle build fails with unknown error:
java.lang.IllegalStateException: failed to analyze: com.sun.tools.javac.util.ClientCodeException: java.lang.IllegalStateException: node.sym must not be null
I tried everything like reverting my project back to previous version and invaliding cache and restart but still the error persists i don't really know what is happening:
Here is my gradle:
ext {
configuration = [
compileVersion: 27,
minSdk : 14,
targetSdk : 25,
version_code : 5,
version_name : "1.0.0"
]
libraries = [
supportVersion: '1.0.0-beta01'
]
}
buildscript {
ext.kotlin_version = '1.3.50'
repositories {
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 "io.realm:realm-gradle-plugin:6.0.1"
classpath 'io.fabric.tools:gradle:1.27.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// classpath "com.android.tools.build:gradle:${buildConfig.gradlePlugin}"
// 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 "https://maven.google.com"
}
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Build gradle file:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'io.fabric'
apply plugin: 'kotlin-kapt'
apply plugin: 'realm-android'
android {
compileSdkVersion 29
defaultConfig {
applicationId "com.social.media.post.graphics.template.card.maker"
minSdkVersion 21
targetSdkVersion 29
versionCode 6
versionName "1.5"
multiDexEnabled true
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
dexOptions {
jumboMode true
javaMaxHeapSize "4g"
}
compileOptions {
sourceCompatibility = 1.8
targetCompatibility = 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'com.github.smarteist:autoimageslider:1.3.2'
implementation 'me.grantland:autofittextview:0.2.1'
//noinspection GradleCompatible
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'com.google.android.material:material:1.1.0-alpha10'
implementation 'com.github.QuadFlask:colorpicker:0.0.13'
implementation 'com.github.kaushikthedeveloper:squarelayout:0.0.3'
implementation project(':imagelibrary')
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.github.bumptech.glide:glide:4.10.0'
implementation 'com.nostra13.universalimageloader:universal-image-loader:1.9.5'
implementation 'com.intuit.sdp:sdp-android:1.0.5'
implementation 'com.intuit.ssp:ssp-android:1.0.5'
implementation 'androidx.percentlayout:percentlayout:1.0.0'
implementation 'com.github.MasayukiSuda:BubbleLayout:v1.2.1'
//Fuel
implementation 'com.github.kittinunf.fuel:fuel:2.2.1'
implementation 'com.github.kittinunf.fuel:fuel-android:2.2.1'
implementation 'com.github.kittinunf.fuel:fuel-gson:2.2.1'
implementation 'com.google.android.material:material:1.0.0'
//Gson
implementation 'com.google.code.gson:gson:2.7'
implementation 'com.github.fondesa:kpermissions:2.0.2'
//Coroutines
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.1.0'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:0.30.1-eap13'
implementation 'com.isseiaoki:simplecropview:1.1.4'
implementation 'com.github.hotchemi:permissionsdispatcher:2.3.1'
annotationProcessor 'com.github.hotchemi:permissionsdispatcher-processor:2.3.1'
// all common code dependencies
implementation 'com.eyalbira.loadingdots:loading-dots:1.0.2'
implementation 'androidx.multidex:multidex:2.0.1'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.github.sujithkanna:smileyrating:1.6.8'
implementation 'com.daimajia.slider:library:1.1.5#aar'
implementation 'com.nineoldandroids:library:2.4.0'
implementation 'com.github.warkiz.widget:indicatorseekbar:2.1.2'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.3.0-alpha02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0-alpha02'
implementation 'com.github.Theophrast:SquareImageView:1.0.1'
//For Firebase
implementation 'com.google.firebase:firebase-core:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
//For Google Mediation
implementation 'com.google.android.gms:play-services-ads:18.2.0'
// For Fb Mediation and FB ads
implementation 'com.facebook.android:audience-network-sdk:5.6.0'
implementation 'com.google.ads.mediation:facebook:5.6.0.0'
implementation 'com.makeramen:roundedimageview:2.3.0'
//for unzip .zip file
implementation 'com.github.ghost1372:Mzip-Android:0.4.0'
//lottie animation
implementation 'com.airbnb.android:lottie:3.0.7'
// for equal spacing around recycler view
/* implementation('com.github.thekhaeng:recycler-margin:1.2.1') {
exclude group: 'com.android.support', module: 'recyclerview-v7'
}*/
// subscribe and in - app
implementation 'com.anjlab.android.iab.v3:library:1.0.44'
implementation 'androidx.core:core-ktx:+'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
//Sectioned Recyclerview
implementation 'com.github.IntruderShanky:Sectioned-RecyclerView:2.1.1'
//Ripple Effect
implementation 'com.github.traex.rippleeffect:library:1.3'
//Tagview
compile 'com.veinhorn.tagview:library:1.0.4'
}
apply plugin: 'com.google.gms.google-services'
repositories {
mavenCentral()
}
I had the same error, and it was related to kotlin and java files with the same name.
The issue appeared after I converted a java file to kotlin in one branch, and then merged my branches, but both files remained in the project.
The error didn't show the duplicated file name, but after adding
kapt.incremental.apt=false
to "gradle.properties" as suggested by this article:
https://medium.com/#tashpemhiwa/after-a-rather-long-hiatus-without-writing-an-article-i-have-had-recent-new-inspiration-to-start-7f1f5187ba53
after disabling incremental build, the duplicate file error appeared in my build results and I knew the duplicated file name, so I removed the java file.
I enabled incremental kapt afterwards, because incremental build is faster.
It also happened when source is set like:
sourceSets {
main {
java.srcDirs += 'build/generated/data_binding_base_class_source_out/'
}
}
And there are multiple build types. Folders in data_binding_base_class_source_out intercepts and it causes the problem.
Fix:
sourceSets {
debug {
java.srcDirs += 'build/generated/data_binding_base_class_source_out/debug/'
}
release {
java.srcDirs += 'build/generated/data_binding_base_class_source_out/release/'
}
}
I've had this issue a few times.
The only thing that has worked for me is upgrading/downgrading Android Gradle Plugin. Try using 3.5.3.
In my case, I was using 3.6.0-rc02. After downgrading to 3.5.3, the issue went away.
Related
I have imported existing android project after 2 months, and when it started to sync the gradle, it gave some strange error, because earlier the project was working properly.
The error is Caused by: org.gradle.plugin.management.internal.InvalidPluginRequestException: Plugin 'com.android.application' is already on the script classpath.
below is my gradle file :
build.gradle (:app)
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.quickshop"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
}
repositories {
mavenCentral()
}
dependencies {
implementation 'com.hbb20:ccp:2.5.0'
implementation 'com.steelkiwi:badge-holder-view:1.1.0'
implementation 'com.mikhaellopez:circularimageview:4.2.0'
implementation 'de.hdodenhof:circleimageview:3.1.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
implementation 'me.himanshusoni.quantityview:quantity-view:1.2.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
implementation 'pl.droidsonroids.gif:android-gif-drawable:1.2.22'
implementation 'com.github.MindorksOpenSource:EditDrawableText:2.0'
implementation 'com.razorpay:checkout:1.6.6'
implementation 'in.shadowfax:proswipebutton:1.2.2'
implementation 'com.google.firebase:firebase-auth:20.0.4'
implementation 'com.google.firebase:firebase-core:17.2.1'
implementation 'com.google.firebase:firebase-analytics:17.2.1'
implementation 'com.google.firebase:firebase-config:19.0.3'
implementation 'com.google.firebase:firebase-messaging'
implementation platform('com.google.firebase:firebase-bom:26.8.0')
implementation 'com.firebaseui:firebase-ui-database:3.2.2'
implementation 'com.google.firebase:firebase-auth:19.2.0'
implementation 'com.google.firebase:firebase-database:19.6.0'
implementation 'com.google.firebase:firebase-storage:19.2.1'
implementation 'cc.cloudist.acplibrary:library:1.2.1'
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.3.2'
implementation 'androidx.navigation:navigation-ui:2.3.2'
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'com.github.barteksc:android-pdf-viewer:2.8.2'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
}
build.gradle(project)
// 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"
classpath 'com.google.gms:google-services:4.3.5'
// 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' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradle
include ':app'
rootProject.name = "QuickShop"
I tried to find solution for this, but didnt find a proper solution that can resolve this issue, can anyone please help me with this and this new gradle plugin invocation.
android version : Android Studio Arctic Fox | 2020.3.1 Patch 3,
gradle version : 4.1,
Android gradle plugin version : 3.0.1
After I migrate my project there some error like data binding and more, but I already solve it then the error change into this :
Execution failed for task ':app:kaptDebugKotlin'.
> A failure occurred while executing org.jetbrains.kotlin.gradle.internal.KaptExecution
> java.lang.reflect.InvocationTargetException (no error message)
I've try many solution like updating kotlin version to 1.4.20 and also some source ask me to upgrade the room version so I update it to the latest version but it all turns out failed.
here is my gradle module :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'com.jakewharton.butterknife'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "my package"
minSdkVersion 21
targetSdkVersion 30
versionCode 1
versionName "1.18"
testInstrumentationRunner 'androidx.test.runner.AndroidJUnitRunner'
}
dexOptions {
javaMaxHeapSize "4g"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
packagingOptions {
exclude 'META-INF/rxjava.properties'
}
buildFeatures {
dataBinding = true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'androidx.core:core:1.3.2'
implementation 'com.jakewharton:butterknife:10.2.3'
kapt 'com.jakewharton:butterknife-compiler:10.2.3'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'com.google.android.material:material:1.2.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'jp.wasabeef:blurry:2.1.1'
implementation 'jp.wasabeef:fresco-processors:2.1.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:retrofit:2.3.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.1.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.6.0'
implementation 'com.squareup.retrofit2:converter-gson:2.1.0'
implementation "org.jetbrains.kotlin:kotlin-stdlib:1.3.72"
implementation 'com.balysv:material-ripple:1.0.2'
implementation 'com.amulyakhare:com.amulyakhare.textdrawable:1.0.1'
implementation 'com.github.IntruderShanky:Sectioned-RecyclerView:2.1.1'
implementation 'id.zelory:compressor:2.1.0'
implementation 'com.github.rey5137:material:1.2.2'
implementation 'com.squareup.picasso:picasso:2.5.2'
implementation 'com.google.android.gms:play-services-location:17.1.0'
implementation 'com.google.android.gms:play-services-maps:17.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel:2.2.0'
implementation 'androidx.lifecycle:lifecycle-livedata:2.2.0'
kapt 'androidx.lifecycle:lifecycle-compiler:2.2.0'
def room_version = "2.2.6"
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
implementation "androidx.room:room-ktx:$room_version"
testImplementation "androidx.room:room-testing:$room_version"
implementation files('libs/jxl.jar')
implementation 'com.github.myinnos:AlphabetIndex-Fast-Scroll-RecyclerView:1.0.8'
implementation 'com.github.bumptech.glide:glide:3.8.0'
implementation 'com.github.Kunzisoft:Android-SwitchDateTimePicker:1.9'
implementation "com.prolificinteractive:material-calendarview:1.4.3"
implementation 'com.github.PhilJay:MPAndroidChart:v3.0.3'
implementation 'com.github.AnyChart:AnyChart-Android:0.0.3'
implementation 'org.greenrobot:eventbus:3.0.0'
implementation 'io.reactivex:rxandroid:1.1.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.itextpdf:itext7-core:7.1.7'
implementation 'com.rmtheis:tess-two:6.0.4'
implementation files('libs/google-api-translate-java-0.98-mod2.jar')
implementation files('libs/json_simple-1.1.jar')
implementation files('libs/jtar-1.0.4.jar')
implementation files('libs/microsoft-translator-java-api-0.6-mod.jar')
implementation 'com.stepstone.stepper:material-stepper:4.3.1'
implementation 'com.github.clans:fab:1.6.4'
implementation 'com.kyanogen.signatureview:signature-view:1.0'
implementation("com.microblink:blinkid:5.9.0#aar") {
transitive = true
}
implementation 'com.itextpdf:itext7-core:7.1.7'
implementation deps.kotlin
implementation deps.android.support.appcompat
implementation deps.android.support.constraintlayout
implementation 'com.github.yeriomin:play-store-api:0.19'
implementation 'com.squareup.okhttp3:okhttp:3.10.0'
implementation 'org.jsoup:jsoup:1.11.1'
implementation 'com.google.android.play:core:1.9.0'//for new version updater
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.0'
implementation 'com.github.jakebonk:NotifyMe:1.0.1'
implementation 'com.szagurskii:patternedtextwatcher:0.5.0'
implementation 'com.schibstedspain.android:leku:5.0.0'
testImplementation deps.test.junit
androidTestImplementation deps.test.runner
androidTestImplementation deps.test.espresso
}
repositories {
mavenCentral()
}
configurations.all {
resolutionStrategy {
force("org.antlr:antlr4-runtime:4.5.3")
force("org.antlr:antlr4-tool:4.5.3")
}
}
and this is my gradle project :
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.1.2'
classpath 'com.google.gms:google-services:4.3.4'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.72"
classpath 'com.jakewharton:butterknife-gradle-plugin:10.2.3'
// 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 "https://maven.google.com" }
maven {
url 'https://maven.microblink.com' }
}
}
ext {
supportlib_version = '27.1.1'
appcompat_version = supportlib_version
design_version = supportlib_version
constraintlayout_version = '1.1.0'
junit_version = '4.12'
testrunner_version = '1.0.2'
espresso_version = '3.0.2'
}
ext.deps = [
'kotlin' : "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.72",
'android': [
'support': [
'core' : "com.android.support:support-v4:$supportlib_version",
'appcompat' : 'androidx.appcompat:appcompat:1.0.0',
'constraintlayout': 'androidx.constraintlayout:constraintlayout:1.1.3',
'design' : "com.android.support:design:$design_version"
]
],
'test' : [
'junit' : "junit:junit:$junit_version",
'runner' : 'androidx.test.ext:junit:1.1.1',
'espresso': 'androidx.test.espresso:espresso-core:3.1.0'
]
]
task clean(type: Delete) {
delete rootProject.buildDir
}
project.ext {
blinkIdVersion = '5.9.0'
compileSdkVersion = 28
targetSdkVersion = 28
buildToolsVersion = '28.0.3'
appCompatVersion = '28.0.0'
}
Please do not remove apply plugin: 'kotlin-kapt' from the gradle file. As it is required for annotation processor.
Please check all the Room queries in your DAO file for syntax error. The error mentioned in your question mostly occurs when the Room Database Queries are incorrect.
Please refer to below image to get more clear error log. These steps will take you closer to the exact error.
Lastly, try running build with --stacktrace OR --info OR --debug option to get more clear log output and full insights. This way you will be able to find solution for error.
I'm trying to add Firebase support for my app, and after adding all dependencies I still can't receive any reports. I re-installed my app also and it didn't help me. Where the problem can be? I also will add some other inportant info about my problem but please say me what I have to add for solving this problem.
UPDATE
My gradle files, project one:
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
jcenter()
maven {
url 'https://maven.fabric.io/public'
}
}
dependencies {
classpath 'com.android.tools.build:gradle:3.5.1'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.3.50"
classpath 'com.google.gms:google-services:4.3.2'
classpath 'io.fabric.tools:gradle:1.31.1' // Crashlytics plugin
}
}
allprojects {
repositories {
google()
jcenter()
maven {
google()
url 'https://jitpack.io'
}
maven { url 'https://maven.google.com' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
app level:
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
apply plugin: 'com.google.gms.google-services'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "..."
minSdkVersion 21
targetSdkVersion 28
versionCode 1
versionName "..."
testInstrumentationRunner "android.support.Singleton.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility = '1.8'
targetCompatibility = '1.8'
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.google.firebase:firebase-core:17.2.0'
testImplementation 'junit:junit:4.12'
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.3.50"
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.3.0'
implementation 'com.squareup.okhttp3:logging-interceptor:3.10.0'
implementation 'us.belka:androidtoggleswitch:1.2.2'
implementation 'commons-io:commons-io:2.4'
implementation files('libs/mail.jar')
implementation 'com.github.droidbond:LoadingButton:0.1.5'
implementation 'com.samigehi:loadingview:1.1'
implementation 'io.github.tonnyl:whatsnew:0.1.1'
implementation 'com.github.GrenderG:Toasty:1.3.1'
implementation 'com.lsjwzh:materialloadingprogressbar:0.5.8-RELEASE'
implementation 'com.daimajia.swipelayout:library:1.2.0#aar'
implementation 'com.google.firebase:firebase-analytics:17.2.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.10.1'
testImplementation 'junit:junit:4.12'
}
So, after adding all important scopes to my code I tottaly re-installed my app. It means that I firstly removed it from my device and then installed it again. Maybe the problem is because I re-installed this app on emulator???? And right now I have this picture:
I can't finish ticked step with number 3. Maybe someone knows where I did mistake?
Maybe this information will help someone else except me)) I have solve this problem with adding some lines to my AndroidManifest to application scopes:
<meta-data
android:name="firebase_crashlytics_collection_enabled"
android:value="true" />
this will enable crashlytics at your project also without creating crash. Good Luck :D
After I add kapt "androidx.room:room-compiler:2.1.0-alpha05"
I get error when doing data binding. Here is my app gradle :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'androidx.navigation.safeargs'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
applicationId "insure.onoff"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
vectorDrawables.useSupportLibrary true
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
// Gradle automatically adds 'android.test.runner' as a dependency.
useLibrary 'android.test.runner'
useLibrary 'android.test.base'
useLibrary 'android.test.mock'
applicationVariants.all {
variant ->
variant.outputs.all {
outputFileName = "./" + outputFileName
}
}
}
dependencies {
kapt "androidx.room:room-compiler:2.1.0-alpha05"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.core:core-ktx:1.1.0-alpha05'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'android.arch.navigation:navigation-fragment-ktx:1.0.0'
implementation 'android.arch.navigation:navigation-ui-ktx:1.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.room:room-runtime:2.1.0-alpha05'
implementation 'android.arch.work:work-runtime-ktx:1.0.1-rc01'
implementation 'android.arch.navigation:navigation-fragment:1.0.0'
implementation 'org.greenrobot:eventbus:3.1.1'
implementation 'com.squareup.retrofit2:retrofit:2.5.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.okhttp3:logging-interceptor:3.12.1'
implementation 'com.squareup.retrofit2:converter-gson:2.5.0'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.5.0'
implementation 'androidx.viewpager:viewpager:1.0.0'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.9.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.9.0'
// AWS Dependencies
implementation "com.amazonaws:aws-android-sdk-core:2.11.1"
implementation "com.amazonaws:aws-android-sdk-auth-core:2.11.1"
implementation("com.amazonaws:aws-android-sdk-auth-userpools:2.11.1") { transitive = true }
implementation("com.amazonaws:aws-android-sdk-auth-ui:2.11.1") { transitive = true }
implementation 'com.facebook.android:facebook-login:4.36.0'
implementation "com.google.android.gms:play-services-auth:16.0.1"
// Testing dependencies
androidTestImplementation "androidx.arch.core:core-testing:2.0.0"
androidTestImplementation "androidx.test.espresso:espresso-contrib:3.1.1"
androidTestImplementation "androidx.test.espresso:espresso-core:3.1.1"
androidTestImplementation "androidx.test.espresso:espresso-intents:3.1.1"
androidTestImplementation "androidx.test.uiautomator:uiautomator:2.2.0"
testImplementation "junit:junit:4.12"
}
project gradle :
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
ext.kotlin_version = '1.3.20'
repositories {
google()
jcenter()
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
}
dependencies {
classpath 'com.android.tools.build:gradle:3.3.2'
classpath 'android.arch.navigation:navigation-safe-args-gradle-plugin:1.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
google()
jcenter()
maven { url 'http://dl.bintray.com/kotlin/kotlin-eap' }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
Error :
My Android Studio version :
Android Studio 3.3
Build #AI-182.5107.16.33.5199772, built on December 25, 2018
JRE: 1.8.0_152-release-1248-b01 x86_64
JVM: OpenJDK 64-Bit Server VM by JetBrains s.r.o
macOS 10.12.5
When you get databinding errors, they are usually the result of a compilation error within the code.
Using the picture you have posted as reference, there are 4 Icons on the vertical toolbar on the left side of the screen. The top icon is the green hammer. Click the icon just below that (the 2nd one, it looks like two screens layered on top of each other). Clicking this icon opens up a different view that describes in detail what the compiler did not like - you generally will find what is causing the problems.
You can also run "gradle build -debug" or some other debug tracing cmd for gradle that will print in detail what the errors are.
Double check kotlin is compiling to your target jvm version 1.8
If all else fails, try clean/build + invalidate/cache + restart. Hope this helps.
I have a project using androidx and kotlin, I get an error message when running the application as follows:
w: JAR runtime files in the classpath should have the same version. These files were found in the classpath:
w: /Users/arjava/.gradle/caches/modules-2/files-2.1/org.jetbrains.kotlin/kotlin-stdlib-jre7/1.2.31/98678431965f7487d6dc9b399e59b6c4b3921073/kotlin-stdlib-jre7-1.2.31.jar: kotlin-stdlib-jre7 is deprecated. Please use kotlin-stdlib-jdk7 instead
and one more message directed me to the directory :
.gradle / caches / modules-2 / files-2.1 / org directory. Jetbrains.kotlin / kotlin-stdlib-jre7 / and xxxxxxx
I'm really confused about this problem, even though I don't apply jre in my app.gradle, I try to delete the files and then there will be more and more.
this is my app.gradle file :
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.mhdfdl41.android.gotoclinic"
minSdkVersion 16
targetSdkVersion 28
versionCode 1
versionName "1.0"
multiDexEnabled true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
sourceSets { main { assets.srcDirs = ['src/main/assets', 'src/main/assets/'] } }
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
androidTestImplementation "android.arch.core:core-testing:1.1.1"
implementation 'com.google.android.material:material:1.1.0-alpha03'
implementation 'com.readystatesoftware.sqliteasset:sqliteassethelper:2.0.1'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.smarteist:autoimageslider:1.1.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.github.smarteist:autoimageslider:1.1.1'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.github.humazed:RoomAsset:1.0.3'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.basgeekball:awesome-validation:1.3'
// AAC (Room, Live Data, View Model)
implementation "android.arch.persistence.room:runtime:1.1.1"
kapt "android.arch.persistence.room:compiler:1.1.1"
kapt "android.arch.lifecycle:compiler:1.1.1"
// ViewModel and LiveData
androidTestImplementation "android.arch.persistence.room:testing:1.1.1"
implementation "android.arch.lifecycle:extensions:$lifecycle_version"
//room asset access databases
implementation 'com.github.humazed:RoomAsset:1.0.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation "androidx.test.ext:junit:1.1.0"
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
// implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk8:$kotlin_version"
//anko
implementation "org.jetbrains.anko:anko:$anko_version"
}
configurations {
all*.exclude group: 'com.google.guava', module: 'listenablefuture'
}
repositories{
mavenCentral()
}
what made this happen?
This is how the root project's build.gradle should look alike. when I add kotlin-stdlib-jdk7, it still complains about a version mismatch; only kotlin-stdlib (without the postfix) works for me.
buildscript {
ext.kotlinVersion = "1.3.30"
repositories {
google()
jcenter()
}
dependencies {
classpath "com.android.tools.build:gradle:3.4.0"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:${kotlinVersion}"
}
}
plugins {
id "org.jetbrains.kotlin.jvm" version "1.3.30"
}
repositories {
mavenCentral()
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:${kotlinVersion}"
}
...