16

Screenshot

I wish if some one can help me in android studio problem?

I just came up while i was working on my application I have no idea whatsoever since i tried all possible solution that can resolve the issues.

Any help will be much appreciated.

3
  • You need to fix all those red highlighted errors first. Then the X mark in 'app' button will disappear. Check if there any missing libraries in gradle dependency.
    – Amad Yus
    Aug 29, 2016 at 2:15
  • Hi Alex , the problem is none of my imports are working as u can see there is an Red cross Mark in the application button when I try to run the application . I tried to check everything available in internet but its not working , kindly let me know if you have any idea for the same as I running in a tight schedule and I have to finish this ASAP Aug 29, 2016 at 2:17
  • #Amad thanks for your reply , this is not any imported project , I am working on this since 4 weeks now , it was completely fine till 3 hrs ago till I restarted my computer , that red X mark is there since then, its something really silly mistake that I am skipping I think !! Aug 29, 2016 at 2:47

14 Answers 14

28

The red X is there saying you cannot build/run your project because it had an error while indexing your application. Sometimes that error occurs when you open a project. All it needs to do is index your code again. A couple things you can do to fix this:

  1. Go into your gradle file, delete something, and type it back. It will ask you to "Refresh" your project.
  2. You may try Cleaning and Rebuilding your project.
  3. Go to File->Invalidate Caches/Restart... and then click Invalidate and Restart.
  4. Basically, reloading your code should fix this problem. If you can find another way to refresh your project and the above did not work, try that way as well.
2
  • 2
    Thanks for your prompt response its been 5 hrs I am trying to fix it , its resolved after invalidate cache and Restart. Chhheeeeeers !!! Aug 29, 2016 at 3:56
  • Great to hear you got it fixed Aug 29, 2016 at 15:08
11

None of the above solutions worked for me. This does the magic!

File > Sync Project with Gradle Files

0
10

I'm having this error so often, and I find myself coming to this page again and again. Let me just collect the different answers that worked for me.

Solution 1: Combines the ones that @TheAnonymous010 and @Farwa proposed

1.- File > Sync project with Gradle Files

2.- Build > Clean Project, Build > Rebuild Project

Solution 2: Recreating Gradle folder

1.- File > Close Project

2.- You will see a small Android Studio window with a list of projects on the left, click on the "X" mark next to your current project (the one you're working on)

2b.- If you don't see an "X" mark next to the project name, you can right-click and select "Remove from project list"

3.- Now choose "Open an existing Android Studio Project" and re-open it from zero. After the "Indexing..." phase, you'll probably get your app module back to work

Solution 3: File > Invalidate caches and restart > Invalidate and Restart

Solution 4: Select a debug variant, sometimes I had this error because of selecting a release build variant, which has no signature (taken from here)

2

FIRST check you are trying to run the correct Build Variant. When I have this problem, it is usually because I am trying to run a release (signed) variant rather than debug.

**enter image description here**

2

Delete caches folder from C:\Users\user Name\.AndroidStudio(version)\system worked for me.

1

Problem is there is confliction of Jre, Go to(File -> Project Structure -> SDK Location), just ticked 'Use embedded JDK'(recommended) checkbox and set JDK location to 'path to the android studio'\Android Studio\jre

1

Its very simple. sometimes when you open your project then this error occur. just write some thing in gradle and remove it then sync it. the error will be gone

1

Steps:

  1. Open File in Android Studio and click on invalidate.

  2. Open File and click on "close project".

  3. One window with headline "welcome to Android studio" will open.

  4. Remove the project from the opened window (probably listed on top), by clicking on "X" mark.

  5. Close the window with headline "welcome to Android Studio".

  6. Open Android Studio, and select the option to "Open and existing android Studio project".

1

If it doesn't work with the previous answers, try this:

Sync project with Gradle Files

0

Restarting Android Studio did the trick for me

0

In Build.gradle file add

compileSdkVersion 23 similar as dependencies

dependencies {
    compile fileTree(dir: 'libs', include: ['*.jar'])
    testCompile 'junit:junit:4.12'
    compile 'com.android.support:appcompat-v7:23.0.0'
    compile 'com.android.support:design:23.0.0'
}

Bulid -> Clean project after that rebuilding project

Left-hand side builds Variants click then select project name next column select debug.

0

Shut Down Project. Now, Go to File-> New -> Import Project Select Project

It work for me, hope it will help others.

0
0

Click on the app option. Then click on edit configuration

enter image description here

Now at the bottom Error is shown. Resolve the error as per the requirement

enter image description here

0

updating android studio works for me.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.