Comments (5)
Looks like there are issues with the styling. Did you add the shadow-v4 dependencies?
from androidstudioandrobolectric.
Indeed the problem is the missing styling. I have a multimodule project setup, where all my business logic (activities, fragments) and presentation layer components (style, resources) are in a android library ('core' in your example), and a very thin app module for configuration of the core library.
In the app module i didn't have a styles.xml
, in the app modules AndroidManifest.xml
I set the style to a style defined in the core library.
When i am now adding an Activity and a layout to the app module without defining a style in the app module, the tests don't run. This causes the StringIndexOutOfBoundsException
.
When I am adding a styles.xml
in the app module and set the parent of the style to style defined in the core library the tests are not running. There is an "endless loop" (waited 5 minutes) while trying to run the task testDebug
, it doesnt finish.
Edit: After 7 min i got following exception: java.lang.OutOfMemoryError: Java heap space
After adding a styles.xml
to the app module and changing the style in the apps AndrodiManifest.xml
to the app modules style the test works.
But this is not the way i want to solve the problem, because the app should use the style defined in the core library module. Is this possible?
from androidstudioandrobolectric.
I can't reproduce it. I deleted the style.xml
from the app module and did a ./gradlew clean app:test
and the tests run like expected. Best would be if your fork this project and show me how you have setup your styles to get this issue.
from androidstudioandrobolectric.
I forked the project but cannot reproduce it for now, too. Maybe I have to add more and more "features" from my real project.The main difference i think is using the v4-support library.
from androidstudioandrobolectric.
Perhaps same issue like robolectric/robolectric#1736 ?
from androidstudioandrobolectric.
Related Issues (20)
- NoClassDefFoundError: android/content/Context HOT 1
- AnnotationFormatError: Invalid default: public abstract java.lang.Class org.robolectric.annotation.Config.application()
- Test is stuck at :app:testDebug HOT 1
- Can't run Roboletric on windows: java.lang.NoSuchMethodException: android.os.Looper.<init>(boolean) HOT 2
- @Config and @RobolectricTestRunner not recognised HOT 2
- Not An Issue HOT 1
- No issue - line #-1 (sorry, not yet implemented): Error inflating class <unknown> HOT 11
- Running test in core fails with "values is not a directory" HOT 6
- Resources not found exception when applicationId is altered HOT 1
- Fails with org.robolectric:robolectric:3.0-rc3 HOT 5
- Your work around is not working with apply plugin: 'com.android.library' HOT 18
- NoClassDefFoundError OnApplyWindowInsetsListener
- No Copyright/License Information HOT 1
- Gradle DSL method not found: 'execute()'. Any solution?
- Test resources not found from unit test
- Package R does not exist HOT 2
- Not compileing main source when compile unit test sources HOT 5
- BuildConfig is not by default generated for all build types
- NoClassDefFoundError: android/R
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 androidstudioandrobolectric.