jraska / falcon Goto Github PK
View Code? Open in Web Editor NEWTake Android screenshots with Falcons bright eye!
License: Apache License 2.0
Take Android screenshots with Falcons bright eye!
License: Apache License 2.0
Can i take screenshoot of fragment with GoogleMaps ?
Hi,
I'm trying to use FalconSpoon in my espresso tests, but I keep getting java.lang.NoClassDefFoundError: Failed resolution of: Lcom/squareup/spoon/SpoonRule
That's what I have is buld.gradle:
implementation 'com.jraska:falcon:2.0.1'
implementation 'com.jraska:falcon-spoon-compat:2.0.1'
androidTestImplementation 'com.jraska:falcon:2.0.1'
androidTestImplementation 'com.jraska:falcon-spoon-compat:2.0.1'
I also tried to add dependency to spoon itself, but it doesn't help. I'm able to use Falcon methods, only FalconSpoonRule is a problem.
Gradle build is successful, error appears in runtime (tests are written in Kotlin)
I disabled proguard for this build.
Any suggestions?
The falcon library works great across android versions. But i see a concern with lollipop. When the view gets updated, eg: Tap on edit text and start typing. Now use falcon to capture screen . The screen shot has old view where it was not updated. However it works well on jelly bean,kit kat, marshmallow,nougat & Oreo.
Thanks.
How to take screenshot of textureview alongwith otherviews ?
In one of my only WebView activities, I can't capture the contents of the WebView. Other Views can be capture.
I am using https://github.com/yqritc/Android-ScalableVideoView to render a video stream in a TextureView.
I tried FalconSpoon, but the stream is not included in the screenshot.
Is it related to the fact that ScalableVideoView is using MediaPlayer? Any help/workaround is much appreciated.
Hello,
My application is capturing screen shot in every 500ms using your library to gether user behavior imformation, everything working fine until progress dialog shown by app, after it appear in every frame even though its been dismissed in application but its still showing in frame or screenshot. Only facing this problem with progress dialog , alert dialog or other custom dialog box working fine.
Please check the attached GIF
Processing image progress dialog stick to frames.
Sometimes there is a fall.
I think it is related to the display of dialogs
Fatal Exception: java.lang.NullPointerException: Attempt to read from field 'android.graphics.Rect android.view.View$AttachInfo.mTmpInvalRect' on a null object reference
at android.view.View.onDrawScrollIndicators(View.java:14742)
at android.view.View.onDrawForeground(View.java:18706)
at android.view.View.draw(View.java:17200)
at android.widget.AbsListView.draw(AbsListView.java:4322)
at android.view.View.draw(View.java:17097)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17095)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17095)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17095)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17095)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17095)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17095)
at android.view.ViewGroup.drawChild(ViewGroup.java:3727)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:3513)
at android.view.View.draw(View.java:17192)
at com.android.internal.policy.DecorView.draw(DecorView.java:756)
-> at com.jraska.falcon.Falcon.drawRootToBitmap(Falcon.java:162)
-> at com.jraska.falcon.Falcon.drawRootsToBitmap(Falcon.java:147)
-> at com.jraska.falcon.Falcon.access$300(Falcon.java:29)
-> at com.jraska.falcon.Falcon$1.run(Falcon.java:132)**
at android.os.Handler.handleCallback(Handler.java:751)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:154)
at android.app.ActivityThread.main(ActivityThread.java:6186)
at java.lang.reflect.Method.invoke(Method.java)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:889)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:779)
Maybe you can add catch to this block:
activity.runOnUiThread(new Runnable() {
@Override
public void run() {
try {
drawRootsToBitmap(viewRoots, bitmap);
} finally {
latch.countDown();
}
}
});
Thanks for your work.
I use SpoonFalcon to capture dialog from the material-dialog lib https://github.com/afollestad/material-dialogs
When I capture, I get this:
Nothing on the log, tried 2 times = same results
If there is a mapview in the layout it is being rendered as black solid with only Google logo on it.
FAILURE: Build failed with an exception.
* Where:
Script '/Users/vbauer/Documents/workspace/java/apkmaster/temp/src/Falcon-master/gradle/bintrayv1.gradle' line: 12
* What went wrong:
A problem occurred evaluating script.
> android.buildToolsVersion is missing!
* Try:
Run with --info or --debug option to get more log output.
* Exception is:
org.gradle.api.GradleScriptException: A problem occurred evaluating script.
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:93)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:157)
at org.gradle.configuration.DefaultScriptTarget.addConfiguration(DefaultScriptTarget.java:69)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:162)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.applyScript(DefaultObjectConfigurationAction.java:102)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.access$000(DefaultObjectConfigurationAction.java:36)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction$1.run(DefaultObjectConfigurationAction.java:62)
at org.gradle.api.internal.plugins.DefaultObjectConfigurationAction.execute(DefaultObjectConfigurationAction.java:136)
at org.gradle.api.internal.project.AbstractPluginAware.apply(AbstractPluginAware.java:46)
at org.gradle.api.plugins.PluginAware$apply.call(Unknown Source)
at org.gradle.api.internal.project.ProjectScript.apply(ProjectScript.groovy:35)
at org.gradle.api.Script$apply$0.callCurrent(Unknown Source)
at build_d111qgg3u101ytfw7abp5cmmu.run(/Users/vbauer/Documents/workspace/java/apkmaster/temp/src/Falcon-master/falcon/build.gradle:53)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl$2.run(DefaultScriptPluginFactory.java:157)
at org.gradle.configuration.ProjectScriptTarget.addConfiguration(ProjectScriptTarget.java:72)
at org.gradle.configuration.DefaultScriptPluginFactory$ScriptPluginImpl.apply(DefaultScriptPluginFactory.java:162)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:38)
at org.gradle.configuration.project.BuildScriptProcessor.execute(BuildScriptProcessor.java:25)
at org.gradle.configuration.project.ConfigureActionsProjectEvaluator.evaluate(ConfigureActionsProjectEvaluator.java:34)
at org.gradle.configuration.project.LifecycleProjectEvaluator.evaluate(LifecycleProjectEvaluator.java:55)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:529)
at org.gradle.api.internal.project.AbstractProject.evaluate(AbstractProject.java:90)
at org.gradle.execution.TaskPathProjectEvaluator.configureHierarchy(TaskPathProjectEvaluator.java:47)
at org.gradle.configuration.DefaultBuildConfigurer.configure(DefaultBuildConfigurer.java:35)
at org.gradle.initialization.DefaultGradleLauncher$2.run(DefaultGradleLauncher.java:125)
at org.gradle.internal.Factories$1.create(Factories.java:22)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:52)
at org.gradle.initialization.DefaultGradleLauncher.doBuildStages(DefaultGradleLauncher.java:122)
at org.gradle.initialization.DefaultGradleLauncher.access$200(DefaultGradleLauncher.java:32)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:99)
at org.gradle.initialization.DefaultGradleLauncher$1.create(DefaultGradleLauncher.java:93)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:90)
at org.gradle.internal.progress.DefaultBuildOperationExecutor.run(DefaultBuildOperationExecutor.java:62)
at org.gradle.initialization.DefaultGradleLauncher.doBuild(DefaultGradleLauncher.java:93)
at org.gradle.initialization.DefaultGradleLauncher.run(DefaultGradleLauncher.java:82)
at org.gradle.launcher.exec.InProcessBuildActionExecuter$DefaultBuildController.run(InProcessBuildActionExecuter.java:94)
at org.gradle.tooling.internal.provider.ExecuteBuildActionRunner.run(ExecuteBuildActionRunner.java:28)
at org.gradle.launcher.exec.ChainingBuildActionRunner.run(ChainingBuildActionRunner.java:35)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:43)
at org.gradle.launcher.exec.InProcessBuildActionExecuter.execute(InProcessBuildActionExecuter.java:28)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:81)
at org.gradle.launcher.exec.ContinuousBuildActionExecuter.execute(ContinuousBuildActionExecuter.java:46)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:51)
at org.gradle.launcher.exec.DaemonUsageSuggestingBuildActionExecuter.execute(DaemonUsageSuggestingBuildActionExecuter.java:28)
at org.gradle.launcher.cli.RunBuildAction.run(RunBuildAction.java:43)
at org.gradle.internal.Actions$RunnableActionAdapter.execute(Actions.java:173)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:241)
at org.gradle.launcher.cli.CommandLineActionFactory$ParseAndBuildAction.execute(CommandLineActionFactory.java:214)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:35)
at org.gradle.launcher.cli.JavaRuntimeValidationAction.execute(JavaRuntimeValidationAction.java:24)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:207)
at org.gradle.launcher.cli.CommandLineActionFactory$WithLogging.execute(CommandLineActionFactory.java:169)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:33)
at org.gradle.launcher.cli.ExceptionReportingAction.execute(ExceptionReportingAction.java:22)
at org.gradle.launcher.Main.doAction(Main.java:33)
at org.gradle.launcher.bootstrap.EntryPoint.run(EntryPoint.java:45)
at org.gradle.launcher.bootstrap.ProcessBootstrap.runNoExit(ProcessBootstrap.java:55)
at org.gradle.launcher.bootstrap.ProcessBootstrap.run(ProcessBootstrap.java:36)
at org.gradle.launcher.GradleMain.main(GradleMain.java:23)
at org.gradle.wrapper.BootstrapMainStarter.start(BootstrapMainStarter.java:33)
at org.gradle.wrapper.WrapperExecutor.execute(WrapperExecutor.java:130)
at org.gradle.wrapper.GradleWrapperMain.main(GradleWrapperMain.java:48)
Caused by: java.lang.NullPointerException: android.buildToolsVersion is missing!
at com.google.common.base.Preconditions.checkNotNull(Preconditions.java:229)
at com.android.build.gradle.internal.SdkHandler.initTarget(SdkHandler.java:106)
at com.android.build.gradle.BaseExtension.ensureTargetSetup(BaseExtension.java:847)
at com.android.build.gradle.BaseExtension.getBootClasspath(BaseExtension.java:738)
at com.android.build.gradle.LibraryExtension_Decorated.getBootClasspath(Unknown Source)
at com.android.build.gradle.LibraryExtension_Decorated$getBootClasspath.call(Unknown Source)
at bintrayv1_c7pdc6v2hyvwibat7lzck7kjt$_run_closure2.doCall(/Users/vbauer/Documents/workspace/java/apkmaster/temp/src/Falcon-master/gradle/bintrayv1.gradle:12)
at org.gradle.api.internal.ClosureBackedAction.execute(ClosureBackedAction.java:67)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:130)
at org.gradle.util.ConfigureUtil.configure(ConfigureUtil.java:110)
at org.gradle.api.internal.AbstractTask.configure(AbstractTask.java:488)
at org.gradle.api.internal.project.AbstractProject.task(AbstractProject.java:928)
at org.gradle.api.internal.BeanDynamicObject$MetaClassAdapter.invokeMethod(BeanDynamicObject.java:236)
at org.gradle.api.internal.BeanDynamicObject.invokeMethod(BeanDynamicObject.java:130)
at org.gradle.api.internal.CompositeDynamicObject.invokeMethod(CompositeDynamicObject.java:150)
at org.gradle.groovy.scripts.BasicScript.methodMissing(BasicScript.java:79)
at bintrayv1_c7pdc6v2hyvwibat7lzck7kjt.run(/Users/vbauer/Documents/workspace/java/apkmaster/temp/src/Falcon-master/gradle/bintrayv1.gradle:10)
at org.gradle.groovy.scripts.internal.DefaultScriptRunnerFactory$ScriptRunnerImpl.run(DefaultScriptRunnerFactory.java:91)
... 63 more
Can we not throw UnableToTakeScreenshotException
? See https://github.com/jraska/Falcon/blob/master/falcon/src/main/java/com/jraska/falcon/Falcon.java#L65.
I am seeing a few tests fail because of failing to take a screenshot. The tests I am seeing fail are usually very stable. Can we just log the screenshot failure? The screenshots are nice to have but I do not have to have them. I just want my assertions to pass.
Hi,
I have used your library for testing but it's saving blank for surface views.
Can you update the README to make it clear that you still need to declare
androidTestImplementation 'com.jraska:falcon:2.0.1'
even if you are using
androidTestImplementation 'com.jraska:falcon-spoon-compat:2.0.1'
I initially didn't include the falcon
dependency since I assumed that it would be pulled in as part of falcon-spoon-compat
. But when I did I got the following runtime error:
java.lang.NoClassDefFoundError: Failed resolution of: Lcom/jraska/falcon/Falcon;
at com.jraska.falcon.FalconSpoonRule.screenshot(FalconSpoonRule.java:42)
...
Caused by: java.lang.ClassNotFoundException: Didn't find class "com.jraska.falcon.Falcon" on path: DexPathList[[...]]
Hello, help me please. I need to screen cameraview, but screenshot saves everything (buttons etc.) besides previewview
previewView = findViewById(R.id.view_finder);
imageButtonCapture = findViewById(R.id.camera_capture_button);
imageButtonCapture.setOnClickListener(new View.OnClickListener() {
@Override
public void onClick(View view) {
SimpleDateFormat mDateFormat = new SimpleDateFormat("yyyyMMddHHmmss", Locale.US);
File photofile = new File(getBatchDirectoryName(), mDateFormat.format(new Date())+ ".jpeg");
Falcon.takeScreenshot(MainActivity.this, photofile);
}
});
Thanks!
Hello,
I am trying to take multiple screenshots from a Lottie animation which is used in my app but it seems that Falcon takes a screenshot only from the very first instance of the animation and not the whole movement.
Is it a known issue? Can the Falcon be enhanced in order to cover this incompatibility?
Thanks a lot in advance!!!
Best regards,
Nikos
I have a test that closes the main activity and then takes a screenshot. On this the activity passed as function parameter can be seen, despite in reality the home dashboard of the phone is shown, is this because the screenshot function uses internally the espresso screenshot function and not UiDevice.takescreenshot()? Is there a way I can use Falcon and get what I am really seeing on the screen?
https://jfrog.com/blog/into-the-sunset-bintray-jcenter-gocenter-and-chartcenter/
Edit: UPDATE 4/27/2021: We listened to the community and will keep JCenter as a read-only repository indefinitely. Our customers and the community can continue to rely on JCenter as a reliable mirror for Java packages.
The following crash occurs on various layouts like FrameLayout, CoordinatorLayout, RelativeLayout, TabLayout, android.support.v4.widget.NestedScrollView, AppBarLayout, Custom Views, CoordinatorLayout, etc. The crash happens mostly while I touch/swipe on any view which is in a ListView inside ViewPager and tabs. App does not crash without using Falcon.
java.lang.IllegalStateException: View with id -1: android.support.design.widget.TabLayout$TabView#onMeasure() did not set the measured dimension by calling setMeasuredDimension()
at android.view.View.measure(View.java:19199)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
at android.widget.LinearLayout.measureHorizontal(LinearLayout.java:1275)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:650)
at android.support.design.widget.TabLayout$SlidingTabStrip.onMeasure(TabLayout.java:1859)
at android.view.View.measure(View.java:19169)
at android.widget.HorizontalScrollView.measureChildWithMargins(HorizontalScrollView.java:1259)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
at android.widget.HorizontalScrollView.onMeasure(HorizontalScrollView.java:315)
at android.support.design.widget.TabLayout.onMeasure(TabLayout.java:1030)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
at android.support.design.widget.AppBarLayout.onMeasure(AppBarLayout.java:234)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.support.design.widget.CoordinatorLayout.onMeasureChild(CoordinatorLayout.java:719)
at android.support.design.widget.AppBarLayout$Behavior.onMeasureChild(AppBarLayout.java:1008)
at android.support.design.widget.AppBarLayout$Behavior.onMeasureChild(AppBarLayout.java:787)
at android.support.design.widget.CoordinatorLayout.onMeasure(CoordinatorLayout.java:789)
at android.view.View.measure(View.java:19169)
at android.widget.RelativeLayout.measureChild(RelativeLayout.java:786)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:560)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
at android.view.View.measure(View.java:19169)
at android.support.v4.widget.DrawerLayout.onMeasure(DrawerLayout.java:1060)
at android.view.View.measure(View.java:19169)
at android.widget.RelativeLayout.measureChild(RelativeLayout.java:786)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:560)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
at android.view.View.measure(View.java:19169)
at android.widget.RelativeLayout.measureChildHorizontal(RelativeLayout.java:825)
at android.widget.RelativeLayout.onMeasure(RelativeLayout.java:511)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
at android.support.v7.widget.ContentFrameLayout.onMeasure(ContentFrameLayout.java:139)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.LinearLayout.measureChildBeforeLayout(LinearLayout.java:1723)
at android.widget.LinearLayout.measureVertical(LinearLayout.java:788)
at android.widget.LinearLayout.onMeasure(LinearLayout.java:648)
at android.view.View.measure(View.java:19169)
at android.view.ViewGroup.measureChildWithMargins(ViewGroup.java:6124)
at android.widget.FrameLayout.onMeasure(FrameLayout.java:223)
at com.android.internal.policy.PhoneWindow$DecorView.onMeasure(PhoneWindow.java:2747)
at android.view.View.measure(View.java:19169)
at android.view.ViewRootImpl.performMeasure(ViewRootImpl.java:2485)
at android.view.ViewRootImpl.measureHierarchy(ViewRootImpl.java:1444)
at android.view.ViewRootImpl.performTraversals(ViewRootImpl.java:1698)
at android.view.ViewRootImpl.doTraversal(ViewRootImpl.java:1325)
at android.view.ViewRootImpl$TraversalRunnable.run(ViewRootImpl.java:6741)
at android.view.Choreographer$CallbackRecord.run(Choreographer.java:912)
at android.view.Choreographer.doCallbacks(Choreographer.java:714)
at android.view.Choreographer.doFrame(Choreographer.java:649)
at android.view.Choreographer$FrameDisplayEventReceiver.run(Choreographer.java:898)
at android.os.Handler.handleCallback(Handler.java:815)
at android.os.Handler.dispatchMessage(Handler.java:104)
at android.os.Looper.loop(Looper.java:207)
at android.app.ActivityThread.main(ActivityThread.java:5769)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:789)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:679)
Following is the same exception but on different layout, rest of the log remains same as above log:
java.lang.IllegalStateException: View with id 2131296790: android.support.design.widget.CoordinatorLayout#onMeasure() did not set the measured dimension by calling setMeasuredDimension()
And sometimes the crash log comes without any layout mentioned:
java.lang.IllegalStateException: onMeasure() did not set the measured dimension by calling setMeasuredDimension()
When using Falcon with Spoon for instrumentation tests, this exception appears sporadically :
The stack trace:
java.lang.NullPointerException: Attempt to invoke virtual method 'void android.view.View.draw(android.graphics.Canvas)' on a null object reference
at com.jraska.falcon.Falcon.drawRootToBitmap(Falcon.java:148)
at com.jraska.falcon.Falcon.drawRootsToBitmap(Falcon.java:133)
at com.jraska.falcon.Falcon.access$100(Falcon.java:25)
at com.jraska.falcon.Falcon$1.run(Falcon.java:117)
at android.os.Handler.handleCallback(Handler.java:739)
at android.os.Handler.dispatchMessage(Handler.java:95)
at android.os.Looper.loop(Looper.java:135)
at android.app.ActivityThread.main(ActivityThread.java:5254)
at java.lang.reflect.Method.invoke(Native Method)
at java.lang.reflect.Method.invoke(Method.java:372)
at com.android.internal.os.ZygoteInit$MethodAndArgsCaller.run(ZygoteInit.java:903)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:698)
I could add the full Spoon trace if needed.
What about Here Maps?
When writing UI tests with espresso the captured FalconSpoon screenshot does not include the dialog I expect to be there.
Open Activity
Trigger dialog (AlertDialog.create...show());
verify that the dialog is present with:
onView(withText("hello dialog").check(matches(isDisplayed()));
FalconSpoon.screenshot(getActivity(), "Dialog_test");
java is too old school :P
Hi @jraska,
We dig into your library last week to take screenshots in our android app. You've done an amazing work and results are almost perfect for us.
We were not able to capture shadows around material components: Card, Floating Action Buttons, ... (https://material.io/develop/android/).
On a generic aspect, did you try to capture shadows? Is this something technically possible for you?
Thanks for your work and help!
Thomas
Seeing this failure on an API 29 emulator.
com.jraska.falcon.Falcon$UnableToTakeScreenshotException: Unable to take screenshot to file /sdcard/screenshots/myScrenshot of activity com.central.RootActivity
at com.jraska.falcon.Falcon.takeScreenshot(Falcon.java:67)
at com.affirm.central.utils.ScreenshotKt.internalScreenshot(Screenshot.kt:38)
at com.affirm.central.utils.ScreenshotKt.screenshot(Screenshot.kt:24)
at com.my.test.sometest
... 45 trimmed
Caused by: java.io.FileNotFoundException: /sdcard/screenshots/myScreenshot: open failed: ENOENT (No such file or directory)
at libcore.io.IoBridge.open(IoBridge.java:496)
at java.io.FileOutputStream.<init>(FileOutputStream.java:235)
at java.io.FileOutputStream.<init>(FileOutputStream.java:186)
at com.jraska.falcon.Falcon.writeBitmap(Falcon.java:183)
at com.jraska.falcon.Falcon.takeScreenshot(Falcon.java:61)
... 49 more
Caused by: android.system.ErrnoException: open failed: ENOENT (No such file or directory)
at libcore.io.Linux.open(Native Method)
at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
at libcore.io.BlockGuardOs.open(BlockGuardOs.java:252)
at libcore.io.ForwardingOs.open(ForwardingOs.java:167)
at android.app.ActivityThread$AndroidOs.open(ActivityThread.java:7255)
at libcore.io.IoBridge.open(IoBridge.java:482)
My activity consists of a couple of AutoCompleteTextView and TextInputEditText which are wrapped in TextInputLayout. The issue which I am facing is that when I take the first screenshot, all the details get captured perfectly. Later on, when we edit the AutoCompleteTextView and TextInputEditText fields and if we were to take a screenshot, the details are not reflected.
Could you please help with this issue?
I am using this method for taking screenshots Falcon.takeScreenshotBitmap(activity).
My XML which comprises of AutoCompleteTextView and TextInputEditText fields looks like:
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox.ExposedDropdownMenu"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/form_username">
<AutoCompleteTextView
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
<com.google.android.material.textfield.TextInputLayout
style="@style/Widget.MaterialComponents.TextInputLayout.OutlinedBox"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:hint="@string/form_username">
<com.google.android.material.textfield.TextInputEditText
android:layout_width="match_parent"
android:layout_height="wrap_content"/>
</com.google.android.material.textfield.TextInputLayout>
UPDATE: If we remove the style attribute then it works fine. The issue is that we cannot remove the style attribute because of a few limitations. Would be great if you could help me out with this issue @jraska
Attempted to take a screenshot of the background, so that I could blur it when showing the dialog. However, Falcon screenshot generates only a Bitmap with the Activity view, and completely ignoring the overlay that contains a Fragment.
For example:
Before showing the dialog, I take a screenshot and blur it before setting it on the image. Here is what I get:
I have examined the screenshot even on file, and see that it completely ignores the overlaying window. I thought multi-window screenshot is supported by Falcon, right? What could be the issue here? Please help.
Could you please explain why following 2 additions are necessary?:
compile 'com.jraska:falcon:1.0.3'
androidTestCompile 'com.jraska:falcon-spoon-compat:1.0.3'
What's the difference between both?
Please help.
i'm getting this exception
"Attempt to read from field 'android.graphics.Rect android.view.View$AttachInfo.mTmpInvalRect' on a null object reference"
This exception occurs occasionally.
Could not find exact issue.
Calling .takeScreenshotBitmap() inside a ScheduledThreadPoolExecutor to take ScreenShots continuously (5 ScreenShots per sec).
Should i call the function .takeScreenshotBitmap() on UI thread?
Thanks.
We were initially using Spoon + Falcon. We then switched to using Composer + Falcon. We kept using Falcon cause it's a great library and because it will in-turn match Spoon's file location format, which is needed for Composer read more
The problem we are facing now is that Falcon still depends on Spoon, specifically a snapshot version of 2.x. This is causing a lot of problems for build times (gradle always checks for new snapshot) and for remote devs w/ bad network connection.
We love using Falcon but can't afford the dynamic Spoon dependency. We're asking that you package or shade the Spoon dependency with falcon-spoon
.
I know it would be weird to shade/package a "snapshot" version. But as long each release of falcon-spoon
release notes referenced the Spoon snapshot commit SHA, other devs could decide to update to latest Falcon (or not).
高德地图导航过程中,截取到的地图部分view是空的
Your tool use reflection on some Field which are block by the SDK on API 28. When the target is 28 you get an Exception :
com.jraska.falcon.Falcon$UnableToTakeScreenshotException: java.lang.NoSuchFieldException: Field mWindowTop not found for class class android.view.View$AttachInfo
See the documentation here :
https://developer.android.com/about/versions/pie/restrictions-non-sdk-interfaces
And a working fix is to set system property from adb to disable this restriction :
adb shell settings put global hidden_api_policy_pre_p_apps 1 adb shell settings put global hidden_api_policy_p_apps 1
A solution would be to ask to Google to allow access to the fields mWindowTop, mWindowLeft
I'm trying to use Falcon in my app, but it seems to don't save the view of DialogFragments and AlertDialogs. It seems strange, but my app looks nearly same as your sample.
public class MyActivity extends AppCompatActivity {
@Override
protected void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_main);
Toolbar toolbar = (Toolbar) findViewById(R.id.toolbar);
setSupportActionBar(toolbar);
Toast.makeText(this, "Asd", Toast.LENGTH_LONG).show();
Snackbar.make(findViewById(android.R.id.content), "snackbar", Snackbar.LENGTH_LONG);
AlertDialog.Builder builder = new AlertDialog.Builder(this);
builder.setTitle("Falcon");
builder.setMessage("Click button below to take screenshot with dialog");
builder.setPositiveButton("Screenshot", new DialogInterface.OnClickListener() {
@Override
public void onClick(DialogInterface dialog, int which) {
try {
Falcon.takeScreenshot(this, File.createTempFile("asd", "asd"));
} catch(IOException e) {
e.printStackTrace();
}
}
});
builder.show();
// new DialogFragment().show(getSupportFragmentManager(), "DIALOG");
}
Screenshot has view of activity, with Toast and Snackbar, but the dialog is missing. Same for DialogFragment (commented out).
I was using this code.
I am facing sluggish issue while taking the screenshots during scrolling. Just a little discontinuity, so no smooth scrolling.
I tried debugging, and I narrowed down which part of the code is giving this, where we are posting a task on UiThread to capture screenshots and overlap in the case of multiple views.
activity.runOnUiThread(new Runnable() {
@OverRide
public void run() {
try {
drawRootsToBitmap(viewRoots, bitmap);
} finally {
latch.countDown();
}
}
});
latch.await();
}
But I did not found any solution.
Can you help me out to make it smooth?
Hi,
After adding compile 'com.jraska:falcon:1.0.1'
in my client-android (on line 62, but not visible here as it is not commited), I get a gradle error: Failed to resolve: com.jraska:falcon:1.0.1
.
Do I miss something in the integration?
Thanks
I need a way to screencap the android status bar while falcon or spoon takes a screenshot
The app crashes because the device does not support hardware bitmaps.
Device: Xiaomi Redmi 6 Pro
Os: 8.1.0, MIUI Global 10.0
Logs:
java.lang.IllegalStateException: Software rendering doesn't support hardware bitmaps
at android.graphics.BaseCanvas.throwIfHwBitmapInSwMode(BaseCanvas.java:532)
at android.graphics.BaseCanvas.throwIfCannotDraw(BaseCanvas.java:62)
at android.graphics.BaseCanvas.drawBitmap(BaseCanvas.java:120)
at android.graphics.Canvas.drawBitmap(Canvas.java:1434)
at android.graphics.drawable.BitmapDrawable.draw(BitmapDrawable.java:529)
at coil.drawable.CrossfadeDrawable.draw(CrossfadeDrawable.kt:69)
at android.widget.ImageView.onDraw(ImageView.java:1367)
at android.view.View.draw(View.java:19226)
at android.view.View.draw(View.java:19096)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19229)
at android.view.View.draw(View.java:19096)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at androidx.recyclerview.widget.RecyclerView.drawChild(RecyclerView.java:5030)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19229)
at androidx.recyclerview.widget.RecyclerView.draw(RecyclerView.java:4429)
at android.view.View.draw(View.java:19096)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19229)
at androidx.core.widget.NestedScrollView.draw(NestedScrollView.java:1998)
at android.view.View.draw(View.java:19096)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
at android.view.View.draw(View.java:19229)
at android.view.View.draw(View.java:19096)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at androidx.fragment.app.FragmentContainerView.drawChild(FragmentContainerView.java:235)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at androidx.fragment.app.FragmentContainerView.dispatchDraw(FragmentContainerView.java:223)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at androidx.constraintlayout.widget.ConstraintLayout.dispatchDraw(ConstraintLayout.java:1882)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19094)
at android.view.ViewGroup.drawChild(ViewGroup.java:4240)
2020-11-17 13:33:17.681 28782-28782/**** E/Falcon: at android.view.ViewGroup.dispatchDraw(ViewGroup.java:4024)
at android.view.View.draw(View.java:19229)
at com.android.internal.policy.DecorView.draw(DecorView.java:791)
at com.jraska.falcon.Falcon.drawRootToBitmap(Falcon.java:177)
at com.jraska.falcon.Falcon.drawRootsToBitmap(Falcon.java:162)
at com.jraska.falcon.Falcon.takeBitmapUnchecked(Falcon.java:127)
at com.jraska.falcon.Falcon.takeScreenshotBitmap(Falcon.java:90)
at com.linkedin.android.shaky.Shaky.getScreenshotBitmap(Shaky.java:226)
at com.linkedin.android.shaky.Shaky.doStartFeedbackFlow(Shaky.java:143)
at com.linkedin.android.shaky.Shaky.access$100(Shaky.java:49)
at com.linkedin.android.shaky.Shaky$1.onReceive(Shaky.java:259)
at androidx.localbroadcastmanager.content.LocalBroadcastManager.executePendingBroadcasts(LocalBroadcastManager.java:313)
at androidx.localbroadcastmanager.content.LocalBroadcastManager$1.handleMessage(LocalBroadcastManager.java:121)
at android.os.Handler.dispatchMessage(Handler.java:106)
at android.os.Looper.loop(Looper.java:171)
at android.app.ActivityThread.main(ActivityThread.java:6651)
at java.lang.reflect.Method.invoke(Native Method)
at com.android.internal.os.RuntimeInit$MethodAndArgsCaller.run(RuntimeInit.java:547)
at com.android.internal.os.ZygoteInit.main(ZygoteInit.java:824)```
Probably due to not cleaning the local build, it is present in aar. New release will follow.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.