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.
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.
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:
None of the above solutions worked for me. This does the magic!
File > Sync Project with Gradle Files
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)
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.
Delete caches
folder from C:\Users\user Name\.AndroidStudio(version)\system
worked for me.
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
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
Steps:
Open File in Android Studio and click on invalidate.
Open File and click on "close project".
One window with headline "welcome to Android studio" will open.
Remove the project from the opened window (probably listed on top), by clicking on "X" mark.
Close the window with headline "welcome to Android Studio".
Open Android Studio, and select the option to "Open and existing android Studio project".
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.
Shut Down Project. Now, Go to File-> New -> Import Project Select Project
It work for me, hope it will help others.
Click on the app option. Then click on edit configuration
Now at the bottom Error is shown. Resolve the error as per the requirement