0

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.

Zoe
  • 27,060
  • 21
  • 118
  • 148
Android teem
  • 780
  • 2
  • 13
  • 36
  • What it says when you hover the mouse on these errors? – Pankaj Kumar Jun 06 '18 at 07:08
  • it says nothing , I did alt+enter but still it is not working – Android teem Jun 06 '18 at 07:09
  • Did you manage to solve the problem? – Suleyman Jun 06 '18 at 07:37
  • no it did not worked @LieForBananas\ – Android teem Jun 06 '18 at 08:00
  • Delete the project completely from the Android directory, after that open Android Studio, in `File` select `New` and `Import` then find your project and double-click on the `build.gradle` file. It should resolve the error. It may say that the project is already imported or somethinf like that. Then just click `Open` and double-click on `build.gradle` file. But make sure to delete the project first. – Suleyman Jun 06 '18 at 08:05
  • I did not get you. I need to delete the project from my Harddisk? from file system ? @LieForBananas – Android teem Jun 06 '18 at 08:13
  • No just delete it from the location where it previously was. So that you can reimport it. You can temporarily copy it to your desktop or anywhere else – Suleyman Jun 06 '18 at 08:16
  • ok let me try this , so after deleting and re-importing. what should I do next ? – Android teem Jun 06 '18 at 08:21
  • When you delete and reimport (and when reimporting make sure to open the directory with your project and double-click on the `buils.gradle` file) it should build normally and you should have no errors. – Suleyman Jun 06 '18 at 08:36

3 Answers3

1

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.

Manish Karena
  • 724
  • 6
  • 29
  • @Android teem If you have resolved the issue from my answer then please make it as accepted, So it will be helpful for the future visitors. – Manish Karena Jun 06 '18 at 07:31
  • no , I just wanted to know by cleaning and rebuilding project, android studio deletes the same thing from the respective folders. – Android teem Jun 06 '18 at 07:32
0

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.....

A.s.ALI
  • 1,992
  • 3
  • 22
  • 54
-1

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

钟智强
  • 459
  • 6
  • 17