我很难在 Android Studio 中运行仪器测试。
当我尝试运行多个测试用例时,出现“测试框架意外退出”:
...并且所有测试继续在模拟器中运行,但 Android Studio 没有返回结果。
Logcat 显示了这一点:
...
03-17 11:38:59.236 1699 1719 W ActivityManager: Scheduling restart of crashed service androidx.test.orchestrator/.OrchestratorService in 1000ms
03-17 11:38:59.236 1699 1719 W ActivityManager: Crash of app androidx.test.orchestrator running instrumentation ComponentInfo{androidx.test.orchestrator/androidx.test.orchestrator.AndroidTestOrchestrator}
03-17 11:38:59.236 1699 1721 W zygote : kill(-8537, 9) failed: No such process
03-17 11:38:59.238 1699 13861 W Binder : Outgoing transactions from this process must be FLAG_ONEWAY
03-17 11:38:59.238 1699 13861 W Binder : java.lang.Throwable
03-17 11:38:59.238 1699 13861 W …Run Code Online (Sandbox Code Playgroud) android android-studio android-espresso android-orchestrator
在使用 espresso 时,我经常遇到这样的情况:espresso 被卡住(例如 on onView(withId(R.id.somebutton)).perform(click()))等待所有资源空闲,据我所知,这些资源可以是动画、后台任务、队列中的可运行项等。目前我收到的唯一消息是:
E/TestRunner: androidx.test.espresso.PerformException: Error performing 'single click - At Coordinates: 359, 1291 and precision: 16, 16' on view 'with id: com.example:id/somebutton'.
(...)
Caused by: androidx.test.espresso.AppNotIdleException: Looped for 7 iterations over 60 SECONDS. The following Idle Conditions failed .
Run Code Online (Sandbox Code Playgroud)
该应用程序非常复杂,有什么可以帮助缩小导致 espresso 认为该应用程序不空闲的原因吗?
android android-testing android-espresso android-orchestrator
我正在尝试设置 Jenkins 从机来进行 Android 项目的 UI 测试。当我尝试运行 android 模拟器时遇到此问题时,我已经不知道如何继续:
[myuser@jenkins-slave-002 emulator]$ export ANDROID_SDK_ROOT="/var/lib/android"
[myuser@jenkins-slave-002 emulator]$ ./emulator -avd pixel-2-api28 -no-window -verbose -show-kernel
emulator: Android emulator version 30.0.5.0 (build_id 6306047) (CL:N/A)
emulator: Found AVD name 'pixel-2-api28'
emulator: Found AVD target architecture: x86
emulator: argv[0]: './emulator'; program directory: '/var/lib/android/emulator'
emulator: Not a directory: /var/lib/android/android/system-images/android-28/google_apis/x86/
PANIC: Broken AVD system path. Check your ANDROID_SDK_ROOT value [/var/lib/android]!
Run Code Online (Sandbox Code Playgroud)
我缺少什么?
重复的android文件夹/var/lib/android/android/system-images/(...)看起来不正确,但我不知道它来自哪里。我想应该是的/var/lib/android/system-images/(...)。
细节:
之前我已经通过这种方式完成了 android sdk 的完整设置
/lib/var/android/ unzip commandlinetools-linux-6200805_latest.zip (taken from https://developer.android.com/studio#command-tools) …Run Code Online (Sandbox Code Playgroud) android android-emulator android-sdk-tools android-sdk-manager
我正在使用这样的视频组件:
<Video style={[videoPlayerStyle, this.props.containerStyle, {height: videoHeight, width: videoWidth}] }
source={{uri: this.props.videoURL}}
ref={(ref) => {
this.player = ref
}}
paused={this.state.paused}
controls={nativeControls}
playInBackground={false}
repeat={false}
key="something123"
muted={this.state.mute}
onBuffer={this.onBuffer}
onEnd={this.onEnd}
onError={this.onError}
onLoad={this.onLoad}
onLoadStart={this.onLoadStart}
onProgress={this.onProgress}
/>
Run Code Online (Sandbox Code Playgroud)
视频结束后,我会显示一个按钮,允许用户再次播放。我尝试使用:
restartPlayingVideo = (dict) => {
this.player.seek(0) // I tried with and without this
this.setState({paused: false})
}
Run Code Online (Sandbox Code Playgroud)
但该视频不会在 Android 上再次开始(在 iOS 上运行良好)。
我错过了什么吗?