Errors in the IDE, but project running successfully

962 views Asked by At

I have an Android project that I got from the SVN, as I did get latest the whole code showing errors but When I run the app, it successfully run on device with no error.

Following is the screenshot of my activity and errors

Errors in code

These error are showing since I got latest from svn.

What I tried So far:

I tried cleaning, rebuilding and re-syncing with gradle even I did restarting Android studio and my system many times but none of them is working.

I have seen in my dependency and the dependency is added as expected

implementation 'com.android.support:appcompat-v7:27.1.1'

But still there are such errors in the application.

My guess was that there is error because the project has 2 different module and on each module level dependency there is gradle file and each of them having this dependency.The version of dependency is even same. I tried removing from one and ran gradle but I have same result in the end.

Do not know why it is showing, even that it is not LINT error. Or may be that is LINT error or warning but at least they should get resolved.

3

There are 3 answers

2
Manish Karena On

I;ve got the same error a month ago when i was trying to run a demo from the github i've resolved it with given below steps, So i think it might be helpful to you.

Steps:

  1. From the file Explorer go to the Project-Directory -> app -> build and remove this build folder.
  2. In the Android-Studio Clean/Rebuild the project and it's resoled.

In your case you might be need to delete the build folder from both the module that you have in your project.

1
A.s.ALI On

I think this is a problem of android studio and Svn tools. I have the same issue. And I tried all that you and other have described here. It looks more like hit and trial method on some systems so basically one method fits to one person. So its on luck.

I faced the same problem and faced by doing these.

  1. Invalidated cache and restarted android studio // And I did this by opening another project not the affected one
  2. Closed Android studio // I dont know Why i first invalidated or restarted android studio at first place but What I did and what worked for me I am explaining here
  3. Deleted whole project.
  4. Checkout project using TortoiseSVN
  5. After getting project, I have deleted its build folder.
  6. Launched my Android studio and Imported project that I wanted to do
  7. It build successfully without any error.

NOTE: That may not be direct and good answer but What helped me I have described here. May be it work for you. Just give it a try.....

0
Jabar Shahid On

First close the project. then delete .idea , .gradle files from project. Then reopen the project.