Persistent problem in Android studio: Can not resolve symbol 'ActivityCompat' 'Crashlytics' 'Fabric'

1

I have a serious problem which does not let me continue with my project, it turns out that last week I compile my latest version (1.1.6) for the moments of my project, I launched it and everything goes well with the devices, fabric and firebase go wonderingly inform me, stop opening the project on android for 4 days after the release of the version, and today I reopen it for good, improve some things has given me the surprise android studio that marks me:

Cannot resolve symbol 'ActivityCompat'
Cannot resolve symbol 'Crashlytics'
Cannot resolve symbol 'Fabric'

Try 'Invalidate cache & subtract 'It did not solve. Probe with 'Clean projec' also with 'Rebuild' and still can not resolve, try to compile my project in the emulator and I do not throw any errors, I compiled it again on my Android via USB and I did not give an error, however on Android studio persists marking that the symbol can not be solved ...

This is the build.gradle (app) file

    apply plugin: 'com.android.application'
apply plugin: 'io.fabric'

repositories {
    maven {
        url 'https://maven.fabric.io/public'
    }
}
android {
    compileSdkVersion 26
    defaultConfig {
        applicationId "android.cinemovil.xploit"
        minSdkVersion 19
        targetSdkVersion 21
        versionCode 1
        versionName "1.1.6"
    }
    buildTypes {
        release {
            minifyEnabled false
            proguardFiles getDefaultProguardFile('proguard-android.txt'), 'proguard-rules.pro'
        }
    }
    productFlavors {
    }
    lintOptions {
        checkReleaseBuilds false
        abortOnError false
    }
    buildToolsVersion '27.0.3'
}

dependencies {
    implementation 'com.android.support:appcompat-v7:26.1.0'
    implementation 'com.android.support:design:26.1.0'
    implementation files('libs/jackson-core-2.1.1.jar')
    implementation fileTree(include: ['*.jar'], dir: 'libs')
    implementation 'com.android.support:cardview-v7:26.1.0'
    implementation 'com.google.firebase:firebase-core:16.0.0'
    implementation 'com.google.firebase:firebase-crash:16.0.0'
    implementation 'com.google.android.gms:play-services-ads:15.0.1'
    implementation('com.crashlytics.sdk.android:crashlytics:2.9.3@aar') {
        transitive = true
    }

    implementation 'com.google.firebase:firebase-ads:15.0.1'
}

apply plugin: 'com.google.gms.google-services'

And this is the other build.gradle

buildscript {

    repositories {
        google()
        jcenter()
        mavenCentral()
        maven { url 'https://maven.fabric.io/public' }

    }
    dependencies {
        classpath 'com.android.tools.build:gradle:3.1.2'
        // NOTE: Do not place your application dependencies here; they belong
        // in the individual module build.gradle files
        classpath 'com.google.gms:google-services:4.0.1'
        classpath 'io.fabric.tools:gradle:1.+'
    }
}

allprojects {
    repositories {
        //google()
        //maven { url 'https://maven.fabric.io/public' }
        maven { url "https://maven.google.com" }
        jcenter()
    }
}

task clean(type: Delete) {
    delete rootProject.buildDir
}
    
asked by Luis Rivas 01.06.2018 в 19:34
source

1 answer

1

Apparently I solved the problem by removing the .idea

folder

Try this method:

  
  • Delete the .idea folder
  •   
  • Close and reopen the project.
  •   
  • File - > Synchronize project with Gradle files.
  •   

    who commented on SO in English:

    link

    I opened the project again, synchronize the project with the files gradle and the error disappeared in Android Studio .

        
    answered by 01.06.2018 / 20:12
    source