Friday 25 September 2020

Android Studio 4.0.1 Cannot access androidx.appcompat.app.AppCompatActivity

Didn't happen before until I deep cleaned a few days ago (some combination of the following)

  • rm -rf ~/.gradle
  • rm -rf {projectRoot}/.gradle
  • git clean -fdx )

Suspect: appcompat version conflicts

build.gradle:
(there is a lot of redundancy for sure but I feel I'm close )

configurations.compile { transitive = false }
configurations.all {
    resolutionStrategy {
        // fail eagerly on version conflict (includes transitive dependencies)
        // e.g. multiple different versions of the same dependency (group and name are equal)
        failOnVersionConflict()

        // prefer modules that are part of this build (multi-project or composite build) over external modules
        preferProjectModules()

        // force certain versions of dependencies (including transitive)
        //  *append new forced modules:
        force "appcompat:appcompat:${deps.appcompat_version}"
        //  *replace existing forced modules with new ones:
        forcedModules = ["appcompat:appcompat:${deps.appcompat_version}"]
    }
}
//...
dependencies {
    implementation(deps.support.v7) // appcompat 1.2.0
    implementation(deps.google.oss) {
        exclude module: "appcompat"
    }
    implementation(deps.facebook.sdk) {
        exclude module: "appcompat"
    }
    implementation(deps.thirdparty.line_height_edit_text) {
        exclude module: "appcompat"
    }
    implementation(deps.thirdparty.lottie) {
        exclude module: "appcompat"
    }
    androidTestImplementation(deps.test.espresso_core) {
        exclude module: "support-annotations"
        exclude module: "appcompat"
    }
    androidTestImplementation(deps.test.espresso_contrib) {
        exclude module: "support-annotations"
        exclude module: "support-v4"
        exclude module: "design"
        exclude module: "recyclerview-v7"
        exclude module: "support-v4"
        exclude module: "appcompat"
    }
}

What am I still missing?

./gradlew app:dependencies | grep appcompat outputs:

|    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
+--- androidx.appcompat:appcompat:1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
|    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    |    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
|    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    |    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
|    |    +--- androidx.appcompat:appcompat:1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
|    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    |    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (n)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
|    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    |    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
|    |    +--- androidx.appcompat:appcompat:1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
|    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    |    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    \--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
|    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0
|    +--- androidx.appcompat:appcompat-resources:1.2.0
|    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:{strictly 1.2.0} -> 1.2.0 (c)
+--- androidx.appcompat:appcompat-resources:{strictly 1.2.0} -> 1.2.0 (c)
|    |    +--- androidx.appcompat:appcompat:1.2.0
|    |    |    +--- androidx.appcompat:appcompat-resources:1.2.0
|    |    |    +--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
|    |    |    \--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.0.0 -> 1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    +--- androidx.appcompat:appcompat:1.2.0 (*)
|    |    |         |    \--- androidx.appcompat:appcompat:1.1.0 -> 1.2.0 (*)
+--- androidx.appcompat:appcompat:1.2.0 (*)

I'm assuming I don't have to worry about the line that ends with (*) cos it means "ignored"

It's not happening on Android Studio 4.2 or Intellij 2020.2.

gradle.properties:

org.gradle.daemon=true
org.gradle.configureondemand=true
org.gradle.caching=true
org.gradle.parallel=true
org.gradle.jvmargs=-Xmx5120M
android.useAndroidX=true
android.enableJetifier=true
android.enableUnitTestBinaryResources=true
android.enableR8=false


from Android Studio 4.0.1 Cannot access androidx.appcompat.app.AppCompatActivity

No comments:

Post a Comment