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
NPE Using AlarmManager in v3.1.2 #2669
Comments
I get the same NPE when testing code that calls I don't really know how Robolectric works but I note that if I change the code to call alarmManager.set() or setAndAllowWhileIdle() instead (which are implemented) it does not throw the NPE. |
Yes, it is missing the shadow for this relatively new method that was added You can just add a the implementation similar to all the other set*() Want to send a PR with a test? On 14 November 2016 at 15:12, anitawoodruff notifications@github.com
|
Sure, I'll give it a go! |
You can check the project out from github, it builds with Gradle now, https://github.com/robolectric/robolectric On 14 November 2016 at 15:42, anitawoodruff notifications@github.com
|
I've checked it out and installed dependencies but not sure how to run the right tests, without running all of them.. I tried (the instructions to run Robolectric's tests with maven at http://robolectric.org/contributing/ are out of date, right?) |
Ya, they're out of date, I've created the following tracker entry to fix You should be able to just run ./gradlew test to run all tests, not sure You can also just run a single test from within IntelliJ / Android Studio On 15 November 2016 at 01:45, anitawoodruff notifications@github.com
|
I tried to import the project into Android Studio, but I'm having issues:
For the record I found out how to run a single test class from command line - you have to specify the submodule too:
But it would be nice to be able to edit and run the tests using Android Studio if I can get it configured correctly! Any help appreciated. (Edit: simplified the test command.) |
Are you importing the gradle project? robolectric/build.gradle - this works On 15 November 2016 at 14:14, anitawoodruff notifications@github.com
|
Yup, that's exactly what I'm doing (Android Studio > Import Project > select top level build.gradle ) . Not the end of the world though since I can run tests from command line just fine with that command. PR created! |
Add unimplemented AlarmManager methods - fixes #2669
@jongerrish is there any chance of a new release of Robotica happening soon with this fix in? It would be really great to get the Habitica tests passing again! All the recent pull requests have been in the red due to this bug :( Thanks! |
Ya, a new release will be coming shortly. We'll land API 25 support and fix
a couple of remaining side effect issues with the resources refactoring so
end of this week beginning of next hopefully.
…On Dec 6, 2016 12:04 AM, "anitawoodruff" ***@***.***> wrote:
@jongerrish <https://github.com/jongerrish> is there any chance of a new
release of Robotica happening soon with this fix in? It would be really
great to get the Habitica <https://github.com/HabitRPG/habitica-android>
tests passing again! All the recent pull requests
<https://github.com/HabitRPG/habitica-android/pulls> have been in the red
due to this bug :( Thanks!
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub
<#2669 (comment)>,
or mute the thread
<https://github.com/notifications/unsubscribe-auth/AGBaeNJ3y6zn-Fnt6qOe0sUFlxhSD3B1ks5rFRclgaJpZM4KOh9z>
.
|
@anitawoodruff @jongerrish I'm having exactly the same issue importing the project into Android Studio ( |
Description
Getting a NPE while using AlarmManager.
Robolectric & Android Version
Roblectric version 3.1.2
Using android sdk 23 with robolectric, but using 24 to compile.
The text was updated successfully, but these errors were encountered: