I've got an error for 'Theme.MaterialComponents.Light.NoActionBar' in styles.xml (the 'Theme.MaterialComponents.Light.NoActionBar' is colored red because of error) after several gradle update. My component are also not well arranged according to my idea of designing.
I've already clean and rebuild project, invalidate caches/restart, update the gradle (maybe not the correct answer) and there's no answer for this. I just think maybe I'm the only one that have this problem maybe for my beginner level problem :')
styles.xml
`
<!-- Base application theme. -->
<style name="AppTheme" parent="Theme.MaterialComponents.Light.NoActionBar">
<!-- Customize your theme here. -->
<item name="colorPrimary">#color/colorPrimary</item>
<item name="colorPrimaryDark">#color/hitam</item>
<item name="colorAccent">#color/colorAccent</item>
</style>
`
Project gradle
repositories {
google()
jcenter()
}
dependencies {
classpath 'com.android.tools.build:gradle:3.4.2'
classpath 'com.google.gms:google-services:4.2.0'
// NOTE: Do not place your application dependencies here; they belong
// in the individual module build.gradle files
}
'
App gradle
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 29
defaultConfig {
applicationId "blablabla"
minSdkVersion 23
targetSdkVersion 29
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
buildToolsVersion '29.0.1'
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_6
targetCompatibility JavaVersion.VERSION_1_6
sourceCompatibility JavaVersion.VERSION_1_7
targetCompatibility JavaVersion.VERSION_1_7
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.ar.sceneform.ux:sceneform-ux:1.10.0'
implementation 'androidx.appcompat:appcompat:1.0.2'
implementation 'com.google.firebase:firebase-core:17.0.1'
implementation 'com.google.firebase:firebase-auth:18.1.0'
implementation 'com.google.firebase:firebase-database:18.0.0'
implementation 'androidx.appcompat:appcompat:1.1.0-rc01'
implementation 'androidx.constraintlayout:constraintlayout:2.0.0-beta2'
}
apply plugin: 'com.google.gms.google-services'
buildToolsVersion = '29.0.1'
}
`
I expect the error is not visible when there's like no one in this earth that have this error. PLEASE HELP T_T
The Material Components themes are included in the Material Components for Android library.
Since you are using androidx library just add this dependency in you app/build.gradle file.
dependencies {
// ...
implementation 'com.google.android.material:material:x.x.x'
// ...
}
Currently (April 29, 2022) the latest stable version is
implementation 'com.google.android.material:material:1.5.0'
Here you can find all the info the setup.
The reason why the MaterialComponents theme does not show is because you did not include the required Material Components library in your app/build.gradle:
dependencies {
implementation 'com.google.android.material:material:<version>'
}
The currently available versions are listed on the project's GitHub releases.
Add the dependency on Android’s Material in /android/app/build.gradle:
dependencies {
// ...
implementation 'com.google.android.material:material:<version>'
// ...
}
To find out the latest version, visit Google Maven.
Set the theme in /android/app/src/main/res/values/styles.xml:
//<style name="LaunchTheme" parent="Theme.AppCompat"> - remove
<style name="LaunchTheme" parent="Theme.MaterialComponents.NoActionBar"> - add
Related
I'm trying to get datas from my class to my xml file so i tried to use data binding. But data-binding library does not working. When i write <data in my xml file, compiler does not shows anything. How can i solve this problem ? Otherwise how can i get datas from class to xml file without data binding ? Xml belongs to a fragment view.
'''plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
id("androidx.navigation.safeargs")
id 'com.google.gms.google-services'
id "org.jetbrains.kotlin.kapt"
id 'kotlin-kapt'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.cagataysencan.forumfisk_it"
minSdkVersion 24
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'
}
buildFeatures {
dataBinding true
}
}
dataBinding {
enabled = true
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
kotlinOptions {
jvmTarget = '1.8'
}
buildFeatures {
viewBinding true
}
}
dependencies {
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.5.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.3.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
//Navigation v Google Maps
implementation("androidx.navigation:navigation-fragment-ktx:2.3.5")
implementation("androidx.navigation:navigation-ui-ktx:2.3.5")
implementation 'com.google.android.gms:play-services-maps:17.0.1'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
// Firebase
implementation platform('com.google.firebase:firebase-bom:28.2.0')
implementation 'com.google.firebase:firebase-auth-ktx'
implementation 'com.google.firebase:firebase-firestore-ktx'
implementation 'com.google.firebase:firebase-storage-ktx'
// Picasso
implementation 'com.squareup.picasso:picasso:2.71828'
// ViewModel
implementation("androidx.lifecycle:lifecycle-viewmodel-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-livedata-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-runtime-ktx:2.3.1")
implementation("androidx.lifecycle:lifecycle-viewmodel-savedstate:2.3.1")
implementation("androidx.lifecycle:lifecycle-service:2.3.1")
implementation("androidx.lifecycle:lifecycle-process:2.3.1")
implementation("androidx.lifecycle:lifecycle-reactivestreams-ktx:2.3.1")
testImplementation("androidx.arch.core:core-testing:2.1.0")
// Retrofit
implementation 'com.squareup.retrofit2:retrofit:2.8.1'
implementation 'com.squareup.retrofit2:converter-gson:2.8.1'
implementation "com.squareup.retrofit2:adapter-rxjava2:2.8.1"
// RX Java
implementation "io.reactivex.rxjava2:rxjava:2.2.9"
implementation "io.reactivex.rxjava2:rxandroid:2.1.1"
// Glide
implementation 'com.github.bumptech.glide:glide:4.12.0'
annotationProcessor 'com.github.bumptech.glide:compiler:4.12.0'
// Room
implementation 'androidx.room:room-rxjava2:2.3.0'
implementation "androidx.room:room-guava:2.3.0"
implementation "androidx.room:room-ktx:2.3.0"
implementation ("androidx.room:room-runtime:2.3.0")
annotationProcessor "androidx.room:room-compiler:2.3.0"
kapt("androidx.room:room-compiler:2.3.0")
implementation "org.jetbrains.kotlinx:kotlinx-coroutines-core:1.4.1"
}**
Remove the lines:
databinding {
enabled=true
}
Also, remove viewBinding since there is no need for it if you are already using dataBinding..
Move buildFeatures out of buildTypes so that it should be like this
android {
...
buildTypes {
...
}
buildFeatures {
dataBinding true
}
}
And when you want to use dataBinding, make sure you enclose your layout with the <layout> tag to signify that the layout is eligible for dataBinding. So each xml file you want to bind should have the <layout> tag and can be like this for example:
<layout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools">
<data>
...
</data>
<androidx.constraintlayout.widget.ConstraintLayout
android:layout_width="match_parent"
android:layout_height="match_parent">
<TextView
...
...
</layout>
Please match some line of plugin and dependency and version with kotlin and databinding in your gradle file that what you missing please check
apply plugin: 'com.android.application'
apply plugin: 'kotlin-android'
apply plugin: 'kotlin-android-extensions'
apply plugin: 'kotlin-kapt'
dependencies{
kapt 'com.android.databinding:compiler:4.0.0'
}
ext.kotlin_version = '1.4.10'
classpath 'com.android.tools.build:gradle:4.0.0'
classpath "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlin_version"
Hope it may help you
masters.
I've just started developing an Android(kotlin).
I tried to use open source for my project, but there is an error.
What am I supposed to do here?
(I referred to "https://androidexample365.com/customizable-timetableview-for-android/")
my project's gradle(module)-----------------------------------------------------------------------
plugins {
id 'com.android.application'
id 'kotlin-android'
id 'kotlin-android-extensions'
}
android {
compileSdkVersion 30
buildToolsVersion "30.0.3"
defaultConfig {
applicationId "com.akj.callback"
minSdkVersion 23
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
}
kotlinOptions {
jvmTarget = '1.8'
}
}
dependencies {
implementation 'com.github.islandparadise14:Mintable:x.y.z'
implementation "org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version"
implementation 'androidx.core:core-ktx:1.6.0'
implementation 'androidx.appcompat:appcompat:1.3.0'
implementation 'com.google.android.material:material:1.4.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.4'
testImplementation 'junit:junit:4.+'
androidTestImplementation 'androidx.test.ext:junit:1.1.3'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.4.0'
implementation "com.airbnb.android:lottie-compose:1.0.0-rc02-1"
}
my project's gradle(Project)----------------------------------------------------------------------
buildscript {
ext.kotlin_version = "1.5.21"
repositories {
google()
mavenCentral()
}
dependencies {
classpath "com.android.tools.build:gradle:4.2.2"
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()
mavenCentral()
jcenter()
// Warning: this repository is going to shut down soon
maven { url uri("https://jitpack.io") }
}
}
task clean(type: Delete) {
delete rootProject.buildDir
}
my project's xml----------------------------------------------------------------------------------
<?xml version="1.0" encoding="utf-8"?>
<androidx.constraintlayout.widget.ConstraintLayout xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
xmlns:tools="http://schemas.android.com/tools"
android:layout_width="match_parent"
android:layout_height="match_parent"
tools:context=".test_timetable">
<com.islandparadise14.mintable.MinTimeTableView
android:id="#+id/table"
android:layout_width="match_parent"
android:layout_height="wrap_content"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent" />
</androidx.constraintlayout.widget.ConstraintLayout>
error message-------------------------------------------------------------------------------------
Execution failed for task ':app:checkDebugAarMetadata'.
> Could not resolve all files for configuration ':app:debugRuntimeClasspath'.
> Could not find com.github.islandparadise14:Mintable:x.y.z.
Searched in the following locations:
- https://dl.google.com/dl/android/maven2/com/github/islandparadise14/Mintable/x.y.z/Mintable-x.y.z.pom
- https://repo.maven.apache.org/maven2/com/github/islandparadise14/Mintable/x.y.z/Mintable-x.y.z.pom
- https://jcenter.bintray.com/com/github/islandparadise14/Mintable/x.y.z/Mintable-x.y.z.pom
- https://jitpack.io/com/github/islandparadise14/Mintable/x.y.z/Mintable-x.y.z.pom
Required by:
project :app
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html`enter code here`
I did not touch any of the above settings.
I just want to use this off-source for my project.
I'd like to solve this problem.
See the reference on jitpack's page. Use the latest version, or any other version that is fit for your purpose.
When you declare a remote dependency in your module-level Gradle file (written in Groovy or Kotlin), the format is generally like this:
implementation '{package/group}:{module/project}:{versionNumber}'
// Example: 'com.example.android:app-magic:12.3'
// which is shorthand for:
implementation group: 'com.example.android', name: 'app-magic', version: '12.3'
See the Android docs for more info.
Here, the module/project name may or may not be present, as it is typically optional for the creator of the library/module to generate or use. Thus, in the case of the Mintable project, to use the newest version, you would use:
implementation 'com.github.islandparadise14:Mintable:1.5.1' //in place of x.y.z
Hope this information is also helpful in the future. All the best!
My project is in Java on android studio on IntelliJ.
I downloaded openbeans-1.0.jar, put it in my libs folder, went to Project Structure, and added it to the dependencies. Here is my build.gradle (:app) code:
apply plugin: 'com.android.application'
apply plugin: 'com.android.application'
android {
compileSdkVersion 30
buildToolsVersion "30.0.2"
defaultConfig {
applicationId "com.example.gotimejavaversion"
minSdkVersion 15
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'
}
}
}
dependencies {
implementation fileTree(dir: "libs", include: ["*.jar"])
implementation 'androidx.appcompat:appcompat:1.2.0'
implementation 'androidx.constraintlayout:constraintlayout:2.0.1'
implementation 'androidx.coordinatorlayout:coordinatorlayout:1.1.0'
implementation 'com.google.android.material:material:1.0.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.ext:junit:1.1.2'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.3.0'
implementation 'com.opencsv:opencsv:5.2'
implementation 'com.googlecode:openbeans:1.0'
implementation 'com.univocity:univocity-parsers:2.9.0'
}
This is the MVN Repository info I found online for OpenBeans using gradle(this is just a visual reference I am using to create the line implementation 'com.googlecode:openbeans:1.0' in my build.gradle file. I am not using Maven):
// https://mvnrepository.com/artifact/com.googlecode/openbeans
compile group: 'com.googlecode', name: 'openbeans', version: '1.0'
I get the error:
Could not determine the dependencies of task ':app:compileDebugRenderscript'.
> Could not resolve all task dependencies for configuration ':app:debugCompileClasspath'.
> Could not find com.googlecode:openbeans:1.0.
Required by:
project :app
Possible solution:
- Declare repository providing the artifact, see the documentation at https://docs.gradle.org/current/userguide/declaring_repositories.html
I couldn't make out what I am doing wrong in the documentation. I've checked how I've typed it in multiple times and have tried implementation 'com.googlecode.openbeans:openbeans:1.0' I'm new to working with repositories and programming at that. Any help is appreciated.
Thank you!
firstly my module build.gradle was like this:
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.depressionanalysis"
minSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-firestore:17.1.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.guava:guava:27.0.1-jre'
implementation 'com.loopj.android:android-async-http:1.4.9'
}
which resulted in this warning:
" The app gradle file must have a dependency on com.google.firebase:firebase-core for Firebase services to work as intended. "
so i tried to add it in (and updated firestore as well)
apply plugin: 'com.android.application'
apply plugin: 'com.google.gms.google-services'
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.example.depressionanalysis"
minSdkVersion 27
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
}
}
productFlavors {
}
buildToolsVersion '28.0.3'
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
implementation 'com.android.support:appcompat-v7:28.0.0-rc02'
implementation 'com.android.support.constraint:constraint-layout:1.1.3'
implementation 'com.android.support:design:28.0.0'
implementation 'com.google.firebase:firebase-firestore:21.4.2'
implementation 'com.google.firebase:firebase-core:17.3.0'
testImplementation 'junit:junit:4.12'
androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'
implementation 'com.google.guava:guava:27.0.1-jre'
implementation 'com.loopj.android:android-async-http:1.4.9'
}
but got this error
" Manifest merger failed : Attribute application#appComponentFactory value=(android.support.v4.app.CoreComponentFactory) from [com.android.support:support-compat:28.0.0] AndroidManifest.xml:22:18-91
is also present at [androidx.core:core:1.0.0] AndroidManifest.xml:22:18-86 value=(androidx.core.app.CoreComponentFactory).
Suggestion: add 'tools:replace="android:appComponentFactory"' to <application> element at AndroidManifest.xml:10:5-46:19 to override. "
How do i fix it? I've tried out a few solutions found here but to no avail.. Thanks in advance! Let me know if any other codes are needed!!
You are using the latest version of firestore:
com.google.firebase:firebase-firestore:21.4.2
and on June 2019, firebase started supporting androidX, therefore you need to migrate to androidX to be able to use firebase.
The updated libraries will not work unless you make the following changes in your app:
Upgrade com.android.tools.build:gradle to v3.2.1 or later.
Upgrade compileSdkVersion to 28 or later.
Update your app to use Jetpack (AndroidX); follow the instructions in Migrating to AndroidX.
Check how to migrate:
https://developer.android.com/jetpack/androidx/migrate
Actually, for the same library, you have different versions via different sources, You have support library as well as their AndroidX version, For Now, you can try solving it using
tools:replace="android:appComponentFactory
attribute as given in your error itself.
Go to your AndroidManifest file add this attribute like below.
<application
android:name=".AbcApplication"
tools:replace="android:appComponentFactory
>
</application>
for me i have add two attribute in AndroidMenifest.xml
tools:replace="android:appComponentFactory"
android:appComponentFactory="androidx"
full tag it like :
<application
android:allowBackup="true"
android:icon="#mipmap/logo"
android:label="#string/app_name"
android:roundIcon="#mipmap/logo"
android:theme="#style/AppTheme"
tools:replace="android:appComponentFactory"
android:appComponentFactory="androidx"
tools:ignore="GoogleAppIndexingWarning">
and your project should be in Androidx.
I trying to user multiple module android project to work on my application and when I try to build the project. the project build fails with Manifest merge failures. I need help to resolve this issue.
I already tried changing the dependencies in Gradle files and tried rearranging them, searched other solutions in this and here as well, but none of them helped
my AndroidManifest.xml file
<manifest xmlns:android="http://schemas.android.com/apk/res/android"
package="com.atomnest.chitfund">
<application
xmlns:tools="http://schemas.android.com/tools"
android:allowBackup="true"
android:icon="#mipmap/ic_launcher"
android:label="#string/app_name"
android:roundIcon="#mipmap/ic_launcher_round"
android:supportsRtl="true"
android:theme="#style/AppTheme"
tools:replace="android:appComponentFactory" />
</manifest>
since the project is not build successfully I'm not able to add any activity to the project
and my build.gradle File
apply plugin: 'com.android.application'
buildscript {
ext {
support_version = '1.0.2'
}
repositories {
mavenCentral()
}
}
android {
compileSdkVersion 28
defaultConfig {
applicationId "com.atomnest.chitfund"
minSdkVersion 23
targetSdkVersion 28
versionCode 1
versionName "1.0"
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
}
compileOptions {
sourceCompatibility JavaVersion.VERSION_1_8
targetCompatibility JavaVersion.VERSION_1_8
}
buildTypes {
release {
minifyEnabled false
proguardFiles getDefaultProguardFile('proguard-android-optimize.txt'), 'proguard-rules.pro'
}
}
}
dependencies {
implementation fileTree(include: ['*.jar'], dir: 'libs')
testImplementation 'junit:junit:4.12'
androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'
implementation 'com.google.firebase:firebase-storage:16.0.5'
implementation 'com.google.firebase:firebase-auth:16.1.0'
implementation 'com.google.firebase:firebase-database:16.0.6'
implementation "androidx.appcompat:appcompat:$support_version"
implementation 'com.jakewharton:butterknife:9.0.0-rc2'
annotationProcessor 'com.jakewharton:butterknife-compiler:9.0.0-rc2'
implementation 'com.github.bumptech.glide:glide:4.8.0'
implementation 'com.firebase:geofire-android:2.1.1'
implementation project(':utility')
implementation project(':library')
}
I am expecting to get the project build successfully and be able to launch the app in the emulator. pls help
here is the logcat image
If you are using androidx then you have to use all libraries compatible with androidx so you can use this code:-
In gradle.build (app) add this
compileSdkVersion 28
defaultConfig {
......
minSdkVersion 21
targetSdkVersion 28
......
}
And there are some implementations required to use androidx :-
implementation 'androidx.appcompat:appcompat:1.1.0-alpha01'
implementation 'androidx.legacy:legacy-support-v4:1.0.0'
And add these given two lines(below) to gradle.properties:-
android.useAndroidX=true
android.enableJetifier=true
Solution 1:
Suggestion: add 'tools:replace="android:appComponentFactory"' to
element at AndroidManifest.xml to override.
If you added the tools:replace="android:appComponentFactory" and still got trouble by fixing it, create a new project, copy-paste the codes and the same dependencies in there. After that, it should be fixed i hope.
If it didn't solve the issue, try adding these two:
tools:replace="android:appComponentFactory"
android:appComponentFactory="whateverString"
In AndroidManifest.xml > <application tag of course.
Solution 2:
Add below two lines in gradle.properties
android.useAndroidX=true
android.enableJetifier=true
You can also follow below link:
https://developer.android.com/jetpack/androidx/migrate
Do let me know if you get any problem.
Actually I had the same issue.In my case it was butterknife. I changed the dependency into 8.8.1 and it works fine for me.