-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Method getLocales in android.content.res.Configuration not mocked #4073
Comments
Can you include the Do you have |
This is our test options:
I added |
Adding
|
I'm also seeing this on occasion:
|
We are seeing this issue on our build servers, but not 100%. I am not seeing it locally when run from Android Studio. |
I'm not sure it will help, but I'll mention that I don't see this when running locally either. My team is currently in the process of swapping to a new Jenkins environment, so we are running our CI jobs in 2 places atm. We have only seen this when running our tests inside of a docker container ( https://github.com/thyrlian/AndroidSDK ), inside of an aws instance. For this setup, everything is re-downloaded almost every run. For our other jenkins environment where we haven't seen this yet, we re-use the previously cached maven dependencies, and android sdk. |
We are using Bamboo, which builds from a clean environment each time. |
I'm was facing the same error , I changed my targetSdkVersion from 28 to 27 and my test passed . |
The issue in #4073 (comment) is probably #2346, unrelated. |
@ScottPierce The classloader is loading android.content.res.Configuration.class from the mockable jar that studio is providing on the system classpath. I suspect its falling back on the mockable jar class definition because of some corruption in android-all-9-robolectric-4913185-2.jar What is interesting is that it looks like the jar is being downloaded twice... Downloading: org/robolectric/android-all/9-robolectric-4913185-2/android-all-9-robolectric-4913185-2.jar from repository sonatype at https://oss.sonatype.org/content/groups/public/ So I'm wondering if this is the source of the corruption. The ant/maven code that fetches the dependencies is a source of a pain for a lot of users. Internally we store the jars locally (they very very rarely change). If you'd like to investigate following this option you set -Drobolectric.offline=true -Drobolectric.dependency.dir=/local/path/to/android-jars/ |
@jongerrish I'm considering creating a docker image with all our dependencies cached as a potential solution. Is there a way to ensure all the robolectric dependencies are downloaded without running the tests? I seem to recall that robolectric may download certain things at run time, and not compile time. |
@jongerrish Can you provide more information for how to set this up locally? What files should I download? Just the jar? https://oss.sonatype.org/content/groups/public/org/robolectric/android-all/9-robolectric-4913185-2/ Also, am I able to set the following in my gradle?
I ran the command you suggested locally with a bad path, thinking that it'd fail, but it didn't. |
@xian When will 4.0.3 be released? |
I met the same error on the latest version 4.3 . and I have found a way to work around:set the sdk to 23 by @config(manifest = Config.NONE, sdk = 23). |
|
|
Description
We see this intermittently on our linux Jenkins environment. We're seeing this on roughly 40% of our builds, but the code is private, and it's also pretty massive, so I can't give you a repro of it. I noticed someone else was encountering this as well: #4015
Switching to sdk 28 didn't fix this for us.
Steps to Reproduce
Robolectric & Android Version
Android version 28
Robolectric 4.0.0
The text was updated successfully, but these errors were encountered: