Fixed
Status Update
Comments
gg...@google.com <gg...@google.com> #2
Can you please attach the full logcat output to this bug, so we can take a look?
ri...@soundcloud.com <ri...@soundcloud.com> #3
Yes of course. Here the full logcat. Tested on multiple devices for example Moto G5, Samsung A5 and Nexus 5 (but custom rom)
nk...@google.com <nk...@google.com> #4
I've tested it today also on the Nexus 5X (Dev Preview 4) and Nexus 5 without custom rom.
br...@gmail.com <br...@gmail.com> #5
Thanks! I will try to see if I can reproduce it on a device. What's interesting though is that the permission seems to be already granted to the package. If you look at your log cat output, right before the exception there is this line: "I/GrantPermissionCallable: Permission: android.permission.WRITE_EXTERNAL_STORAGE is already granted!". What GPC does is to verify that the permission was actually granted for the target context (app under test). One thing that would be interesting if you could run "adb shell pm dump <package> | grep permission" after you ran the tests and paste the outputs here. Thanks.
[Deleted User] <[Deleted User]> #6
Hi sorry for the late response:
I get the following respone from the command:
requested permissions:
android.permission.INTERNET
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.READ_EXTERNAL_STORAGE
android.permission.RECORD_AUDIO
android.permission.SET_ALARM
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.WAKE_LOCK
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_FINE_LOCATION
install permissions:
android.permission.RECEIVE_BOOT_COMPLETED: granted=true
android.permission.INTERNET: granted=true
android.permission.ACCESS_NETWORK_STATE: granted=true
android.permission.WAKE_LOCK: granted=true
runtime permissions:
android.permission.WRITE_EXTERNAL_STORAGE: granted=true
android.permission.RECORD_AUDIO: granted=true
ACTIVITY MANAGER URI PERMISSIONS (dumpsys activity permissions)
time="26.9.2017, 18:55" type=MOVE_TO_FOREGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.ManagePermissionsActivity
time="26.9.2017, 18:56" type=MOVE_TO_BACKGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.ManagePermissionsActivity
time="26.9.2017, 19:14" type=MOVE_TO_FOREGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
time="26.9.2017, 19:14" type=MOVE_TO_BACKGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
time="26.9.2017, 19:20" type=MOVE_TO_FOREGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
time="26.9.2017, 19:20" type=MOVE_TO_BACKGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
So it seems that the permission is granted. But I get all the time the exception.
I get the following respone from the command:
requested permissions:
android.permission.INTERNET
android.permission.WRITE_EXTERNAL_STORAGE
android.permission.READ_EXTERNAL_STORAGE
android.permission.RECORD_AUDIO
android.permission.SET_ALARM
android.permission.RECEIVE_BOOT_COMPLETED
android.permission.WAKE_LOCK
android.permission.ACCESS_NETWORK_STATE
android.permission.ACCESS_FINE_LOCATION
install permissions:
android.permission.RECEIVE_BOOT_COMPLETED: granted=true
android.permission.INTERNET: granted=true
android.permission.ACCESS_NETWORK_STATE: granted=true
android.permission.WAKE_LOCK: granted=true
runtime permissions:
android.permission.WRITE_EXTERNAL_STORAGE: granted=true
android.permission.RECORD_AUDIO: granted=true
ACTIVITY MANAGER URI PERMISSIONS (dumpsys activity permissions)
time="26.9.2017, 18:55" type=MOVE_TO_FOREGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.ManagePermissionsActivity
time="26.9.2017, 18:56" type=MOVE_TO_BACKGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.ManagePermissionsActivity
time="26.9.2017, 19:14" type=MOVE_TO_FOREGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
time="26.9.2017, 19:14" type=MOVE_TO_BACKGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
time="26.9.2017, 19:20" type=MOVE_TO_FOREGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
time="26.9.2017, 19:20" type=MOVE_TO_BACKGROUND package=com.google.android.packageinstaller class=com.android.packageinstaller.permission.ui.GrantPermissionsActivity
So it seems that the permission is granted. But I get all the time the exception.
[Deleted User] <[Deleted User]> #7
I experienced the same issue using Rules 1.0.1 on Nexus 5X running Android 8.0
I found a workaround for this issue where I also grant the 'Manifest.permission.READ_EXTERNAL_STORAGE' permission and then things work as expected.
So instead of:
GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE);
I use:
GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE);
The issue could be (this is just my guess):
'GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE)' only grants write permission. However, when requesting the write permission using the Android system dialog both the write and read permissions are granted. This is also the expected behaviour as described in the Manifest.permission class:
https://developer.android.com/reference/android/Manifest.permission.html#READ_EXTERNAL_STORAGE
"Any app that declares the WRITE_EXTERNAL_STORAGE permission is implicitly granted this permission."
I found a workaround for this issue where I also grant the 'Manifest.permission.READ_EXTERNAL_STORAGE' permission and then things work as expected.
So instead of:
GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE);
I use:
GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE, Manifest.permission.READ_EXTERNAL_STORAGE);
The issue could be (this is just my guess):
'GrantPermissionRule.grant(Manifest.permission.WRITE_EXTERNAL_STORAGE)' only grants write permission. However, when requesting the write permission using the Android system dialog both the write and read permissions are granted. This is also the expected behaviour as described in the Manifest.permission class:
"Any app that declares the WRITE_EXTERNAL_STORAGE permission is implicitly granted this permission."
[Deleted User] <[Deleted User]> #8
Experienced same problem after updating hockey sdk to version 5.0.3.
After investigating I found that hockey sdk declares following in AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
While my app main library just defines following in AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Fixed by changing main library manifest to following:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:node="replace" />
After investigating I found that hockey sdk declares following in AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE" android:maxSdkVersion="18" />
While my app main library just defines following in AndroidManifest.xml:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"/>
Fixed by changing main library manifest to following:
<uses-permission android:name="android.permission.WRITE_EXTERNAL_STORAGE"
tools:node="replace" />
fe...@gmail.com <fe...@gmail.com> #9
Experience same problem with Manifest.permission.READ_CONTACTS and android.Manifest.permission.WRITE_CONTACTS permission
fe...@gmail.com <fe...@gmail.com> #10
Fix will be available in 1.0.2-alpha2
va...@theblueground.com <va...@theblueground.com> #11
I am also experiencing the same issue with Manifest.permission.ACCESS_FINE_LOCATION
Description
Version used: 1.0.1
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
- Firebase Test Lab (not sure it matters, but we are running 99.99% of our tests there)
How are you running your tests (via Android Studio, Gradle, adb, etc.)?
- gcloud command line
How to reproduce:
- The issue is not happening consistently and I haven't find how to reproduce it.
What is the expected output? What do you see instead?
- I expect to see the test either passed or failed for an assertion failed in my code but I rather get the following error message:
Test instrumentation process crashed. Check com.my.package.MyTest#testName.txt for details.
Reading the logcat I can see this exception printed:
I/TestRunner(8940): ----- begin exception -----
I/TestRunner(8940): java.lang.IllegalStateException: Unable to send TestFailure status, terminating
I/TestRunner(8940): at android.support.test.orchestrator.instrumentationlistener.OrchestratedInstrumentationListener.testFailure(OrchestratedInstrumentationListener.java:136)
I/TestRunner(8940): at org.junit.runner.notification.SynchronizedRunListener.testFailure(SynchronizedRunListener.java:63)
I/TestRunner(8940): at org.junit.runner.notification.RunNotifier$4.notifyListener(RunNotifier.java:142)
I/TestRunner(8940): at org.junit.runner.notification.RunNotifier$SafeNotifier.run(RunNotifier.java:72)
I/TestRunner(8940): at org.junit.runner.notification.RunNotifier.fireTestFailures(RunNotifier.java:138)
I/TestRunner(8940): at org.junit.runner.notification.RunNotifier.fireTestFailure(RunNotifier.java:132)
I/TestRunner(8940): at org.junit.internal.runners.model.EachTestNotifier.addFailure(EachTestNotifier.java:23)
I/TestRunner(8940): at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:329)
I/TestRunner(8940): at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
I/TestRunner(8940): at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
I/TestRunner(8940): at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
I/TestRunner(8940): at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
I/TestRunner(8940): at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
I/TestRunner(8940): at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
I/TestRunner(8940): at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
I/TestRunner(8940): at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
I/TestRunner(8940): at org.junit.runners.Suite.runChild(Suite.java:128)
I/TestRunner(8940): at org.junit.runners.Suite.runChild(Suite.java:27)
I/TestRunner(8940): at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
I/TestRunner(8940): at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
I/TestRunner(8940): at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
I/TestRunner(8940): at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
I/TestRunner(8940): at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
I/TestRunner(8940): at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
I/TestRunner(8940): at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
I/TestRunner(8940): at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
I/TestRunner(8940): at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:58)
I/TestRunner(8940): at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:375)
I/TestRunner(8940): at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
I/TestRunner(8940): Caused by: android.os.TransactionTooLargeException: data parcel size 2495968 bytes
I/TestRunner(8940): at android.os.BinderProxy.transactNative(Native Method)
I/TestRunner(8940): at android.os.BinderProxy.transact(Binder.java:503)
I/TestRunner(8940): at android.support.test.runner.internal.deps.aidl.BaseProxy.transactAndReadExceptionReturnVoid(BaseProxy.java:65)
I/TestRunner(8940): at android.support.test.orchestrator.callback.OrchestratorCallback$Stub$Proxy.sendTestNotification(OrchestratorCallback.java:96)
I/TestRunner(8940): at android.support.test.orchestrator.instrumentationlistener.OrchestratedInstrumentationListener.sendTestNotification(OrchestratedInstrumentationListener.java:167)
I/TestRunner(8940): at android.support.test.orchestrator.instrumentationlistener.OrchestratedInstrumentationListener.testFailure(OrchestratedInstrumentationListener.java:134)
I/TestRunner(8940): ... 28 more
I/TestRunner(8940): ----- end exception -----