I tried but always get error of junit. I have to remove the junit test compile from the build.gradle Let me make it more clear . I want to run the project offline fully.I have the latest Android Studio 2.0 and SDk fully updated now I want to make projects offline. I don't have net access. I want to work offline and make projects offfline.No net to connect once at the start also.
Asked
Active
Viewed 1,993 times
-1
-
it shouldn't matter as long as its not the first run – Sarah Maher Apr 19 '16 at 09:42
-
Can you please define what you are asking? This is unclear. Can you post the unit test and the affected code and what the exact problem is? – Draken Apr 19 '16 at 09:48
-
Its the first run. – Bhaskar Saikia Apr 19 '16 at 10:28
-
Let me make it more clear . I want to run the project offline fully.I have the latest Android Studio 2.0 and SDk fully updated now I want to make projects offline. I don't have net access. I want to work offline and make projects offfline. – Bhaskar Saikia Apr 19 '16 at 10:34
2 Answers
2
You have to have JUnit cached locally to be able to use it in offline mode. Run the tests at least once while being online, so that Gradle is able to cache the artefact.

Egor
- 39,695
- 10
- 113
- 130
-
Sorry I was editing the comment but not able to do.Actually I want to do it offline way I have no internet connection in home so and also in office proxy is there. How to do without internet connection the sync – Bhaskar Saikia Apr 19 '16 at 10:51
2
Please click on app folder in android studio and right clck then
- Open Module Setting
- goto dependencies
- remove junit
- rebuild. done!..

wonders of nature
- 83
- 10
-
It solved the error , but is it the right way to do offline . By removing the dependency? PLease explain. – Bhaskar Saikia Apr 19 '16 at 10:40
-
Sorry but now its giving error in exampleUnitTest.java as org.junit not found – Bhaskar Saikia Apr 19 '16 at 10:43
-