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
Related
I have implemented retrofit library with gson but getting an importing error.
Android studio version
Android Studio Arctic Fox | 2020.3.1 Patch 2 Build
#AI-203.7717.56.2031.7678000, built on August 27, 2021
App level build.gradle
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'kotlin-android'
id 'kotlin-kapt'
}
android {
compileSdk 31
defaultConfig {
applicationId "com.example.app"
minSdk 21
targetSdk 31
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
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
dataBinding true
}
}
dependencies {
implementation 'androidx.core:core-ktx:1.7.0'
implementation 'androidx.appcompat:appcompat:1.3.1'
implementation 'com.google.android.material:material:1.4.0'
// Import the Firebase BoM
implementation platform('com.google.firebase:firebase-bom:29.0.3')
// Declare the dependency for the Firebase Authentication library
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-messaging-ktx'
implementation 'com.google.firebase:firebase-analytics-ktx'
implementation 'com.google.android.gms:play-services-safetynet:18.0.0'
//Nav Component
implementation "androidx.fragment:fragment-ktx:1.3.6"
implementation "androidx.navigation:navigation-fragment-ktx:2.3.5"
implementation "androidx.navigation:navigation-ui-ktx:2.3.5"
// Live Data
implementation "androidx.lifecycle:lifecycle-runtime-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-livedata-ktx:$lifecycleVersion"
implementation "androidx.lifecycle:lifecycle-viewmodel-ktx:$lifecycleVersion"
//Material Dialog
implementation 'com.afollestad.material-dialogs:core:3.3.0'
implementation 'com.afollestad.material-dialogs:bottomsheets:3.3.0'
//RecyclerView
implementation 'androidx.recyclerview:recyclerview:1.2.1'
implementation 'androidx.constraintlayout:constraintlayout:2.1.1'
//interceptor
implementation 'com.itkacher.okhttpprofiler:okhttpprofiler:1.0.7'
//Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.9.0'
implementation 'com.squareup.retrofit2:converter-gson:2.9.0'
implementation "com.squareup.okhttp3:logging-interceptor:4.8.0"
implementation 'org.conscrypt:conscrypt-android:2.2.1'
testImplementation 'junit:junit:'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
}
Top-level build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:7.0.3"
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:1.5.31"
classpath 'com.google.gms:google-services:4.3.10'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
settings.gradel
dependencyResolutionManagement {
repositoriesMode.set(RepositoriesMode.FAIL_ON_PROJECT_REPOS)
repositories {
google()
mavenCentral()
jcenter() // Warning: this repository is going to shut down soon
maven { url "https://jitpack.io" }
}
}
rootProject.name = "Exaple app"
include ':app'
getting this error
I have already done some stuff like clean project, rebuild and invalidate caches, and restart. But still getting the same error.
Thanks in advance.
You need to implement also the GSON dependency
You missing this I'd say
implementation("com.google.code.gson:gson:2.8.9")
I try to build a release version for my APK but there are problems in the build, and this what is shown in my build-out
Could not determine the dependencies of task ':app:lintVitalRelease'.
> Could not resolve all artifacts for configuration ':app:debugAndroidTestCompileClasspath'.
> Could not find com.google.firebase:firebase-firestore:.
Required by:
project :app > com.firebaseui:firebase-ui-firestore:7.2.0
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
and this is my code Module build.gradle
plugins {
id 'com.android.application'
id 'com.google.gms.google-services'
id 'com.google.firebase.firebase-perf'
id 'com.google.firebase.crashlytics'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.example"
minSdkVersion 21
targetSdkVersion 30
versionCode 3
versionName "2.7"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled true
shrinkResources true
proguardFiles getDefaultProguardFile('proguard-android.txt'),'proguard-rules.pro'
}
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
sourceSets {
main {
assets {
srcDirs 'src\\main\\assets'
}
}
}
}
dependencies {
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.navigation:navigation-fragment:2.3.5'
implementation 'androidx.navigation:navigation-ui:2.3.5'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
implementation 'com.github.bumptech.glide:glide:4.12.0'
implementation 'com.google.firebase:firebase-inappmessaging-display:20.0.0'
implementation 'com.google.firebase:firebase-config:21.0.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
implementation 'androidx.preference:preference:1.1.1'
implementation 'androidx.lifecycle:lifecycle-process:2.3.1'
testImplementation 'junit:junit:4.13.2'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation 'com.daimajia.swipelayout:library:1.2.0#aar'
implementation 'com.airbnb.android:lottie:3.7.0'
implementation 'androidx.recyclerview:recyclerview:1.2.1'
// For control over item selection of both touch and mouse driven selection
implementation 'androidx.recyclerview:recyclerview-selection:1.1.0'
// FireBase Start implementation
implementation 'com.google.firebase:firebase-ads:20.2.0'
implementation 'com.google.android.gms:play-services-auth:19.0.0'
implementation 'com.google.firebase:firebase-perf:20.0.1'
implementation 'com.google.firebase:firebase-crashlytics:18.1.0'
implementation 'com.google.firebase:firebase-analytics:19.0.0'
implementation 'com.google.firebase:firebase-messaging:22.0.0'
implementation 'com.firebaseui:firebase-ui-firestore:7.2.0'/*i think here is problem*/
implementation 'com.firebaseui:firebase-ui-database:7.2.0'
implementation 'com.google.firebase:firebase-bom:28.2.0'
implementation 'com.google.firebase:firebase-database:20.0.0'
implementation 'com.google.firebase:firebase-auth:21.0.1'
// FireBase End implementation
implementation 'com.github.tapadoo:alerter:7.1.0'
implementation 'org.jetbrains.kotlin:kotlin-stdlib-jdk7:1.5.20'
implementation 'com.pranavpandey.android:dynamic-toasts:4.0.0'
}
and this is project build.gradle
// Top-level build file where you can add configuration options common to all sub-projects/modules.
buildscript {
repositories {
google()
mavenCentral()
}
dependencies {
classpath 'com.android.tools.build:gradle:4.2.2'
classpath 'com.google.gms:google-services:4.3.8'
classpath 'com.google.firebase:perf-plugin:1.4.0'
classpath 'com.google.firebase:firebase-crashlytics-gradle:2.7.1'
}
}
allprojects {
repositories {
google()
mavenCentral()
maven { url "https://jitpack.io" }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
I try many things to solve it but the problem is still found and if you have notes in my build.gradle alert me and thanks
in the firebase documentation, they also mention adding below implementations
implementation "com.google.firebase:firebase-firestore:$X.Y.Z"
implementation "androidx.legacy:legacy-support-v4:$X.Y.Z"
implementation "androidx.recyclerview:recyclerview:$X.Y.Z"
Android studio displays this strange error whenever I add some dependency to the grade file. It was working perfectly earlier. Further it displays no cached version of retrofit2 scalars available for offline mode.
Currently I tried almost all options from uninstalling and reinstalling android studio but no luck. I am running out of time so please help me resolve this.
apply plugin: 'com.android.application'
android {
compileSdkVersion 29
buildToolsVersion "29.0.3"
defaultConfig {
applicationId "com.example.protabler"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(dir: 'libs', include: ['*.jar'])
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'androidx.constraintlayout:constraintlayout:1.1.3'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
implementation 'androidx.navigation:navigation-fragment:2.0.0'
implementation 'androidx.navigation:navigation-ui:2.0.0'
implementation 'androidx.lifecycle:lifecycle-extensions:2.0.0'
implementation 'androidx.preference:preference:1.1.0-alpha05'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.0'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation "androidx.cardview:cardview:1.0.0"
implementation 'com.google.android.material:material:1.0.0'
implementation 'com.squareup.retrofit2:retrofit:2.4.0'
implementation 'com.google.code.gson:gson:2.8.6'
implementation 'com.squareup.retrofit2:converter-gson:2.4.0'
implementation 'com.squareup.retrofit2:converter-scalars:2.5.0'
implementation 'androidx.recyclerview:recyclerview:1.1.0'
implementation 'de.hdodenhof:circleimageview:3.0.1'
}
// 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.5.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
}
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.
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.