1

today AndroidStudio started acting up, not being able to resolve android.support.vx symbols anymore.

What I did shortly before: trying to clean up my C drive, and erroneously deleting the .android folder, as well as moving my SDK folder.

Issues are had with

import android.support.v4.content.LocalBroadcastManager;
import android.support.v7.app.AlertDialog;
import android.support.v4.app.Fragment;
import android.support.v7.widget.RecyclerView;

the relevant part in gradle:

android {
    compileSdkVersion 25
    buildToolsVersion '26.0.0'
    defaultConfig {
        applicationId "not.for.public.eyes"
        minSdkVersion 23
        targetSdkVersion 25
        versionCode 1
        versionName "0.0.21"
        //versionNameSuffix '-TEST'
        testInstrumentationRunner "android.support.test.runner.AndroidJUnitRunner"
        multiDexEnabled true
        /*jackOptions {
            enabled true
        }*/
    }

compileOptions {
        sourceCompatibility JavaVersion.VERSION_1_7
        targetCompatibility JavaVersion.VERSION_1_7
    }

dependencies {
    compile fileTree(include: ['*.jar'], dir: 'libs')
    //    androidTestCompile('com.android.support.test.espresso:espresso-core:2.2.2', {
    //        exclude group: 'com.android.support', module: 'support-annotations'
    //    })
    compile files('src/main/libs/eidlib.jar')

    compile 'com.android.support:appcompat-v7:25.3.1'

What I have tried to resolve the issue:

  1. clean gradle build
  2. reinstall android studio
  3. invalidate caches

it worked without issue untill just before, but now it shows red always. Weird thing though: build still works, run on connected device still works.

all help appreciated

ShadowFlame
  • 2,996
  • 5
  • 26
  • 40

2 Answers2

2

thanks to this post, I found the solution.

  1. clean build(Build menu)
  2. invalidate cache(no restart) (File Menu)
  3. remove .gradle and .idea folders (View Menu > Tool Windows > Project >> Project pane, somewhere at the top probably)
  4. restart Android Studio

Possibly you can finetune this, but this is what worked for me.

ShadowFlame
  • 2,996
  • 5
  • 26
  • 40
  • Thank you so much! My android studio has been stuck for the past 4 hours, with it being unable to build, and not even cleaning, invalidating and restarting fixed the problem. After deleting the two folder the project build successfully again. I though I was going crazy :P – Lucas P. Oct 15 '19 at 10:06
  • none of that helps. – johnrubythecat Feb 24 '22 at 19:12
0

Invalidate cache and restart didn't work for me. removing and adding dependencies worked for me. 1: Removing all dependencies from app/build.gradle and Sync. 2: Add all again and Sync.