2

I have been working on a project lately. Yesterday my laptop shut down all of a sudden and I didn't bothered to start it again.

Today when I started the project, I saw that after my gradle build, I have my MainActivity full of errors. Wonder what's wrong! When I try to debug and run the project it runs fine. Everything from import to all the System.out.println has error in it.

When I try to print out something on EditText listner and then run the project. the project works fine.

Additionally there was a file called maniac~2.jav that was auto-created with the same content as that of MainActivity.

Need help in this Thanks in advance

Here's the screenshot of the error enter image description here

EDIT My gradle console messages on building the project

BUILD SUCCESSFUL Total time: 8.325 secs Executing tasks: [clean, :app:generateDebugSources, :app:generateDebugAndroidTestSources, :app:compileDebugSources, :app:compileDebugAndroidTestSources] Configuration on demand is an incubating feature. :clean UP-TO-DATE :app:clean :app:preBuild UP-TO-DATE :app:preDebugBuild UP-TO-DATE :app:checkDebugManifest :app:preReleaseBuild UP-TO-DATE :app:prepareComAndroidSupportAppcompatV72310Library :app:prepareComAndroidSupportSupportV42310Library :app:prepareDebugDependencies :app:compileDebugAidl :app:compileDebugRenderscript :app:generateDebugBuildConfig :app:generateDebugAssets UP-TO-DATE :app:mergeDebugAssets :app:generateDebugResValues UP-TO-DATE :app:generateDebugResources :app:mergeDebugResources :app:processDebugManifest :app:processDebugResources :app:generateDebugSources :app:preDebugAndroidTestBuild UP-TO-DATE :app:prepareDebugAndroidTestDependencies :app:compileDebugAndroidTestAidl :app:processDebugAndroidTestManifest :app:compileDebugAndroidTestRenderscript :app:generateDebugAndroidTestBuildConfig :app:generateDebugAndroidTestAssets UP-TO-DATE :app:mergeDebugAndroidTestAssets :app:generateDebugAndroidTestResValues UP-TO-DATE :app:generateDebugAndroidTestResources :app:mergeDebugAndroidTestResources :app:processDebugAndroidTestResources :app:generateDebugAndroidTestSources :app:processDebugJavaRes UP-TO-DATE :app:compileDebugJavaWithJavac :app:compileDebugNdk UP-TO-DATE :app:compileDebugSources :app:processDebugAndroidTestJavaRes UP-TO-DATE :app:compileDebugAndroidTestJavaWithJavac :app:compileDebugAndroidTestNdk UP-TO-DATE :app:compileDebugAndroidTestSources BUILD SUCCESSFUL Total time: 10.903 secs 
4
  • What's the exact error ? Have you tried Build -> Rebuild Project ? You can see error messages in the EventLog tab in bottom right. Commented Mar 5, 2016 at 4:37
  • Well I tired that, I cleaned and also rebuild my project. But the error stays. And as I said, I just checked running and debugging the project. Surprisingly it runs even after so many errors. Commented Mar 5, 2016 at 4:40
  • It would help if you share the error messages from "Messages" or "EventLog" tab. Commented Mar 5, 2016 at 4:44
  • @SlowAndSteady check the edit section, I have updated the messages on build, event log too just says executing tasks and gradle build finished Commented Mar 5, 2016 at 4:50

1 Answer 1

4

You can try a few workarounds to overcome this issue :

1- Choose File --> Invalidate Cache and Restart

2- Change the compileSdkVersion in your build.gradle file, to a different version and Choose Build Project.

3- Change the buildTools version of the project and try to rebuild the project.

4- Delete the outputs and temp folders in the app/build and rebuild the project.

Sign up to request clarification or add additional context in comments.

2 Comments

Okay, So tried the first 3 points. The first one worked for me. Now my project is without any errors. Thanks!
Glad I could help.😊

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.