stanfy / spoon-gradle-plugin

Gradle plugin for Spoon.
Apache License 2.0
353 stars 79 forks source link

Spoon block is ignored in Gradle. Unable to create output dir: #159

Open henorek opened 7 years ago

henorek commented 7 years ago

I cannot grant all permissions for M+ devices.

  spoon {
    sequential = true
    grantAllPermissions = true
  }

doesn't work. I have to invoke adb manually to grant permission to WRITE_EXTERNAL_STORAGE. Then my screenshots are working fine, otherwise I encounter Unable to create output dir: /storage/emulated/0/app_spoon-screenshots error. This permission is also included in my AndroidManifest files. Any ideas? I've tried everything... Spoon 1.7.1, Plugin 1.2.2

trevjonez commented 6 years ago

I am having the same error regardless of permission grant. only thing that fixes it for me is target sdk 22. seems like a problem with spoon not the plugin.

swanson commented 6 years ago

Running into the same issue. Have tried targetSDK 22 and 26. Have grantAllPermissions set to true. Added WRITE_EXTERNAL_STORAGE to the test app manifest. Using Spoon client 1.7.1 and plugin 1.2.2.

Additionally, I went into the the App settings for the instrumentation app on the device directly and manually granted Storage permissions and still am getting java.lang.IllegalAccessException: Unable to create output dir: /storage/emulated/0/app_spoon-screenshots. Failing on a physical Nexus 5 running Andoid 7.1.1 and emulator using API 26.

Have tried manually creating an SD card and "Studio-managed" options for the emulator storage.

Not sure if it matters but am working on a legacy codebase that is still using Robotium.Solo, ActivityInstrumentationTestCase2 and InstrumentationTestRunner.

PradeeshMuthukumaraswamy commented 6 years ago

Rather than use

@Rule public GrantPermissionRule mRuntimePermissionRule = GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE,
            Manifest.permission.READ_EXTERNAL_STORAGE);

in the test class code. It will work