简体   繁体   English

使用 Record Espresso 时屏幕冻结

[英]Screen freezes when using Record Espresso

I've been trying to use record espresso for a few hours now, but I just can't make it work on the project.几个小时以来,我一直在尝试使用 record espresso,但我无法让它在该项目中发挥作用。 I've added:我已经添加:

androidTestImplementation 'androidx.test.espresso:espresso-core:3.1.1'

And I press run Record Espresso Test, and the screen just freezes at the first screen.然后我按下运行 Record Espresso Test,屏幕就在第一个屏幕上冻结了。 It doesn't finish the activity, because it is a Splash screen.它不会完成活动,因为它是一个启动画面。 Even if I set another screen as a first activity it just freezes, it makes a request but doesn't show any results, or changes screen.即使我将另一个屏幕设置为第一个活动,它也会冻结,它会发出请求但不显示任何结果或更改屏幕。 I have animations turned off.我关闭了动画。

03/18 08:29:20: Launching TestRecorderapp
$ adb push C:\ProjectsGit\somelink\app\build\outputs\apk\debug\app-debug.apk /data/local/tmp/com.company.someapp.debug
$ adb shell pm install -t -r "/data/local/tmp/com.company.someapp.debug"
Success
APK installed in 1 s 593 ms
$ adb shell pm clear com.company.someapp.debug
$ adb shell am start -n "com.company.someapp.debug/com.company.someapp.views.activities.SplashActivity" -a android.intent.action.MAIN -c android.intent.category.LAUNCHER -D
Waiting for application to come online: com.company.someapp.debug | com.company.someapp.debug.test
Waiting for application to come online: com.company.someapp.debug | com.company.someapp.debug.test
Connecting to com.company.someapp.debug
Capturing and displaying logcat messages from application. This behavior can be disabled in the "Logcat output" section of the "Debugger" settings page.
I/tcar.someapp.debu: The ClassLoaderContext is a special shared library.
W/ActivityThread: Application com.company.someapp.debug is waiting for the debugger on port 8100...
I/System.out: Sending WAIT chunk
I/System.out: Debugger has connected
    waiting for debugger to settle...
Connected to the target VM, address: 'localhost:8602', transport: 'socket'
I/System.out: waiting for debugger to settle...
I/chatty: uid=10222(com.company.someapp.debug) identical 5 lines
I/System.out: waiting for debugger to settle...
I/System.out: debugger has settled (1385)
I/tcar.someapp.debu: The ClassLoaderContext is a special shared library.
I/Perf: Connecting to perf service.
I/MultiDex: VM with version 2.1.0 has multidex support
    Installing application
    VM has multidex support, MultiDex support library is disabled.
V/FA: Registered activity lifecycle callback
D/FirebaseApp: com.google.firebase.auth.FirebaseAuth is not linked. Skipping initialization.
D/FirebaseApp: com.google.firebase.crash.FirebaseCrash is not linked. Skipping initialization.
I/FirebaseInitProvider: FirebaseApp initialization successful
V/Font: Change font:2
W/zze: Application name is not set. Call Builder#setApplicationName.
V/FA: Collection enabled
V/FA: App package, google app id: com.company.someapp.debug, 1:820332358974:android:deb7661ca6fda492
I/FA: App measurement is starting up, version: 14711
    To enable debug logging run: adb shell setprop log.tag.FA VERBOSE
I/FA: To enable faster debug mode event logging run:
      adb shell setprop debug.firebase.analytics.app com.company.someapp.debug
D/FA: Debug-level message logging enabled
V/FA: Persisting first open: 1552894248164
I/CrashlyticsCore: Initializing Crashlytics 2.6.7.30
V/FA: Updating deferred analytics collection: false
W/com.company.someapp.debug: type=1400 audit(0.0:5835047): avc: denied { read } for comm=45474C20496E6974 name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "vendor.debug.egl.profiler"
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
V/FA: Checking service availability
V/FA: onActivityCreated
V/FA: Service available
    Setting useService: true
V/FA: Connecting to remote service
V/FA: Connection attempt already in progress
D/NetworkSecurityConfig: No Network Security Config specified, using platform default
W/tcar.someapp.debu: Accessing hidden method Ldalvik/system/CloseGuard;->get()Ldalvik/system/CloseGuard; (light greylist, reflection)
    Accessing hidden method Ldalvik/system/CloseGuard;->open(Ljava/lang/String;)V (light greylist, reflection)
    Accessing hidden method Ldalvik/system/CloseGuard;->warnIfOpen()V (light greylist, reflection)
W/ActivityThread: handleWindowVisibility: no activity for token android.os.BinderProxy@6a839d6
V/FA: onActivityCreated
W/tcar.someapp.debu: Accessing hidden field Landroid/view/LayoutInflater;->mConstructorArgs:[Ljava/lang/Object; (light greylist, reflection)
W/tcar.someapp.debu: Accessing hidden method Landroid/view/View;->computeFitSystemWindows(Landroid/graphics/Rect;Landroid/graphics/Rect;)Z (light greylist, reflection)
W/tcar.someapp.debu: Accessing hidden method Landroid/view/ViewGroup;->makeOptionalFitsSystemWindows()V (light greylist, reflection)
I/FloatingActionButton: Setting a custom background is not supported.
I/chatty: uid=10222(com.company.someapp.debug) identical 1 line
I/FloatingActionButton: Setting a custom background is not supported.
W/tcar.someapp.debu: Accessing hidden field Lsun/misc/Unsafe;->theUnsafe:Lsun/misc/Unsafe; (light greylist, reflection)
D/OkHttp: --> GET https://api.somelink.com/api/settings
    Accept-Language: en
    x-client-type: android
    x-api-version: 4.1.0
    --> END GET
W/tcar.someapp.debu: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->setAlpnProtocols([B)V (light greylist, reflection)
D/OkHttp: --> GET https://api.somelink.com/
D/OkHttp: Accept-Language: en
    x-client-type: android
    x-api-version: 4.1.0
    --> END GET
W/MixpanelAPI.RsrcReader: Can't load names for Android view ids from 'com.company.someapp.debug.R$id', ids by name will not be available in the events editor.
W/MixpanelAPI.ConfigurationChecker: You can't have more than one service handling "com.google.firebase.MESSAGING_EVENT" intent filter. Android will only use the first one that is declared on your AndroidManifest.xml. If you have more than one push provider you need to crate your own FirebaseMessagingService class.
I/DpmTcmClient: RegisterTcmMonitor from: com.android.okhttp.TcmIdleTimerMonitor
W/tcar.someapp.debu: Accessing hidden method Lcom/android/org/conscrypt/OpenSSLSocketImpl;->getAlpnSelectedProtocol()[B (light greylist, reflection)
I/FA: Tag Manager is not found and thus will not be used
D/OkHttp: <-- 401 Unauthorized https://api.somelink.com(392ms)
    Date: Mon, 18 Mar 2019 07:30:46 GMT
    Content-Type: text/plain; charset=UTF-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
D/OkHttp: Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
    Access-Control-Max-Age: 86400
    Access-Control-Allow-Credentials: true
    Vary: Origin
    X-Request-ID: d7775f53-3ec9-4dae-ad96-0789e672ece9
    X-Kong-Upstream-Latency: 29
    X-Kong-Proxy-Latency: 0
    Via: kong/0.9.8
    Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: Unauthorized
D/OkHttp: <-- END HTTP (12-byte body)
D/FA: Logging event (FE): screen_view(_vs), Bundle[{firebase_event_origin(_o)=auto, firebase_screen_class(_sc)=ACCarSharingDrawerActivity, firebase_screen_id(_si)=2030554288779527060}]
E/SensorManager: registerListenerImpl sensorName:lsm6ds3c Accelerometer Non-wakeup,isWakeUpSensor:false,callingApp: com.company.someapp.debug,callingPid:7032,callingUid:10222
D/OkHttp: <-- 200 OK https://LINK.TO.API (545ms)
    Date: Mon, 18 Mar 2019 07:30:46 GMT
    Content-Type: application/json; charset=utf-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    Access-Control-Allow-Origin: *
D/OkHttp: Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
    Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
    Access-Control-Max-Age: 86400
    Access-Control-Allow-Credentials: true
    ETag: "4e4-7xR+HT/mxMa+pp02AdQTyyq5xFM"
    Vary: Origin
D/OkHttp: X-Request-ID: ae38af60-0eab-45a0-a63b-0a1ae4a8bc18
    X-Kong-Upstream-Latency: 57
    X-Kong-Proxy-Latency: 0
    Via: kong/0.9.8
    Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: {"Some response"}
    <-- END HTTP (1252-byte body)
V/FA: Connection attempt already in progress
V/FA: Connection attempt already in progress
V/FA: Activity resumed, time: 2325227289
D/OkHttp: --> GET https://link.to.api
D/OkHttp: Accept-Language: en
    x-client-type: android
    x-api-version: 4.1.0
    --> END GET
D/OpenGLRenderer: Skia GL Pipeline
I/Choreographer: Skipped 61 frames!  The application may be doing too much work on its main thread.
D/OkHttp: <-- 401 Unauthorized https://api.somelink.com/api(143ms)
    Date: Mon, 18 Mar 2019 07:30:46 GMT
    Content-Type: text/plain; charset=UTF-8
    Transfer-Encoding: chunked
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
    Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
D/OkHttp: Access-Control-Max-Age: 86400
    Access-Control-Allow-Credentials: true
    Vary: Origin
    X-Request-ID: c0112419-5fde-41b7-b940-c28a002e615a
    X-Kong-Upstream-Latency: 77
    X-Kong-Proxy-Latency: 0
    Via: kong/0.9.8
    Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: Unauthorized
    <-- END HTTP (12-byte body)
D/OkHttp: --> GET https://api.somelink.com/api
D/OkHttp: Accept-Language: en
    x-client-type: android
    x-api-version: 4.1.0
    --> END GET
I/zzbz: Making Creator dynamically
D/OkHttp: <-- 200 OK https://api.somelink.com/api/ (138ms)
    Date: Mon, 18 Mar 2019 07:30:47 GMT
    Content-Type: application/json; charset=utf-8
D/OkHttp: Transfer-Encoding: chunked
    Connection: keep-alive
    Access-Control-Allow-Origin: *
    Access-Control-Allow-Methods: GET,POST,PUT,DELETE,PATCH,OPTIONS
    Access-Control-Allow-Headers: content-type,x-requested-with,authorization, accept, accept-language,x-client-type,x-client-build,x-api-version
    Access-Control-Max-Age: 86400
    Access-Control-Allow-Credentials: true
    ETag: "2af9-wj9m57vexbsWcU5m7bfhEuhjvw4"
    Vary: Origin
    X-Request-ID: 668799cc-788b-43d4-96d7-eb8fd5614fc9
    X-Kong-Upstream-Latency: 110
    X-Kong-Proxy-Latency: 0
    Via: kong/0.9.8
    Strict-Transport-Security: max-age=31536000 ; includeSubDomains
D/OkHttp: {CORRECT RESPONSE JSON} <-- END HTTP (11001-byte body)
W/tcar.someapp.debu: Unsupported class loader
W/tcar.someapp.debu: Skipping duplicate class check due to unsupported classloader
I/DynamiteModule: Considering local module com.google.android.gms.maps_dynamite:0 and remote module com.google.android.gms.maps_dynamite:221
    Selected remote version of com.google.android.gms.maps_dynamite, version >= 221
V/DynamiteModule: Dynamite loader version >= 2, using loadModule2NoCrashUtils
W/tcar.someapp.debu: Unsupported class loader
W/tcar.someapp.debu: Skipping duplicate class check due to unsupported classloader
I/Google Maps Android API: Google Play services client version: 12451000
I/Google Maps Android API: Google Play services package version: 15090037
W/tcar.someapp.debu: Accessing hidden field Ljava/nio/Buffer;->address:J (light greylist, reflection)
I/Adreno: QUALCOMM build                   : f909f5a, Ida6448821d
    Build Date                       : 11/12/18
    OpenGL ES Shader Compiler Version: EV031.25.03.00
    Local Branch                     : 
    Remote Branch                    : refs/tags/AU_LINUX_ANDROID_LA.UM.7.3.R1.08.00.00.423.039
    Remote Branch                    : NONE
    Reconstruct Branch               : NOTHING
    Build Config                     : S P 6.0.3 AArch64
W/RenderThread: type=1400 audit(0.0:5835049): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
W/RenderThread: type=1400 audit(0.0:5835050): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
E/libc: Access denied finding property "ro.vendor.graphics.memory"
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
W/RenderThread: type=1400 audit(0.0:5835052): avc: denied { search } for name="proc" dev="debugfs" ino=3974 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:qti_debugfs:s0 tclass=dir permissive=0
W/RenderThread: type=1400 audit(0.0:5835053): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
I/Adreno: PFP: 0x016ee170, ME: 0x00000000
E/libc: Access denied finding property "vendor.debug.prerotation.disable"
I/ConfigStore: android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasWideColorDisplay retrieved: 1
    android::hardware::configstore::V1_0::ISurfaceFlingerConfigs::hasHDRDisplay retrieved: 0
I/OpenGLRenderer: Initialized EGL, version 1.4
D/OpenGLRenderer: Swap behavior 2
E/libc: Access denied finding property "vendor.debug.egl.changepixelformat"
W/RenderThread: type=1400 audit(0.0:5835055): avc: denied { read } for name="u:object_r:vendor_default_prop:s0" dev="tmpfs" ino=23336 scontext=u:r:untrusted_app:s0:c222,c256,c512,c768 tcontext=u:object_r:vendor_default_prop:s0 tclass=file permissive=0
D/FA: Connected to remote service
V/FA: Processing queued up service tasks: 4
I/Choreographer: Skipped 145 frames!  The application may be doing too much work on its main thread.
E/libc: Access denied finding property "vendor.debug.egl.changepixelformat"
E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
E/libc: Access denied finding property "vendor.debug.egl.swapinterval"
D/: Successfully load libgui-plugin.so, this=0x76506f70c0
I/OpenGLRenderer: Davey! duration=2828ms; Flags=0, IntendedVsync=910300861918726, Vsync=910303278585296, OldestInputEvent=9223372036854775807, NewestInputEvent=0, HandleInputStart=910303285835193, AnimationStart=910303286168422, PerformTraversalsStart=910303290208266, DrawStart=910303309583109, SyncQueued=910303573194464, SyncStart=910303573524516, IssueDrawCommandsStart=910303574379828, SwapBuffers=910303689163213, FrameCompleted=910303691023943, DequeueBufferDuration=3761000, QueueBufferDuration=1051000, 
E/SensorManager: unregisterListenerImpl callingApp: com.company.someapp.debug,callingPid:7032,callingUid:10222
V/FA: Recording user engagement, ms: 3449
Disconnected from the target VM, address: 'localhost:8602', transport: 'socket'

This are DEBUG Console logs.这是调试控制台日志。 I tried it on another project and it was VERY VERY LAGGY.我在另一个项目上尝试过它,它非常非常滞后。 Am I missing something?我错过了什么吗?

这就是所说的。

I had the same issue on Android Studio 4.1.1 using Pixel 3 API 29 .我在使用Pixel 3 API 29 的Android Studio 4.1.1上遇到了同样的问题。 When the emulator is up, my application becomes stuck in blank screen (before the splashscreen)当模拟器启动时,我的应用程序卡在空白屏幕(在启动画面之前)

Make sure that you had import Espresso dependencies:确保您有 import Espresso 依赖项:

androidTestImplementation 'com.android.support.test:runner:1.0.2'
androidTestImplementation 'com.android.support.test.espresso:espresso-core:3.0.2'

ps: https://www.thedroidsonroids.com/blog/espresso-test-recording ps: https : //www.thedroidsonroids.com/blog/espresso-test-recording

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM