Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cannot resolve symbol 'ViewCompat'

Complete gradle file, and even unable to resolve the symbol 'AppCompatActivity'. Don't understand what's wrong.

Already tried options :: 1) Clean and Rebuild 2) Invalidate/Catches and Restart

apply plugin: 'com.android.application'
apply plugin: 'com.jfrog.bintray'

repositories {
    jcenter()
    maven {
        url "https://jitpack.io"
    }
}

android {
    compileSdkVersion 27
    buildToolsVersion "27.0.3"

    defaultConfig {
        applicationId "com.example.app"
        minSdkVersion 19
        targetSdkVersion 27
        versionCode 1
        versionName "1.0"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
}

dependencies {
    implementation fileTree(dir: 'libs', include: ['*.jar'])
    testImplementation 'junit:junit:4.12'
    implementation 'com.android.support:appcompat-v7:27.1.1'
    implementation 'com.android.support:support-v4:27.1.1'
    implementation 'com.android.support:design:27.1.1'
    implementation project(':blocklylib-core')
    implementation project(':blocklylib-vertical')
}
like image 717
Android Guy Avatar asked Jan 27 '23 19:01

Android Guy


2 Answers

For SDK 27 and higher use import androidx.core.view.ViewCompat;

like image 66
Developer Avatar answered Jan 30 '23 08:01

Developer


Add this in your build.gradle file-

implementation 'com.android.support:support-v13:26.0.2'

Now,
Delete "/.idea/libraries" and then synced with gradle and built again.

like image 45
Ankita Avatar answered Jan 30 '23 08:01

Ankita