Random FileNotFoundException when mocking Android class
Nobody has claimed this yet.
Assessment
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Newbie friendliness
- 25/100
- Issue type
- Bug
- Clarity
- Needs clarification
- Activity status
- Stale
- Tech stack
- java
- Domain
- mobile-dev
Research direction
Start by investigating the NotificationManager mocking path shown in the stack trace, especially DexMaker.generateAndLoad and ProxyBuilder.buildProxyClass, and try to reproduce the permission failure on CI or affected devices. Done means the intermittent FileNotFoundException is understood and the mocking flow no longer fails with EACCES.
Written by the indexing model from the issue text.
Description
Hi I've encountered this few times on CI but I couldn't reproduce this. When I try to mock NotificationManager class I recevice such error (on different devices):
| Caused by: java.io.FileNotFoundException: /data/user/0/com.example.app/app_dxmaker_cache/Generated_1912252465.jar: open failed: EACCES (Permission denied)
-- | --
2022-10-17T15:41:27.230Z | error | TestRunner | at libcore.io.IoBridge.open(IoBridge.java:575)
2022-10-17T15:41:27.230Z | error | TestRunner | at java.io.FileOutputStream.<init>(FileOutputStream.java:236)
2022-10-17T15:41:27.230Z | error | TestRunner | at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
2022-10-17T15:41:27.230Z | error | TestRunner | at com.android.dx.DexMaker.generateAndLoad(DexMaker.java:537)
2022-10-17T15:41:27.230Z | error | TestRunner | at com.android.dx.stock.ProxyBuilder.buildProxyClass(ProxyBuilder.java:337)
2022-10-17T15:41:27.230Z | error | TestRunner | at com.android.dx.mockito.DexmakerMockMaker.createMock(DexmakerMockMaker.java:121)
2022-10-17T15:41:27.230Z | error | TestRunner | at org.mockito.internal.util.MockUtil.createMock(MockUtil.java:35)
- Dominant language
- Java
- Stars
- 2k
- Forks
- 262
- PR merge metrics
- No merged PRs in 30d
Getting set up
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from linkedin/dexmaker
-
License headers?Open
Difficulty 2/5 1-3 hours Newbie friendliness 45/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 50/100
-
Difficulty 5/5 Over a week Newbie friendliness 25/100
-
Difficulty 3/5 1-2 days Newbie friendliness 35/100
-
Difficulty 4/5 3-5 days Newbie friendliness 25/100
All issues in linkedin/dexmaker
Similar issues
-
needs-umair step-4
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
Umairishuman/BuildScan3D#24 ·
-
👀 example 📱 iOS
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
hyochan/react-native-nitro-sound#871 ·
Maintainers usually reply within 2 days
-
JPA security login throws when the stored password or roles string is nullPossibly taken @SebTardif claimed this today. Openarea/security env/windows
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
quarkusio/quarkus#58548 · 1 comment ·
Maintainers usually reply within 1 day
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
microsoft/copilot-for-eclipse#522 ·
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
marchof/java-almanac#354 ·