scrcpy: Fails on android 12 when use --stay-awake
Environment
- OS: macOS BigSur 11.6
- scrcpy version: 1.19
- installation method: brew
- device model: Xiaomi 11 Ultra
- Android version: 12
Describe the bug
run: scrcpy --stay-awake
2021-09-28 17:49:19.443 scrcpy[48746:3478246] INFO: scrcpy 1.19 <https://github.com/Genymobile/scrcpy>
/usr/local/share/scrcpy/scrcpy-server: 1 file pushed, 0 skipped. 30.8 MB/s (37442 bytes in 0.001s)
[server] INFO: Device: Xiaomi (Android 12)
[server] ERROR: Could not invoke method
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.ContentProvider.call(ContentProvider.java:108)
at com.genymobile.scrcpy.wrappers.ContentProvider.getValue(ContentProvider.java:149)
at com.genymobile.scrcpy.wrappers.ContentProvider.getAndPutValue(ContentProvider.java:165)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:39)
at com.genymobile.scrcpy.Server.main(Server.java:255)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:363)
Caused by: java.lang.SecurityException: Calling uid: 2000 doesn't match source uid: 0
at android.os.Parcel.createExceptionOrNull(Parcel.java:2425)
at android.os.Parcel.createException(Parcel.java:2409)
at android.os.Parcel.readException(Parcel.java:2392)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.call(ContentProviderNative.java:732)
... 8 more
Caused by: android.os.RemoteException: Remote stack trace:
at android.content.AttributionSource.enforceCallingUid(AttributionSource.java:239)
at android.content.AttributionSource.<init>(AttributionSource.java:158)
at android.content.AttributionSource$1.createFromParcel(AttributionSource.java:454)
at android.content.AttributionSource$1.createFromParcel(AttributionSource.java:446)
at android.content.ContentProviderNative.onTransact(ContentProviderNative.java:289)
[server] ERROR: Could not invoke method
java.lang.reflect.InvocationTargetException
at java.lang.reflect.Method.invoke(Native Method)
at com.genymobile.scrcpy.wrappers.ContentProvider.call(ContentProvider.java:108)
at com.genymobile.scrcpy.wrappers.ContentProvider.putValue(ContentProvider.java:161)
at com.genymobile.scrcpy.wrappers.ContentProvider.getAndPutValue(ContentProvider.java:167)
at com.genymobile.scrcpy.Server.scrcpy(Server.java:39)
at com.genymobile.scrcpy.Server.main(Server.java:255)
at com.android.internal.os.RuntimeInit.nativeFinishInit(Native Method)
at com.android.internal.os.RuntimeInit.main(RuntimeInit.java:363)
Caused by: java.lang.SecurityException: Calling uid: 2000 doesn't match source uid: 0
at android.os.Parcel.createExceptionOrNull(Parcel.java:2425)
at android.os.Parcel.createException(Parcel.java:2409)
at android.os.Parcel.readException(Parcel.java:2392)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:190)
at android.database.DatabaseUtils.readExceptionFromParcel(DatabaseUtils.java:142)
at android.content.ContentProviderProxy.call(ContentProviderNative.java:732)
... 8 more
About this issue
- Original URL
- State: closed
- Created 3 years ago
- Comments: 15
Commits related to this issue
- Read/write settings via command on Android >= 12 Before Android 8, executing the "settings" command from a shell was very slow (~1 second), because it spawned a new app_process to execute Java code. ... — committed to Genymobile/scrcpy by rom1v 3 years ago
- Read/write settings via command on Android >= 12 Before Android 8, executing the "settings" command from a shell was very slow (~1 second), because it spawned a new app_process to execute Java code. ... — committed to Genymobile/scrcpy by rom1v 3 years ago
This is working, thanks @rom1v 🎉