Issue
I want to generate test coverage report for espresso and ui automation test cases.For which I am following this link I have added testCoverageEnabled = true in my android studio but when i am running ./gradlew createDebugCoverageReport getting error . is not recognized as an internal or external command, operable program or batch file. and if i remove . then /gradlew is not recognized as an internal or external command,operable program or batch file. Please help me. Maybe i am running command on wrong path.
Output of gradle wrapper
C:\Users\Shivam\Desktop\gradle\gradle-3.4.1-all\gradle-3.4.1\bin>gradle wrapper
Starting a Gradle Daemon (subsequent builds will be faster)
:wrapper FAILED
FAILURE: Build failed with an exception.
* What went wrong:
Some problems were found with the configuration of task ':wrapper'.
> Cannot write to file 'C:\Users\Shivam\Desktop\gradle\gradle-3.4.1-all\gradle-3.4.1\bin\gradle\wrapper\gradle-wrapper.properties' specified for property 'propertiesFile', as ancestor 'C:\Users\Shivam\Desktop\gradle\gradle-3.4.1-all\gradle-3.4.1\bin\gradle' is not a directory.
> Cannot write to file 'C:\Users\Shivam\Desktop\gradle\gradle-3.4.1-all\gradle-3.4.1\bin\gradle\wrapper\gradle-wrapper.jar' specified for property 'jarFile', as ancestor 'C:\Users\Shivam\Desktop\gradle\gradle-3.4.1-all\gradle-3.4.1\bin\gradle' is not a directory.
* Try:
Run with --stacktrace option to get the stack trace. Run with --info or --debug option to get more log output.
Solution
You are following a tutorial which does not match your OS.
./
is Unix based and you are windows based. If gradlew is in the current directory, then you can run.
.\gradlew createDebugCoverageReport
else, run just
gradlew createDebugCoverageReport
from command line, but that is if gradlew is in the system PATH.
else do
cd \
dir /S gradlew
it will display the path to gradlew, you then just need to cd to it, so let's say it is in C:\Program Files\Gradlew\ you just do
cd "C:\Program Files\Gradlew\"
and run gradlew createDebugCoverageReport from there.
Answered By - user2082599
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.