Skip to content

Random FileNotFoundException when mocking Android class #185

@lsuski

Description

@lsuski

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)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions