Skip to content
This repository has been archived by the owner on Aug 8, 2023. It is now read-only.

ScreenshotUtil for tests is broken #4847

Closed
tobrun opened this issue Apr 26, 2016 · 21 comments
Closed

ScreenshotUtil for tests is broken #4847

tobrun opened this issue Apr 26, 2016 · 21 comments
Labels
Android Mapbox Maps SDK for Android crash tests

Comments

@tobrun
Copy link
Member

tobrun commented Apr 26, 2016

When trying to take a screenshot using espresso (using ScreenshotUtil.java). The utility crashes with:

04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466] JNI DETECTED ERROR IN APPLICATION: thread Thread[12,tid=15978,Native,Thread*=0x7c65215800,peer=0x12cdc820,"Instr: android.support.test.runner.AndroidJUnitRunner"] using JNIEnv* from thread Thread[12,tid=15978,Native,Thread*=0x7c65215800,peer=0x12cdc820,"Instr: android.support.test.runner.AndroidJUnitRunner"]
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]     in call to CallVoidMethodV
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]     from void com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(long)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466] "Instr: android.support.test.runner.AndroidJUnitRunner" prio=5 tid=12 Runnable
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   | group="main" sCount=0 dsCount=0 obj=0x12cdc820 self=0x7c65215800
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   | sysTid=15978 nice=-8 cgrp=default sched=0/0 handle=0x7c703b7450
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   | state=R schedstat=( 159305621 2259425 55 ) utm=4 stm=11 core=2 HZ=100
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   | stack=0x7c702b5000-0x7c702b7000 stackSize=1037KB
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   | held mutexes= "mutator lock"(shared held)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #00 pc 000000000046e700  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+220)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #01 pc 000000000046e6fc  /system/lib64/libart.so (_ZN3art15DumpNativeStackERNSt3__113basic_ostreamIcNS0_11char_traitsIcEEEEiP12BacktraceMapPKcPNS_9ArtMethodEPv+216)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #02 pc 0000000000442394  /system/lib64/libart.so (_ZNK3art6Thread9DumpStackERNSt3__113basic_ostreamIcNS1_11char_traitsIcEEEEbP12BacktraceMap+480)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #03 pc 00000000002e2494  /system/lib64/libart.so (_ZN3art9JavaVMExt8JniAbortEPKcS2_+1136)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #04 pc 00000000002e2ba8  /system/lib64/libart.so (_ZN3art9JavaVMExt9JniAbortVEPKcS2_St9__va_list+124)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #05 pc 00000000000ff3b8  /system/lib64/libart.so (_ZN3art11ScopedCheck6AbortFEPKcz+156)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #06 pc 00000000000fec58  /system/lib64/libart.so (_ZN3art11ScopedCheck11CheckThreadEP7_JNIEnv+168)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #07 pc 00000000000fc904  /system/lib64/libart.so (_ZN3art11ScopedCheck5CheckERNS_18ScopedObjectAccessEbPKcPNS_12JniValueTypeE+1124)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #08 pc 0000000000102284  /system/lib64/libart.so (_ZN3art8CheckJNI13CheckCallArgsERNS_18ScopedObjectAccessERNS_11ScopedCheckEP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDNS_10InvokeTypeEPKNS_7VarArgsE+140)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #09 pc 0000000000101540  /system/lib64/libart.so (_ZN3art8CheckJNI11CallMethodVEPKcP7_JNIEnvP8_jobjectP7_jclassP10_jmethodIDSt9__va_listNS_9Primitive4TypeENS_10InvokeTypeE+704)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #10 pc 00000000000f42f4  /system/lib64/libart.so (_ZN3art8CheckJNI15CallVoidMethodVEP7_JNIEnvP8_jobjectP10_jmethodIDSt9__va_list+96)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #11 pc 00000000000ef45c  /data/app/com.mapbox.mapboxsdk.testapp-2/lib/arm64/libmapbox-gl.so (_ZN7_JNIEnv14CallVoidMethodEP8_jobjectP10_jmethodIDz+124)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #12 pc 00000000000f083c  /data/app/com.mapbox.mapboxsdk.testapp-2/lib/arm64/libmapbox-gl.so (_ZN4mbgl7android13NativeMapView15notifyMapChangeENS_9MapChangeE+40)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #13 pc 000000000017bd94  /data/app/com.mapbox.mapboxsdk.testapp-2/lib/arm64/libmapbox-gl.so (_ZN4mbgl3Map6renderEv+104)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #14 pc 00000000000ef4bc  /data/app/com.mapbox.mapboxsdk.testapp-2/lib/arm64/libmapbox-gl.so (_ZN4mbgl7android13NativeMapView6renderEv+60)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #15 pc 000000000010597c  /data/app/com.mapbox.mapboxsdk.testapp-2/lib/arm64/libmapbox-gl.so (???)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #16 pc 00000000000d8a30  /system/lib64/libart.so (art_quick_generic_jni_trampoline+144)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #17 pc 00000000000cf674  /system/lib64/libart.so (art_quick_invoke_stub+580)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #18 pc 00000000000dc284  /system/lib64/libart.so (_ZN3art9ArtMethod6InvokeEPNS_6ThreadEPjjPNS_6JValueEPKc+208)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #19 pc 0000000000288310  /system/lib64/libart.so (_ZN3art11interpreter34ArtInterpreterToCompiledCodeBridgeEPNS_6ThreadEPKNS_7DexFile8CodeItemEPNS_11ShadowFrameEPNS_6JValueE+264)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #20 pc 0000000000281338  /system/lib64/libart.so (_ZN3art11interpreter6DoCallILb0ELb0EEEbPNS_9ArtMethodEPNS_6ThreadERNS_11ShadowFrameEPKNS_11InstructionEtPNS_6JValueE+592)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #21 pc 0000000000548fe0  /system/lib64/libart.so (MterpInvokeDirect+348)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   native: #22 pc 00000000000c2294  /system/lib64/libart.so (ExecuteMterpImpl+14484)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(Native method)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at com.mapbox.mapboxsdk.maps.NativeMapView.render(NativeMapView.java:127)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at com.mapbox.mapboxsdk.maps.MapView.onDraw(MapView.java:1264)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:16998)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:16906)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.drawChild(ViewGroup.java:3710)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3498)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:16904)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.drawChild(ViewGroup.java:3710)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3498)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:16904)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.drawChild(ViewGroup.java:3710)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3498)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:16904)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.drawChild(ViewGroup.java:3710)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3498)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:16904)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.drawChild(ViewGroup.java:3710)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3498)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:16904)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.drawChild(ViewGroup.java:3710)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3498)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.draw(View.java:17001)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at com.android.internal.policy.DecorView.draw(DecorView.java:726)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.buildDrawingCacheImpl(View.java:16287)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.buildDrawingCache(View.java:16148)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.getDrawingCache(View.java:16054)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.view.View.getDrawingCache(View.java:16019)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at com.mapbox.mapboxsdk.testapp.espresso.utils.ScreenshotUtil.take(ScreenshotUtil.java:49)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at com.mapbox.mapboxsdk.testapp.espresso.DirectionsActivityTest.testScreenshot(DirectionsActivityTest.java:59)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at java.lang.reflect.Method.invoke!(Native method)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.support.test.internal.statement.UiThreadStatement.evaluate(UiThreadStatement.java:55)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:257)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.rules.RunRules.evaluate(RunRules.java:20)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.Suite.runChild(Suite.java:128)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.Suite.runChild(Suite.java:27)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
04-26 11:33:23.300 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
04-26 11:33:23.301 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:54)
04-26 11:33:23.301 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:240)
04-26 11:33:23.301 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466]   at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1921)
04-26 11:33:23.301 15948-15978/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:466] 

While it's creating a bitmap from the currently shown rootView:

        Bitmap bitmap = Bitmap.createBitmap(rootView.getDrawingCache());
@tobrun tobrun added Android Mapbox Maps SDK for Android crash tests labels Apr 26, 2016
@tobrun
Copy link
Member Author

tobrun commented Apr 26, 2016

Stacktrace from Nexus 6p:

04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410] JNI DETECTED ERROR IN APPLICATION: thread Thread[10,tid=4575,Native,Thread*=0x7f92858c00,peer=0x12e814c0,"Instr: android.support.test.runner.AndroidJUnitRunner"] using JNIEnv* from thread Thread[10,tid=4575,Native,Thread*=0x7f92858c00,peer=0x12e814c0,"Instr: android.support.test.runner.AndroidJUnitRunner"]
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]     in call to CallVoidMethodV
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]     from void com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(long)
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410] "Instr: android.support.test.runner.AndroidJUnitRunner" prio=5 tid=10 Runnable
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   | group="main" sCount=1 dsCount=0 obj=0x12e814c0 self=0x7f92858c00
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   | sysTid=4575 nice=-8 cgrp=default sched=0/0 handle=0x7f9bf34440
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   | state=R schedstat=( 92594996 8080620 137 ) utm=5 stm=3 core=1 HZ=100
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   | stack=0x7f9be32000-0x7f9be34000 stackSize=1037KB
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   | held mutexes= "mutator lock"(shared held)
04-26 11:46:57.603 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #00 pc 000000000048b108  /system/lib64/libart.so (art::DumpNativeStack(std::__1::basic_ostream<char, std::__1::char_traits<char> >&, int, char const*, art::ArtMethod*, void*)+236)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #01 pc 000000000045a2c8  /system/lib64/libart.so (art::Thread::Dump(std::__1::basic_ostream<char, std::__1::char_traits<char> >&) const+220)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #02 pc 000000000030e730  /system/lib64/libart.so (art::JavaVMExt::JniAbort(char const*, char const*)+1000)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #03 pc 000000000030efe8  /system/lib64/libart.so (art::JavaVMExt::JniAbortV(char const*, char const*, std::__va_list)+116)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #04 pc 0000000000143f1c  /system/lib64/libart.so (art::ScopedCheck::AbortF(char const*, ...)+144)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #05 pc 000000000014ad48  /system/lib64/libart.so (art::ScopedCheck::Check(art::ScopedObjectAccess&, bool, char const*, art::JniValueType*) (.constprop.116)+5956)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #06 pc 000000000015d9d0  /system/lib64/libart.so (art::CheckJNI::CallMethodV(char const*, _JNIEnv*, _jobject*, _jclass*, _jmethodID*, std::__va_list, art::Primitive::Type, art::InvokeType)+684)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #07 pc 000000000015fc98  /system/lib64/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+68)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #08 pc 00000000000ef45c  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm64/libmapbox-gl.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+124)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #09 pc 00000000000f083c  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm64/libmapbox-gl.so (mbgl::android::NativeMapView::notifyMapChange(mbgl::MapChange)+40)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #10 pc 000000000017bd94  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm64/libmapbox-gl.so (mbgl::Map::render()+104)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #11 pc 00000000000ef4bc  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm64/libmapbox-gl.so (mbgl::android::NativeMapView::render()+60)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #12 pc 000000000010597c  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm64/libmapbox-gl.so (???)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #13 pc 00000000002ce3d4  /data/app/com.mapbox.mapboxsdk.testapp-1/oat/arm64/base.odex (void com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(long)+136)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #14 pc 00000000002d24e4  /data/app/com.mapbox.mapboxsdk.testapp-1/oat/arm64/base.odex (void com.mapbox.mapboxsdk.maps.NativeMapView.render()+88)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #15 pc 00000000002b8ab0  /data/app/com.mapbox.mapboxsdk.testapp-1/oat/arm64/base.odex (void com.mapbox.mapboxsdk.maps.MapView.onDraw(android.graphics.Canvas)+276)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   native: #16 pc 0000000001666858  /data/dalvik-cache/arm64/system@framework@boot.oat (???)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at com.mapbox.mapboxsdk.maps.NativeMapView.nativeRender(Native method)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at com.mapbox.mapboxsdk.maps.NativeMapView.render(NativeMapView.java:127)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at com.mapbox.mapboxsdk.maps.MapView.onDraw(MapView.java:1264)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16184)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16096)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16094)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16094)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16094)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16094)
04-26 11:46:57.604 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16094)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.drawChild(ViewGroup.java:3609)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3399)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.draw(View.java:16187)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at com.android.internal.policy.PhoneWindow$DecorView.draw(PhoneWindow.java:2690)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.buildDrawingCacheImpl(View.java:15480)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.buildDrawingCache(View.java:15341)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.getDrawingCache(View.java:15247)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.view.View.getDrawingCache(View.java:15212)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at com.mapbox.mapboxsdk.testapp.espresso.utils.ScreenshotUtil.take(ScreenshotUtil.java:49)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at com.mapbox.mapboxsdk.testapp.espresso.DirectionsActivityTest.testScreenshot(DirectionsActivityTest.java:53)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at java.lang.reflect.Method.invoke!(Native method)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.model.FrameworkMethod$1.runReflectiveCall(FrameworkMethod.java:50)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.internal.runners.model.ReflectiveCallable.run(ReflectiveCallable.java:12)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.model.FrameworkMethod.invokeExplosively(FrameworkMethod.java:47)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.internal.runners.statements.InvokeMethod.evaluate(InvokeMethod.java:17)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.internal.runners.statements.RunBefores.evaluate(RunBefores.java:26)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.support.test.internal.statement.UiThreadStatement.evaluate(UiThreadStatement.java:55)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.support.test.rule.ActivityTestRule$ActivityStatement.evaluate(ActivityTestRule.java:257)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.rules.RunRules.evaluate(RunRules.java:20)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner.runLeaf(ParentRunner.java:325)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:78)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.BlockJUnit4ClassRunner.runChild(BlockJUnit4ClassRunner.java:57)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.Suite.runChild(Suite.java:128)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.Suite.runChild(Suite.java:27)
04-26 11:46:57.605 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runner.JUnitCore.run(JUnitCore.java:137)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at org.junit.runner.JUnitCore.run(JUnitCore.java:115)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.support.test.internal.runner.TestExecutor.execute(TestExecutor.java:54)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.support.test.runner.AndroidJUnitRunner.onStart(AndroidJUnitRunner.java:240)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410]   at android.app.Instrumentation$InstrumentationThread.run(Instrumentation.java:1879)
04-26 11:46:57.606 4528-4575/com.mapbox.mapboxsdk.testapp A/art: art/runtime/java_vm_ext.cc:410] 

@zugaldia
Copy link
Member

/sub

@tobrun
Copy link
Member Author

tobrun commented Apr 27, 2016

In #4633 I was able to take a snapshot of the MapView (both GL content as Android SDK Views). The difference with this issue is that it is taken the rootview to convert to a bitmap instead of the MapView.

@zugaldia
Copy link
Member

@tobrun Just to clarify, currently ScreenshotUtil works with the root view container, but not with the actual MapView?

@bleege
Copy link
Contributor

bleege commented Apr 29, 2016

/sub

@tobrun
Copy link
Member Author

tobrun commented May 3, 2016

@zugaldia it works with the Mapview but has trouble with the root view container

@bleege
Copy link
Contributor

bleege commented May 3, 2016

Just documenting that the ScreenshotUtil class is currently only in https://github.com/mapbox/mapbox-gl-native/commits/tobrun-screenshotutil-broken.

@bleege
Copy link
Contributor

bleege commented May 3, 2016

I've cherry picked the ScreenshotActivityTest from dc9a170 on to a new branch off of master called 4847-screenshot. I then ran the tests locally using the instructions on the project's wiki against this branch with the ScreenshotActivityTest included. Specifically I ran the following command locally while having a Samsung S5 running API 21 connected to it and it passed all it's tests. This tells me that things are working as expected.

./gradlew cC -p MapboxGLAndroidSDKTestApp

The next step is going to be to review a few other changes that came with the ScreenshotActivityTest in the dc9a170 to gauge their impact on the TestApp. Assuming that their impact is negligible I'll them merge 4847-screenshot into master so that this is visible and workable to everyone. If there are issues with the other commits I'll try to minimize their impact on the TestApp while sill ensuring that all the tests pass.

Once this step is done the next step of the process is to run this on AWS Device Farm for proper breadth testing of devices.

@bleege
Copy link
Contributor

bleege commented May 3, 2016

After reviewing the rest of the commit the only major change is removal of StrictMode in the TestApp's MapboxApplication.java. While StictMode is a useful thing, it's very much a "Nice To Have" as it's a development tool and not generally used in production apps. I'm going to re-enable StrictMode and retry the local test against the device. If it works then I'll re-add it and use that in the AWS Device Farm tests.

screen shot 2016-05-03 at 3 31 56 pm

@bleege
Copy link
Contributor

bleege commented May 3, 2016

I just re-enabled StictMode and successfully tested locally on the same Samsung S5. I'm going to commit that to the development branch and then merge both commits into master so we all have the same code to work with. From there I'll bundle up the two .apks needed for AWS Device Farm testing and kick off a run.

bleege added a commit that referenced this issue May 3, 2016
@bleege bleege added this to the android-v4.1.0 milestone May 3, 2016
bleege added a commit that referenced this issue May 3, 2016
@bleege
Copy link
Contributor

bleege commented May 3, 2016

Ok, now the entire test infrastructure needed for ScreenshotActivityTest is in master thanks to #4931 so everyone has access to it. Next step is to build the test .apks from master and send 'em through AWS Device Farm.

@bleege
Copy link
Contributor

bleege commented May 4, 2016

I just fired off a new test round on AWS Device farm using the same commit from master as the previous local tests ( 7e2ec7f ). It's a full test against the 130 devices that AWS Device Farm has so we'll find out where things stand for sure. The tests are estimated to last 5-6 hours. I'll update this ticket when I have the results.

@bleege
Copy link
Contributor

bleege commented May 4, 2016

The results of the AWS Device Farm test run last night confirm that the Hardware Acceleration issue that impacts Android 4.4.x / KitKat and described in #4911 is still happening (see screenshot below). I'm going to further investigate where the TestApp is using Hardware Acceleration as well as how the ScreenshotUtil is actually doing the work of creating screenshots.

20160504-test-2-screenshot

@bleege
Copy link
Contributor

bleege commented May 4, 2016

Looking into how ScreenshotActivityTest performs it's duties reveals that it has to capture the screenshot a little differently than the traditional model on Android and as a result may be impacting the test process. The traditional screencapture model just grabs the drawing cache from the rootview and dumps it into a Bitmap object (see below), but because the SDK uses TextureViews for OpenGL it has to first traverse the view hierarchy and then generate a Bitmap in memory using low level drawing code. I'm not certain this is causing the issue, but it's a possibility. I'm also thinking that the StictMode setup may be causing this issue to fail as well.

// Traditional Screenshot algorithm
View rootview;
rootview.setDrawingCacheEnabled(true);
Bitmap bitmap1 = rootview.getDrawingCache();

Next Steps

  1. I'm going to disable StrictMode and run the ScreenshotActivityTest alone through AWS Device Farm (try out Filters that @tobrun has been telling me about). This will help eliminate this from being a possibility.
  2. If removing StrictMode doesn't solve it, the next step would be to try using the traditional screenshot model. This will likely produce Bitmaps with empty data in it, but it'd help us further isolate the issue.

/cc @twbell

@bleege
Copy link
Contributor

bleege commented May 4, 2016

I just successfully ran ./gradlew cC -p MapboxGLAndroidSDKTestApp on the commented out StrictMode locally again on my Samsung S5. Next is to upload the same artifacts to AWS and set the Filter to just run ScreenshotActivityTest so that it runs quicker.

screen shot 2016-05-04 at 5 21 36 pm

@bleege
Copy link
Contributor

bleege commented May 4, 2016

I just kicked off a new test run on AWS Device Farm filtered for com.mapbox.mapboxsdk.testapp.espresso.ScreenshotActivityTest only. It's unclear how long this will take to run, but it should be considerably less than the full suite. I'll post back again when this completes.

screen shot 2016-05-04 at 5 29 43 pm

@bleege
Copy link
Contributor

bleege commented May 5, 2016

I stopped the test at 127 out of 130 devices tested as it was clear that removing StrictMode didn't address this issue (see screenshot below). It's becoming more clear to me that that the SDK is running on 4.4.x devices as expected however. I'd still like to get more information on this. To do so the next step is to refactor the ScreenshotActivityTest using the traditional Android Screenshot technique. Yes, it'll likely just produce empty images but it'll help rule out the explicit handling of TextureViews on the main UI thread.

screen shot 2016-05-05 at 12 31 51 pm

_StrictMode Removed Test Run_

@bleege
Copy link
Contributor

bleege commented May 6, 2016

I refactored the code to use the "traditional Android screenshot algorithm" which is entirely Android API View based (see screenshot below) and then ran it locally on the Samsung S5. This local run errored out and produced a stack trace similar to what @tobrun first experienced above. The error seems to be caused by a threading issue with Core GL's notifyMapChange() method.

I'm not sure of the next step at this point. This still seems like an issue with the Testing Framework itself as Mapbox Android SDK does run fine in apps on Android 4.4.x devices (sans testing code).

screen shot 2016-05-05 at 5 11 49 pm
Traditional Android Screenshot Algorithm

05-05 19:05:48.771 20082-20082/? I/DEBUG: *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** ***
05-05 19:05:48.771 20082-20082/? I/DEBUG: Build fingerprint: 'samsung/klteuc/klteatt:5.0/LRX21T/G900AUCU3BOC4:user/release-keys'
05-05 19:05:48.771 20082-20082/? I/DEBUG: Revision: '14'
05-05 19:05:48.771 20082-20082/? I/DEBUG: ABI: 'arm'
05-05 19:05:48.771 20082-20082/? I/DEBUG: pid: 21677, tid: 21700, name: roidJUnitRunner  >>> com.mapbox.mapboxsdk.testapp <<<
05-05 19:05:48.771 20082-20082/? I/DEBUG: signal 6 (SIGABRT), code -6 (SI_TKILL), fault addr --------
05-05 19:05:48.841 20082-20082/? I/DEBUG: Abort message: 'art/runtime/check_jni.cc:65] JNI DETECTED ERROR IN APPLICATION: thread Thread[11,tid=21700,Native,Thread*=0xb4e0f400,peer=0x12df2f40,"Instr: android.support.test.runner.AndroidJUnitRunner"] using JNIEnv* from thread Thread[1,tid=21677,Runnable,Thread*=0xb4e07800,peer=0x86213ef0,"main"]'
05-05 19:05:48.841 20082-20082/? I/DEBUG:     r0 00000000  r1 000054c4  r2 00000006  r3 00000000
05-05 19:05:48.841 20082-20082/? I/DEBUG:     r4 b3affdb8  r5 00000006  r6 00000002  r7 0000010c
05-05 19:05:48.841 20082-20082/? I/DEBUG:     r8 00000000  r9 b4e4f520  sl b4e0f400  fp 00001af0
05-05 19:05:48.841 20082-20082/? I/DEBUG:     ip 000054c4  sp b3afda10  lr b6f14fd1  pc b6f38970  cpsr 60070010
05-05 19:05:48.841 20082-20082/? I/DEBUG: backtrace:
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #00 pc 00037970  /system/lib/libc.so (tgkill+12)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #01 pc 00013fcd  /system/lib/libc.so (pthread_kill+52)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #02 pc 00014beb  /system/lib/libc.so (raise+10)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #03 pc 00011531  /system/lib/libc.so (__libc_android_abort+36)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #04 pc 0000fcbc  /system/lib/libc.so (abort+4)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #05 pc 0021d4f1  /system/lib/libart.so (art::Runtime::Abort()+160)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #06 pc 000a834b  /system/lib/libart.so (art::LogMessage::~LogMessage()+1322)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #07 pc 000b1a79  /system/lib/libart.so (art::JniAbort(char const*, char const*)+1060)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #08 pc 000b1fd5  /system/lib/libart.so (art::JniAbortF(char const*, char const*, ...)+60)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #09 pc 000b504d  /system/lib/libart.so (art::ScopedCheck::ScopedCheck(_JNIEnv*, int, char const*)+1132)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #10 pc 000bc59f  /system/lib/libart.so (art::CheckJNI::CallVoidMethodV(_JNIEnv*, _jobject*, _jmethodID*, std::__va_list)+30)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #11 pc 000c5d9c  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so (_JNIEnv::CallVoidMethod(_jobject*, _jmethodID*, ...)+56)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #12 pc 000c7990  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so (mbgl::android::NativeMapView::notifyMapChange(mbgl::MapChange)+40)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #13 pc 0017e3b0  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so (mbgl::Map::render()+104)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #14 pc 000c5e1c  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so (mbgl::android::NativeMapView::render()+68)
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #15 pc 000e1d9c  /data/app/com.mapbox.mapboxsdk.testapp-1/lib/arm/libmapbox-gl.so
05-05 19:05:48.841 20082-20082/? I/DEBUG:     #16 pc 0014f5ab  /data/dalvik-cache/arm/data@app@com.mapbox.mapboxsdk.testapp-1@base.apk@classes.dex
05-05 19:05:50.181 20082-20082/? I/DEBUG: Tombstone written to: /data/tombstones/tombstone_08

Error Log From Traditional Android Screenshot Algorithm

/cc @tmpsantos @jfirebaugh @kkaefer @brunoabinader

@tobrun
Copy link
Member Author

tobrun commented May 26, 2016

I'm going to remove this from the milestone 4.1.0 since it's not blocking release as @bleege found out in comments above. I'm planning to revisit this when we are going to implement GlSurfaceView in #5000.

@tobrun tobrun removed this from the android-v4.1.0 milestone May 26, 2016
@bleege
Copy link
Contributor

bleege commented May 26, 2016

Should clarify that the reason it's not blocking the release is that the issue has to do with the algorithm to take a screenshot and NOT the Mapbox Android SDK running on Android 4.4 devices.

@tobrun
Copy link
Member Author

tobrun commented Sep 27, 2016

We have now recorded mp4 in Firebase Test Lab. Closing as not relevant anymore.

@tobrun tobrun closed this as completed Sep 27, 2016
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android Mapbox Maps SDK for Android crash tests
Projects
None yet
Development

No branches or pull requests

3 participants