Solved: error: package does not exist / appcompatactivity not resolved

If you have ever seen an error like below, we have fixed this and got it resolved. The error and solution is like as below.

Compilation Error

error: package does not exist

Or an error like

appcompatactivity not resolved


Modify top level build.gradle file to add following lines:

NOTE: Make sure you are using same version for “appcompact” as that of “compileSdkVersion” . e.g. here we had compileSdkVersion as 27, hence appcompact version is 27.0.2

apply plugin: ''

android {
    compileSdkVersion 27
dependencies {
    implementation ''

Leave a Comment