Comments (8)
I saw this message by a co worker. We could not explain why. There is a known issue but it didn't match. #4
Just close and reopen Android Studio helped.
from android-gradle-template.
We found closing and re-opening worked sometimes, but not others. Deleting the .idea folder and iml files and re-importing the project worked consistently, but is a pain to do.
from android-gradle-template.
EDIT: This is not correct
I think I figured out what it is. The first (ExampleProject below) element in the .idea/workspace.xml
file is causing the problem:
<ExternalProjectPojo>
<option name="name" value="ExampleProject" />
<option name="path" value="$PROJECT_DIR$" />
</ExternalProjectPojo>
<ExternalProjectPojo>
<option name="name" value=":App" />
<option name="path" value="$PROJECT_DIR$/App" />
</ExternalProjectPojo>
<ExternalProjectPojo>
<option name="name" value=":AppComponentTests" />
<option name="path" value="$PROJECT_DIR$/AppComponentTests" />
</ExternalProjectPojo>
<ExternalProjectPojo>
<option name="name" value=":AppUnitTests" />
<option name="path" value="$PROJECT_DIR$/AppUnitTests" />
</ExternalProjectPojo>
I think this is a new value that was added in the update which makes the root folder a project in the build (I don't recall seeing this before). For some reason opening the build.gradle file re-orders this to be the first in that list, but that causes the error. Moving the <ExternalProjectPojo>
element with the $PROJECT_DIR$
path to the last one in the list fixed the issue.
Why this is happening I can't say. Is this something the scripts could be updated to do automatically? I guess ultimately it would be good to understand why it causes the problem in the first place.
from android-gradle-template.
Thanks for figure it out. I'm faced this issue too.
Yes it should be possible to edit this file automatically like it done for the robolectric support.
I'm thinking about to switch the basic plugin which enable robolectric tests. I got not much feedback from Novoda. And another plugin looks to be on a state where all stuff is supported which i like to have. Except the one thing, that i like to spilt two test kinds (unit tests and integration tests with robolectric).
So the https://github.com/JCAndKSolutions/android-unit-test/ plugin can not have the reported issues because it have all stuff in one module.
Maybe we should report this issue to google. This miss behaviour could occur when you have pur java library modules in your project.
from android-gradle-template.
I'm not sure if this the real problem, after restart my Android Studio my Project works fine. In the workspace.xml is still a "wrong" order.
from android-gradle-template.
again this error .. i reordered the workspace.xml entries and i still get this message. maybe I did something wrong.
This log line shows the wrong order
Information:Gradle: Executing tasks: [:AppComponentTests:assemble, :AppComponentTests:testClasses, :App:assembleDebug]
It should be like
Information:Gradle: Executing tasks: [:App:assembleDebug, :AppComponentTests:assemble, :AppComponentTests:testClasses]
sometimes it works fine with the workspace.xml order and sometimes this error occur. changing the workspace.xml looks not stable and force project reloads. Maybe this behaviour can reproduced with a simple app which use a pure java module as dependency. Then it should be a general bug at Android Studio and they should fix it ;)
from android-gradle-template.
I believe you are correct that does not work. It was just a coincidence that it started working on our development machines after making that change I think.
I believe it is a bug with Android Studio messing around with the build order like you say.
from android-gradle-template.
This behaviour comes only at Android Studio, i never saw it on command line. Looks like the error comes from the make commando. I removed the make commando its not necessary because we recompile tests with a custom gradle command. Its enough and should avoid this issue.
from android-gradle-template.
Related Issues (20)
- Project Structure Question HOT 1
- A problem occurred evaluating project ':ComponentTestsRobolectric' HOT 6
- When using this template, I've faced some problems HOT 3
- jacoco with espresso, task jacocoTestReport skipped HOT 6
- Error Illegal use of non virtual function call HOT 4
- Maybe switch to JCAndKSolutions/android-unit-test
- Illegal use of nonvirtual function call HOT 2
- Collect code coverage during manual testing? HOT 2
- Update to latest version of Espresso and Mockito? HOT 3
- Voting: Which is your favourite way to support robolectric? HOT 5
- Can not compile success in the environment Android Studio1.0+ gradle2.2.1+build gradle1.0 HOT 3
- Unexpected top-level exception when running app HOT 2
- Could not find com.novoda:gradle-android-test-plugin:0.10.3. HOT 3
- run-tests.sh needs a simple fix HOT 1
- Android Studio 1.4 Java modules cannot depend on Android modules HOT 2
- FileNotFound Exception HOT 8
- Running / debugging Unit or Component tests in Android Studio HOT 3
- Unable to import project HOT 5
- oops
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from android-gradle-template.