Translate this page

Here is How to Fix cannot access ActivityCompatApi23 class file Error in Android Studio

How to Fix Error:(59, 8) error: cannot access ActivityCompatApi23 class file for android.support.v4.app.ActivityCompatApi23 not found

 

For me, this was an uncommon error that occurred in the gradle settings of my new image search application, I believe this is some kind of version conflict error inside the gradle libraries.

My project would not compile, it showed random errors, this has been such a headache to me that I spend days searching for a solution, and finally found this solution.

 

How to apply this solution?

 

In your Build:gradle (module:app), just enter the code like the screenshot below

 

Code to fix cannot access ActivityCompatApi23 in Android Studio

configurations.all {
    resolutionStrategy.eachDependency { DependencyResolveDetails details ->
        def requested = details.requested
        if (requested.group == 'com.android.support') {
            if (!requested.name.startsWith("multidex")) {
                details.useVersion '25.3.0'
            }
        }
    }
}

 

Screenshot

 

Related Posts

person using macbook pro on person s lap

Fix android.content.Intent.migrateExtraStreamToClipData(android.content.Context)’ on a null object reference

Here is how to Fix Android Studio Error Attempt to invoke virtual method ‘boolean android.content.Intent.migrateExtraStreamToClipData(android.content.Context)’ on a null object reference This error is caused by a number…

Android Spinner onItemSelected Listener Example

Spinner is an android UI element; it provides a drop-down List where you can choose an item from the list. You will need a listener to catch…

person in gray shirt holding a small paper with texts

Get Current Month Name in Java Android

The code below can be used to get the name of current month, for example, January, February, March etc. Just call this method and it will return…

The future of android developers is not good

Are you an android developer or looking to be an android developer? You should read this Myself is zid, I’m an android developer and been in this…

How to Auto Scroll RecyclerView Android Java

If you want to scroll your recyclerview automatically, you can use the below code. Just add this code after setting your recyclerview adapter

Download Android Earning App Source Code

Android Earning App Source Code Download for Android studio 2023 This is cashJungle earning app developed by us. It has amazing jungle theme as its name suggests….

This Post Has 2 Comments

  1. Super cool, it looks like this will work for me!

    I have to support very big and pretty old project which works correctly only with old version of support libraries (25.3.1). I had to use old version of android gradle plugin (2.3.3 !) because compilation breaks with this ActivityCompatApi23 error when you use more recent versions of gradle plugin with old version of support libraries. I think android gradle plugin 3.x.x just not compartible with old versions of support libraries althought I wasn’t able to find any information about it.

    That makes me crazy because recent android studio version has lots of annoying compatibility issues with old android gradle plugins. Hope it will work and I will able to switch to the recent version of android gradle plugin.

    How did you find this solution?
    What it actually does and why it works?
    Do you have more info about this problem or any other refrence?

    1. Hi Dzmitry,
      I found this solution from stackoverflow

      I think this code tells the gradle to ignore version conflicts in the support libraries, i hope it works for you

Leave a Reply

Your email address will not be published. Required fields are marked *