我最近将我的Macbook专业版更新为Mac OS High Sierra.现在我遇到了一个问题,我无法再在Android Studio中启动模拟器.
显示警告/dev/kvm is not found..当我尝试启动模拟器时,我收到以下错误:
我从SDK管理器和独立版本尝试了不同版本的Intel HAXM,重新安装了Android Studio并完全删除了所有配置,仍然是同样的问题.
我们在Google Play商店中发布了一个应用,可以显示来自Google DFP广告管理系统的广告.
在某些广告中,应用程序在OnePlus 6上崩溃.我们在崩溃报告中没有得到堆栈跟踪,但在Google Play控制台中收到错误日志,如下所示.我们确信它是由广告引起的,因为它只出现在有广告的版本上.此外,在广告呈现期间会出现崩溃.
Google Play中的回溯会针对每次崩溃显示以下日志:
*** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
pid: 0, tid: 0 >>> com.myapp.app <<<
backtrace:
#00 pc 000000000076eb50 /vendor/lib/libllvm-glnext.so (ShaderObjects::loadProgramBinary(CompilerContext*, void*, unsigned int, QGLC_LINKPROGRAM_RESULT*)+855)
#01 pc 00000000006ddba5 /vendor/lib/libllvm-glnext.so (CompilerContext::loadProgramBinary(void*, unsigned int, QGLC_LINKPROGRAM_RESULT*)+108)
#02 pc 000000000077fb73 /vendor/lib/libllvm-glnext.so (QGLCLoadProgramBinary(void*, void*, unsigned int, QGLC_LINKPROGRAM_RESULT*)+54)
#03 pc 00000000001612b1 /vendor/lib/egl/libGLESv2_adreno.so (EsxShaderCompiler::LoadProgramBinaryBlob(EsxContext*, EsxProgram*, void const*, unsigned int, EsxInfoLog*)+164)
#04 pc 0000000000140191 /vendor/lib/egl/libGLESv2_adreno.so (EsxProgram::LoadProgramBinary(EsxContext*, unsigned int, void const*, int)+186)
#05 …Run Code Online (Sandbox Code Playgroud) android google-dfp double-click-advertising google-play-console
我认为这是一个错误,但我可能做错了什么。
我的布局非常简单,只包含一个浮动操作按钮:
<android.support.design.widget.CoordinatorLayout
xmlns:android="http://schemas.android.com/apk/res/android"
xmlns:app="http://schemas.android.com/apk/res-auto"
android:id="@+id/contentCoordinatorLayout"
android:layout_width="match_parent"
android:layout_height="match_parent">
<LinearLayout
android:id="@+id/layoutWithoutContent"
android:layout_width="match_parent"
android:layout_height="match_parent"
android:orientation="vertical">
</LinearLayout>
<android.support.design.widget.FloatingActionButton
android:id="@+id/stopButton"
android:src="@drawable/ic_stop_white_24px"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginRight="16dp"
android:layout_marginBottom="16dp"
app:layout_anchor="@id/layoutWithoutContent"
app:backgroundTint="@color/colorPrimary"
app:layout_anchorGravity="bottom|right|end"/>
Run Code Online (Sandbox Code Playgroud)
我的活动只继承了包含以下内容的 onCreate 方法:
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
CoordinatorLayout coordinatorLayout = findViewById(R.id.contentCoordinatorLayout);
Snackbar.make(coordinatorLayout, R.string.snackbar_message, Snackbar.LENGTH_LONG).show();
}
Run Code Online (Sandbox Code Playgroud)
我写了一个 Espresso 测试,它只验证 Snackbar 在半秒内显示
@Rule
public ActivityTestRule<MainActivity> mainActivity = new ActivityTestRule<>(MainActivity.class, true, true);
@Test
public void testSnackbarIsShown() throws Exception { onView(withText(R.string.snackbar_message)).check(matches(isDisplayed()));
}
Run Code Online (Sandbox Code Playgroud)
当我调试这个测试时,onView(withText(R.string.snackbar_message)).check(matches(isDisplayed()));是在snackbar消失后执行的。
到目前为止,我找到了 3 种方法来解决此问题,问题在以下情况下得到解决:
我将 FloatingActionButton 的 anchorGravity …
android android-espresso floating-action-button coordinator-layout