Skip to content
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

Support Busybee in /test in Android modules #9

Closed
yogurtearl opened this issue Jul 1, 2020 · 0 comments · Fixed by #10
Closed

Support Busybee in /test in Android modules #9

yogurtearl opened this issue Jul 1, 2020 · 0 comments · Fixed by #10

Comments

@yogurtearl
Copy link
Member

Currently Busybee in /test in Android modules fails with:

Caused by: java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked. See http://g.co/androidstudio/not-mocked for details.
	at android.os.Looper.getMainLooper(Looper.java)
	at io.americanexpress.busybee.android.internal.AndroidMainThreadExecutor.<init>(AndroidMainThreadExecutor.java:27)
	at io.americanexpress.busybee.android.internal.AndroidMainThreadExecutor.<clinit>(AndroidMainThreadExecutor.java:25)
yogurtearl added a commit that referenced this issue Jul 14, 2020
* We need to test the scenario of Busybee being used in `/test` in an Android module.

Instead of only checking for presence of `android.app.Application`, we try to load up the main looper and make sure it can execute a `Runnable`.
Previously, this failed with:
```
Caused by: java.lang.RuntimeException: Method getMainLooper in android.os.Looper not mocked. See http://g.co/androidstudio/not-mocked for details.
	at android.os.Looper.getMainLooper(Looper.java)
	at io.americanexpress.busybee.android.internal.AndroidMainThreadExecutor.<init>(AndroidMainThreadExecutor.java:27)
	at io.americanexpress.busybee.android.internal.AndroidMainThreadExecutor.<clinit>(AndroidMainThreadExecutor.java:25)
```

* Desugar in AGP 3.5.0 had an issue with our Java 8 code here, so need to upgrade to AGP 4.0.
* AGP 4.0 needs build-tools-29.0.2 and gradle 6
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant