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.
Related
I have an issue when I try to connect my app to firebase through android studio I get this:
This is the error I get
This is my build.gradle(project):
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
jcenter()
google()
maven { url 'https://plugins.gradle.org/m2/'}
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.1'
classpath 'com.google.gms:google-services:4.3.10'
classpath 'gradle.plugin.com.onesignal:onesignal-gradle-plugin:0.12.5'
}
}
allprojects {
repositories {
jcenter()
google()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
This is my build.gradle(app):
plugins {
id 'com.onesignal.androidsdk.onesignal-gradle-plugin'
}
apply plugin: 'com.onesignal.androidsdk.onesignal-gradle-plugin'
apply plugin: 'com.android.application'
android {
compileSdkVersion 32
buildToolsVersion '29.0.2'
defaultConfig {
applicationId "com.simcoder.uber"
minSdkVersion 21
//noinspection OldTargetApi
targetSdkVersion 32
versionCode 1
versionName "2.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
multiDexEnabled true
useLibrary 'org.apache.http.legacy'
manifestPlaceholders = [onesignal_app_id : 'onesignal_app_id',
onesignal_google_project_number: 'REMOTE']
}
buildTypes {
release {
multiDexKeepFile file('multidex-config.txt')
minifyEnabled true
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility '1.8'
targetCompatibility '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
androidTestImplementation('androidx.test.espresso:espresso-core:3.1.0', {
exclude group: 'com.android.support', module: 'support-annotations'
})
//noinspection GradleCompatible
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.1.0-beta02'
implementation 'com.google.firebase:firebase-database:20.0.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
implementation 'com.google.firebase:firebase-storage:20.0.0'
implementation 'com.firebase:geofire-android:3.0.0'
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'com.google.android.gms:play-services-places:17.0.0'
implementation 'com.google.android.gms:play-services-location:18.0.0'
implementation 'com.google.android.gms:play-services-gcm:17.0.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.facebook.android:facebook-login:8.1.0'
implementation 'androidx.recyclerview:recyclerview:1.2.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.stripe:stripe-android:16.1.1'
implementation 'com.github.bumptech.glide:glide:4.11.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.akexorcist:googledirectionlibrary:1.1.1'
implementation 'com.onesignal:OneSignal:3.15.4'
implementation 'com.google.android.libraries.places:places:2.4.0'
implementation "com.github.addisonelliott:SegmentedButton:3.1.5"
implementation 'com.paypal.sdk:paypal-android-sdk:2.16.0'
implementation 'com.google.android.libraries.places:places:2.4.0'
implementation 'com.github.rtchagas:pingplacepicker:1.1.2'
implementation 'com.github.ybq:Android-SpinKit:1.4.0'
implementation 'androidx.multidex:multidex:2.0.1'
/* Needed for RxAndroid */
implementation 'io.reactivex:rxandroid:1.2.1'
implementation 'io.reactivex:rxjava:1.3.8'
implementation 'io.reactivex.rxjava2:rxjava:2.2.10'
/* Needed for Rx Bindings on views */
implementation 'com.jakewharton.rxbinding:rxbinding:1.0.1'
annotationProcessor 'com.jakewharton:butterknife:10.2.3'
implementation 'com.squareup.retrofit2:retrofit:2.9.0' //Proguard
implementation 'com.squareup.retrofit2:converter-gson:2.9.0' //Proguard
implementation 'com.squareup.retrofit2:converter-scalars:2.9.0' //Proguard
/* Used for server calls */
implementation 'com.squareup.okio:okio:2.9.0'
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
/* Used to make Retrofit easier and GSON & Rx-compatible*/
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:adapter-rxjava:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
/* Used to debug your Retrofit connections */
implementation 'com.squareup.okhttp3:logging-interceptor:4.9.0'
implementation "com.yuyakaido.android:card-stack-view:2.3.4"
implementation 'com.lorentzos.swipecards:library:1.0.9'
implementation 'com.mikhaellopez:circularprogressbar:3.0.3'
implementation 'com.github.tintinscorpion:Dual-color-Polyline-Animation:1.0'
implementation 'com.shreyaspatil:MaterialDialog:2.1'
// Material Design Library
implementation 'com.google.android.material:material:1.3.0'
implementation 'com.ncorti:slidetoact:0.7.0'
testImplementation 'junit:junit:4.13.2'
}
apply plugin: 'com.google.gms.google-services'
Tried a couple of things I found on stackoverflow (removing jcenter and such) and nothing worked out for me. If anyone has any idea how I could solve this issue please let me know.
Why does val user = Firebase.auth.currentUser (which .currentUser) become invalid when I insert implementation 'com.google.firebase:firebase-admin:6.13.0' into Gradle?
Before importing implementation 'com.google.firebase:firebase-admin:6.13.0':
After importing implementation 'com.google.firebase:firebase-admin:6.13.0', auth's method become admin's method. It seems Firebase-admin conflicts with FirebaseAuth. Why?
File build.gradle (Module:app)
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions' apply plugin: 'com.google.gms.google-services' apply plugin: 'kotlin-kapt'
android {
compileSdkVersion 30
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.squall.searchdesigner"
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 = 1.8
targetCompatibility = 1.8
}
kotlinOptions {
jvmTarget = "1.8"
}
dataBinding {
enabled = true
} }
dependencies {
implementation 'androidx.recyclerview:recyclerview:1.2.0-alpha03'
def room_version = "2.2.5"
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation "org.jetbrains.kotlin:kotlin-stdlib-jdk7:$kotlin_version"
implementation 'androidx.appcompat:appcompat:1.1.0'
implementation 'androidx.core:core-ktx:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.google.firebase:firebase-auth:19.3.1'
implementation 'com.google.firebase:firebase-auth-ktx:19.3.1'
implementation 'com.google.firebase:firebase-firestore:21.4.3'
implementation 'com.google.firebase:firebase-storage:19.1.1'
// FirebaseUI for Cloud Firestore
implementation 'com.firebaseui:firebase-ui-firestore:6.1.0'
// FirebaseUI for Firebase Auth
implementation 'com.firebaseui:firebase-ui-auth:6.2.1'
// FirebaseUI for Cloud Storage
implementation 'com.firebaseui:firebase-ui-storage:6.1.0'
implementation 'com.facebook.android:facebook-login:5.0.0'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
//lifecycle
implementation 'androidx.lifecycle:lifecycle-extensions:2.2.0'
implementation 'androidx.lifecycle:lifecycle-viewmodel-ktx:2.2.0'
implementation 'androidx.lifecycle:lifecycle-runtime-ktx:2.2.0'
implementation "androidx.lifecycle:lifecycle-viewmodel-savedstate:2.2.0"
implementation 'androidx.lifecycle:lifecycle-livedata-ktx:2.2.0'
//navigation
implementation "androidx.navigation:navigation-fragment-ktx:2.2.2"
implementation "androidx.navigation:navigation-ui-ktx:2.2.2"
//Firebase cloud message
implementation 'com.google.firebase:firebase-messaging:20.2.0'
implementation 'com.google.firebase:firebase-messaging-directboot:20.2.0'
testImplementation 'junit:junit:4.13'
androidTestImplementation 'androidx.test.ext:junit:1.1.1'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.2.0'
implementation 'com.google.android.material:material:1.1.0'
//Room
implementation "androidx.room:room-runtime:$room_version"
kapt "androidx.room:room-compiler:$room_version"
// For Kotlin use kapt instead of annotationProcessor
// optional - Kotlin Extensions and Coroutines support for Room
implementation "androidx.room:room-ktx:$room_version"
implementation 'com.squareup.picasso:picasso:2.71828'
implementation 'jp.wasabeef:picasso-transformations:2.2.1'
//coroutine
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.7'
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-android:1.3.7'
//Firebase Coroutine dependency:
implementation 'org.jetbrains.kotlinx:kotlinx-coroutines-play-services:1.3.6'
//Firebase firestore extension
implementation 'com.google.firebase:firebase-firestore-ktx:21.4.3'
implementation 'androidx.activity:activity-ktx:1.1.0'
implementation 'androidx.fragment:fragment-ktx:1.2.5'
//Facebook SDK
implementation 'com.facebook.android:facebook-android-sdk:5.0.0'
implementation 'com.google.firebase:firebase-admin:6.13.0'
implementation 'com.google.firebase:firebase-functions-ktx:19.0.2' }
build.gradle(Project:)
buildscript {
ext.kotlin_version = '1.3.72'
repositories {
google()
jcenter()
maven { url "https://jitpack.io" }
}
dependencies {
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
classpath 'com.google.gms:google-services:4.3.3'
// 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
}
CurrentUser only exists in the Firebase Android SDK. You cannot use both Android SDK and Admin SDK together. They have conflicting packages/classes. Specifically, you cannot use the Admin SDK in an Android or any client-side application.
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.
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}"
}
...
I'm using firebase UI-Auth for authentication but after adding analytics dependency I'm getting this error. The app crashes after some time being idle. Sometimes it crashes at the initial start up after restarting it couple of times it runs fine. I have also updated all the libraries to their latest versions but this also doesn't help.
Fatal Exception: java.lang.NoSuchFieldError No field
PREFER_HIGHEST_OR_REMOTE_VERSION_NO_FORCE_STAGING of type
Lcom/google/android/gms/dynamite/DynamiteModule$VersionPolicy; in
class Lcom/google/android/gms/dynamite/DynamiteModule; or its
superclasses (declaration of
'com.google.android.gms.dynamite.DynamiteModule' appears in base.apk)
This is my build.gradle
import com.google.gms.googleservices.GoogleServicesPlugin
buildscript {
repositories {
maven { url 'https://maven.fabric.io/public' }
}
dependencies {
classpath 'io.fabric.tools:gradle:1.26.1'
}
}
apply plugin: 'com.android.application'
apply plugin: 'io.fabric'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.hussain.podcastapp"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
compileOptions {
targetCompatibility 1.8
sourceCompatibility 1.8
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.0'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.5'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.jakewharton:butterknife:9.0.0-SNAPSHOT'
implementation 'com.google.firebase:firebase-core:16.0.4'
implementation 'com.github.devlight.navigationtabstrip:navigationtabstrip:1.0.4'
implementation 'com.squareup.retrofit2:converter-simplexml:2.3.0'
implementation 'com.github.florent37:glidepalette:2.1.2'
implementation 'androidx.palette:palette:1.0.0'
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.airbnb.android:lottie:2.6.1'
implementation "com.mikepenz:materialdrawer:6.0.9"
implementation 'com.google.android.exoplayer:exoplayer-core:2.8.1'
implementation 'com.google.android.exoplayer:exoplayer-dash:2.8.0'
implementation 'com.google.android.exoplayer:exoplayer-ui:2.8.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.firebase:firebase-jobdispatcher:0.8.5'
implementation 'com.firebaseui:firebase-ui-auth:4.1.0'
implementation 'com.google.firebase:firebase-database:16.0.3'
implementation 'androidx.room:room-runtime:2.0.0'
annotationProcessor 'androidx.room:room-compiler:2.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.8.0'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-SNAPSHOT'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test:runner:1.1.0-beta02'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.0-beta02'
implementation 'androidx.recyclerview:recyclerview:1.0.0'
implementation 'com.google.android.gms:play-services-ads:17.0.0'
implementation 'androidx.cardview:cardview:1.0.0'
implementation 'com.crashlytics.sdk.android:crashlytics:2.9.5'
implementation 'com.crashlytics.sdk.android:answers:1.4.3'
}
apply plugin: 'com.google.gms.google-services'
GoogleServicesPlugin.config.disableVersionCheck = true
This is my project level build.gradle
buildscript {
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.2.1'
classpath 'com.google.gms:google-services:4.1.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
allprojects {
repositories {
maven { url "https://oss.sonatype.org/content/repositories/snapshots" }
google()
jcenter()
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}