Bug 59312 - Launching photo intent many times causes camera to display black screen
Summary: Launching photo intent many times causes camera to display black screen
Alias: None
Product: Android
Classification: Xamarin
Component: General ()
Version: 7.4 (15.3)
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Jonathan Pryor
URL: https://github.com/Gishe/CameraCrash
Depends on:
Reported: 2017-09-07 20:59 UTC by Sean Irving
Modified: 2017-10-04 17:12 UTC (History)
2 users (show)

Is this bug a regression?: ---
Last known good build:

Log files from the first time the camera loads black screen. (40.63 KB, text/plain)
2017-09-07 20:59 UTC, Sean Irving

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 59312 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description Sean Irving 2017-09-07 20:59:41 UTC
Created attachment 24633 [details]
Log files from the first time the camera loads black screen.

This appears to be only a problem on android Oreo (preview 4 is what we are running)

User can launch the photo intent any number of times.

Launching the photo intent 40-100 times will cause the camera intent to display just a black screen.  Attempting to initialize the camera in the stand alone app or other applications afterwards will result in the same black screen until the device is reset.
Comment 1 Jon Douglas [MSFT] 2017-09-08 20:04:57 UTC
Hey Sean,

Thanks for the logs and sample project, to get a little bit more information on this issue, can you provide the following?

1. Full Version Information (VS Windows - About -> Visual Studio | VS Mac - Visual Studio for Mac -> About)

2. Can you ensure you're on a release version of Oreo? This was released 8/21/2017 for most devices. You can opt into the beta program to get a release version of Oreo before your carrier sends an update.

3. Your sample does not compile after directly downloading, it is missing drawables and other items. If you can please fix this, I can look into this further.

My first impressions on this issue is that it might be an actual bug with Oreo and might be able to be reproduced in Java/Kotlin as well. I don't believe we do anything special and these bindings should be pretty straight forward. At the point you're noticing a screen going black, I would assume this is a OS issue rather than Xamarin issue. However I will need a working sample project first to investigate further.

Setting this to NEEDINFO until the project is tidied up. Thanks again for the report.
Comment 2 Sean Irving 2017-09-08 20:27:38 UTC
Sorry about the sample project it should be updated to build now.

Below is the visual studio data you requested, I'm using a flashed version of bullhead from 06-23-17 on a Nexus 5x.

Microsoft Visual Studio Professional 2015
Version 14.0.25431.01 Update 3
Microsoft .NET Framework
Version 4.7.02046

Installed Version: Professional

Visual Basic 2015   00322-50350-19114-AA005
Microsoft Visual Basic 2015

Visual C# 2015   00322-50350-19114-AA005
Microsoft Visual C# 2015

Visual C++ 2015   00322-50350-19114-AA005
Microsoft Visual C++ 2015

Windows Phone SDK 8.0 - ENU   00322-50350-19114-AA005
Windows Phone SDK 8.0 - ENU

Application Insights Tools for Visual Studio Package   7.18.00214.2
Application Insights Tools for Visual Studio

ASP.NET and Web Tools 2015.1 (Beta8)   14.1.11107.0
ASP.NET and Web Tools 2015.1 (Beta8)

ASP.NET Web Frameworks and Tools 2012.2   4.1.41102.0
For additional information, visit http://go.microsoft.com/fwlink/?LinkID=309563

ASP.NET Web Frameworks and Tools 2013   5.2.40314.0
For additional information, visit http://www.asp.net/

AWS Toolkit for Visual Studio 2015
AWS Toolkit for Visual Studio 2015.
Copyright 2011-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.

This software includes third party software subject to the following copyrights:
- Logging from log4net, Apache License 
- Putty for PPK to PEM conversion, MIT license 
- NGit for AWS Elastic Beanstalk incremental push
- NSch dependency for NGit
- Sharpen dependency for NGit
- ICSharpCode.SharpZipLib dependency for NGit
- Mono.Posix.dll and Mono.Security.dll dependencies for NGit
- MPFProj for Visual Studio Project Framework
- JSON Checker for JSON validation

Common Azure Tools   1.8
Provides common services for use by Azure Mobile Services and Microsoft Azure Tools.

DevExpress.DeploymentTool   1.0
A useful tool for deploying DevExpress assemblies.

JavaScript Language Service   2.0
JavaScript Language Service

JavaScript Project System   2.0
JavaScript Project System

JetBrains ReSharper Ultimate 2017.1.3    Build 108.0.20170613.154143
JetBrains ReSharper Ultimate package for Microsoft Visual Studio. For more information about ReSharper Ultimate, visit http://www.jetbrains.com/resharper. Copyright © 2017 JetBrains, Inc.

Merq   1.1.17-rc (cba4571)
Command Bus, Event Stream and Async Manager for Visual Studio extensions.

Microsoft Azure Mobile Services Tools   1.4
Microsoft Azure Mobile Services Tools

Mono Debugging for Visual Studio   4.6.8-pre (ec7034f)
Support for debugging Mono processes with Visual Studio.

Node.js Tools   1.2.40726.00
Adds support for developing and debugging Node.js apps in Visual Studio

Node.js Tools - Profiling   1.2.40726.00
Profiling support for Node.js projects.

NuGet Package Manager   3.4.4
NuGet Package Manager in Visual Studio. For more information about NuGet, visit http://docs.nuget.org/.

PreEmptive Analytics Visualizer   1.2
Microsoft Visual Studio extension to visualize aggregated summaries from the PreEmptive Analytics product.

SQL Server Data Tools   14.0.60519.0
Microsoft SQL Server Data Tools

TypeScript tools for Visual Studio

Xamarin (b63523e27)
Visual Studio extension to enable development for Xamarin.iOS and Xamarin.Android.

Xamarin.Android (2851083)
Visual Studio extension to enable development for Xamarin.Android.

Xamarin.iOS (80b8487)
Visual Studio extension to enable development for Xamarin.iOS.

XtraReports package   1.0
XtraReports package
Comment 3 Jon Douglas [MSFT] 2017-09-08 20:39:05 UTC
Hi Sean,

Thanks for getting that done so quickly. Can you please update your device with a newer image such as:

8.0.0 (OPR6.170623.013, Aug 2017)


Or simply opt into the beta program and install the Android Oreo release that way.

Can you then please test out and see if this behavior is still occurring? If so, then I will take a further look into this on the Java/Kotlin side and see if this is an OS issue or Xamarin issue.

You might ask "Why do I have to upgrade?" The reason being is that preview images are often very buggy and a final release version should indicate if the bug was fixed or not. 

Thanks in advance! Once you've done that, I will start my investigation.
Comment 4 Sean Irving 2017-09-08 20:43:02 UTC
Sorry for the confusion that is the android image I flashed I was assuming the numbers in the file were the build date.
Comment 5 Jon Douglas [MSFT] 2017-10-04 17:12:47 UTC
(In reply to Sean Irving from comment #4)
> Sorry for the confusion that is the android image I flashed I was assuming
> the numbers in the file were the build date.

Hi Sean, 

No worries. I am still unable to reproduce this issue on released to wild versions of Android Oreo on a Pixel and Android Oreo emulators. Is this still an issue? Have you perhaps tried a simple Java (Android) application based on your reproduction to see if it's just a hardware issue?