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 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 ( == '') {
            if (!"multidex")) {
                details.useVersion '25.3.0'




Related Posts

Add Admob ads in recyclerview in android

How to add admob native ads to recyclerview in android java Adding admob native ads into android recyclerview isn’t easy like other admob ads. You will need…

Download WebView Flutter Source Code for Android and iOS

Easily create android and iOS WebView app for your websites, the much-awaited flutter WebView source code is here. Are you looking for a flutter WebView source code…

Fix uses-sdk:minSdkVersion 16 cannot be smaller than version 19 declared in library [:_flutter_android]

This error can be fixed by modifying build.gradle file in the flutter In android studio: go to android>app>build.gradle and modify it as follows:

Get Your Own Android Mobile App for Your Website Today

Are you looking to expand your online presence and reach more customers? In today’s digital age, having a mobile app is an essential tool to connect with…

Why making an app for your website can help your business to grow

In today’s digital age, it’s more important than ever to have a strong online presence. Whether you’re running a business, a blog, or a personal website, having…

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…

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 *