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

How to Export Project Zip from Android Studio

How to Export Source Code ZIP in Android Studio Sometimes, you will need export the source code of your android studio app project, to share it with…

Fix Plugin [id: ‘com.android.application’, version: ‘7.1.3’, apply: false] was not found in any of the following sources

Here is how to fix Plugin [id: ‘com.android.application’, version: ‘7.1.3’, apply: false] was not found in any of the following sources This error is caused by mismatching…

Get Age from Date of Birth in Java Android

Here is how to get a user’s age from date of birth If you need get a user’s age from a given date of birth string, this…

How to Check if String Array Contains a Specific String in Android

Here is how to get a specific value or String from Array in Android To check if a string array contains a specific string, you can use…

Make Android WebView Support Razorpay Payment

How to Support Razorpay Payment and UPI in Android WebView? Android webview is inexpensive and easy way to make apps for websites. But to support some specific…

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 to admin Cancel reply

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