How to get Powermock to work with Dexmaker

前端 未结 3 1063
情书的邮戳
情书的邮戳 2021-01-18 01:13

I am trying to incorporate Powermock as a dependency for my Android tests using the following build.gradle configuration:

dependencies{
    compile \'com.and         


        
3条回答
  •  太阳男子
    2021-01-18 02:02

    I had the same problem and i just found the solution here. It involves a bit of manual work and you will have to modify the jar file yourself.

    So what nparihar suggests is the following.

    1. Make backup copy of powermock-api-mockito-1.5.5.jar
    2. Rename powermock-api-mockito-1.5.5.jar to powermock-api-mockito-1.5.5.zip
    3. Unzip powermock-api-mockito-1.5.5.zip
    4. cd powermock-api-mockito-1.5.5/
    5. rm -rf mockito-extensions
    6. jar cf powermock-api-mockito-1.5.5.jar META-INF/ org/
    7. put the new jar in your libs foler.

    This solution worked for me. Let me know if it works for you as well.

    Also, i can see that we are using the same dependencies. In my case i had to remove manually the hamcrest.jar and the objenesis.jar as there were confilcts.

    Hope that helps.

提交回复
热议问题