Bug 13329 - Camera Intent OnActivityResult() not firing after Android SDK Update
Summary: Camera Intent OnActivityResult() not firing after Android SDK Update
Status: RESOLVED INVALID
Alias: None
Product: Android
Classification: Xamarin
Component: Debugger ()
Version: 4.6.x
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: dean.ellis
URL:
Depends on:
Blocks:
 
Reported: 2013-07-18 17:42 UTC by tony
Modified: 2014-07-28 16:03 UTC (History)
3 users (show)

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


Attachments
Test case, source only (11.41 KB, application/zip)
2013-07-18 20:41 UTC, Brendan Zagaeski (Xamarin Team, assistant)
Details


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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED INVALID

Description tony 2013-07-18 17:42:32 UTC
I did an upgraded on the SDK's after it suggested so when I opened the Android SDK Manager one day.

Since then, when using any emulator and my app takes a photo, it stops and does nothing. 
 
The OnActivityResult() method never gets called. 

When I plug in my Galaxy S2 and run the same code, the OnActivityResult() fires as normal. 


I tried many variations of emulators with the different API levels and
SDK's, all result in the same issue. I completely uninstalled all of the
sdks and the SDK Manager, using the Control Panel. 

I also uninstalled Xamarin completely.

I then reinstalled everything and got the same results.

I even installed the latest Alpha release of Xamarin to see if that would solve it and it didn't so I reverted to the 4.0 version.


I created a new basic project that captures an image with the same results which is available here..
https://drive.google.com/folderview?id=0B9tkxB27KRlfamJnOThCV2F0dkU&usp=sharing

I uploaded the contents of my \Android SDK\Platforms\android-17\ folder here
https://drive.google.com/folderview?id=0B9tkxB27KRlfMUxEUTJ1amF3Mms&usp=sharing

I uploaded my emulator here
https://drive.google.com/folderview?id=0B9tkxB27KRlfTDRrMDctUkxXck0&usp=sharing

My Xamarin IDE version information is...

=== Xamarin Studio ===

Version 4.0.9 (build 12)
Installation UUID: 90b3594b-4658-4b79-8535-792c7a9ac379
Runtime:
	Microsoft .NET 4.0.30319.18213
	GTK 2.24.20
	GTK# (2.12.0.0)

=== Xamarin.Android ===

Version: 4.6.8 (Indie Edition)
Android SDK: C:\Users\Splay\AppData\Local\Android\android-sdk
	Supported Android versions:
		2.1   (API level 7)
		2.2   (API level 8)
		2.3   (API level 10)
		3.1   (API level 12)
		4.0   (API level 14)
		4.0.3 (API level 15)
		4.2   (API level 17)
Java SDK: C:\Program Files (x86)\Java\jdk1.6.0_27
java version "1.6.0_27"
Java(TM) SE Runtime Environment (build 1.6.0_27-b07)
Java HotSpot(TM) Client VM (build 20.2-b06, mixed mode, sharing)

=== Build Information ===

Release ID: 400090012
f9c5c24e88417feb0319953db6d5fc650d416608
Build date: 2013-06-21 14:03:10Z
Xamarin addins: 898d8afaabb160c025e21656f1490fa149397bff

=== Operating System ===

Windows 6.1.7601.65536 (64-bit)



Really appreciate the help.
Comment 1 Brendan Zagaeski (Xamarin Team, assistant) 2013-07-18 20:38:05 UTC
Steps to reproduce from user:

Using any emulator, any configuration, from android 2.2.3 to 4.2.2…

If you choose cancel from the Camera intent, OnActivityResult() will fire and a breakpoint set on base.OnActivityResult() is reached.

If you choose save from the Camera intent, OnActivityResult() will NOT fire and the breakpoint is not reached.


Using a Samsung Galaxy S2 attached in debug mode…

If you choose save from the Camera intent, the method fires as expected and the breakpoint is reached.

------------

Additional notes:

OnActivityResult() works as expected for me when building on:
Xamarin.Android 4.6.8 (Business Edition)
java version "1.6.0_51"
Android SDK tools Rev. 22.0.1
Mac OS X 10.7.5

And running with the supplied emulator image.
Comment 2 Brendan Zagaeski (Xamarin Team, assistant) 2013-07-18 20:41:13 UTC
Created attachment 4376 [details]
Test case, source only

Removed obj/ and bin/ folders from the Google drive version.
Comment 3 tony 2013-07-19 09:26:55 UTC
Can I download Xamarin.Android 4.6.8 from anywhere?
Comment 4 Brendan Zagaeski (Xamarin Team, assistant) 2013-07-19 11:25:52 UTC
You have version 4.6.8 actually. The version numbers are a bit confusing. The Xamarin.Android version is different from the Xamarin Studio version.

It looks like your Java version is different from mine though. Maybe there's an update for Java available for Windows? Also does the Android SDK Manager show "Rev. 22.0.1" ?
Comment 5 tony 2013-07-21 12:00:12 UTC
Thanks Brendan,

My SDK Manager shows "Rev. 22.0.1"

I have updated my Java SDK to java version "1.7.0_25"

Still the same results.

Is it possible for you to test from a Windows 7 machine as opposed to a Mac? This would be the only difference then between us?

Thanks again.
Comment 6 Brendan Zagaeski (Xamarin Team, assistant) 2013-07-24 12:40:09 UTC
OnActivityResult() works correctly for me on:

Xamarin.Android 4.6.8 (Starter Edition)
java version "1.6.0_39"
Windows 6.1.7600.0

Android SDK Tools Rev. 22.0.4
Android SDK Platform-tools 17
Android SDK Build-tools 17
Comment 7 tony 2013-07-25 06:03:42 UTC
Hi Brendan,


Xamarin.Android 4.6.8 (Indie Edition)
java version "1.6.0_39"
Windows 6.1.7601.65536 (64-bit) 

Android SDK Tools Rev. 22.0.4
Android SDK Platform-tools 17
Android SDK Build-tools 17

Still not working...


The only differences now are the Indie vs Starter Edition and my OS is 64bit.

Thanks
Comment 8 Brendan Zagaeski (Xamarin Team, assistant) 2013-07-25 15:33:37 UTC
If you're still seeing the error, you can do a screencapture (e.g., using http://www.techsmith.com/jing.html), and attach the video here, or post the link. That will ensure the developers know exactly what the problem looks like on your computer.
Comment 9 tony 2013-07-29 09:58:45 UTC
Hi Brendan,

After a computer restart, it worked. 

So I can put it down to the Java version. 

Once I reverted my version from java version from "1.7.0_25" to "1.6.0_39", did a computer restart, it worked.

From my experience then, the issue was happening with two versions of the JDK....
"1.6.0_27" & "1.7.0_25"

This could possibly pop up for other users.

Thanks for all the help.

Tony
Comment 10 Brendan Zagaeski (Xamarin Team, assistant) 2013-07-29 13:06:26 UTC
Phew. Thank goodness! What a bothersome problem! Based on this result, I wouldn't be surprised if the root cause might be in the Java Android SDK.

Many thanks for reporting, and sticking with it to find this work-around!