Repository navigation
Description
Steps to Reproduce
Downloaded PictureInPicture Sample from https://developer.xamarin.com/samples/monodroid/android-o/PictureInPicture/
- Opened the Project on VS for MAC and Restored all Packages
- Tried to run the project and got a runtime exception: System.NotSupportedException

- Under System.NotSupportedException, there was Java.Lang.ClassNotFoundException
Expected Behavior
The App Should work for PictureInPicture feature
Actual Behavior
Throws a Runtime Exception
Version Information
=== Visual Studio Community 2017 for Mac ===
Version 7.3.2 (build 12)
Installation UUID: aed07d58-dc28-46be-99a7-82fcbd01df4b
Runtime:
Mono 5.4.1.7 (2017-06/e66d9abbb27) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 504010007
=== NuGet ===
Version: 4.3.1.4445
=== .NET Core ===
Runtime: /usr/local/share/dotnet/dotnet
Runtime Version: 2.0.0
SDK: /usr/local/share/dotnet/sdk/2.0.0/Sdks
SDK Version: 2.0.0
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.4.1/lib/mono/msbuild/15.0/bin/Sdks
=== Xamarin.Profiler ===
Version: 1.6.0
Location: /Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
=== Apple Developer Tools ===
Xcode 9.1 (13532)
Build 9B55
=== Xamarin.iOS ===
Version: 11.6.1.2 (Visual Studio Community)
Hash: 6857dfcc
Branch: xcode9.2
Build date: 2017-12-04 21:20:41-0500
=== Xamarin.Android ===
Version: 8.1.0.25 (Visual Studio Community)
Android SDK: /Users/mumashankar/Library/Android/sdk
Supported Android versions:
4.4 (API level 19)
5.1 (API level 22)
6.0 (API level 23)
7.1 (API level 25)
8.0 (API level 26)
SDK Tools Version: 26.1.1
SDK Platform Tools Version: 26.0.2
SDK Build Tools Version: 26.0.2
Java SDK: /usr
java version "1.8.0_131"
Java(TM) SE Runtime Environment (build 1.8.0_131-b11)
Java HotSpot(TM) 64-Bit Server VM (build 25.131-b11, mixed mode)
Android Designer EPL code available here:
https://github.com/xamarin/AndroidDesigner.EPL
=== Xamarin Inspector ===
Version: 1.3.2
Hash: 461f09a
Branch: 1.3-release
Build date: Tue, 03 Oct 2017 18:26:57 GMT
Client compatibility: 1
=== Xamarin.Mac ===
Version: 4.0.0.214 (Visual Studio Community)
=== Build Information ===
Release ID: 703020012
Git revision: 7d0c9d7ad46b125cf4b7bbf9532c0531b6433ce6
Build date: 2017-12-12 14:03:18-05
Xamarin addins: 6dddaa49fbecb2695fcdcd6b712eb269e288518c
Build lane: monodevelop-lion-d15-5
=== Operating System ===
Mac OS X 10.12.6
Darwin 16.7.0 Darwin Kernel Version 16.7.0
Wed Oct 4 00:17:00 PDT 2017
root:xnu-3789.71.6~1/RELEASE_X86_64 x86_64
=== Enabled user installed addins ===
Internet of Things (IoT) development (Preview) 7.1

Activity
jonpryor commentedon Dec 19, 2017
On what device did you run this on? Which version of Android?
How exactly did you interact with the program once launched? Did you rotate the screen? Hit the back button?
I am not able to reproduce the issue.
Could you please enable GREF logging?
Completely quit the app, the restart it.
When you've gotten it to crash again, grab the GREF log from the device:
$ adb shell run-as com.xamarin.PictureInPicture cat files/.__override__/grefs.txt > grefs.txtThen please attach
grefs.txt.What I'm Looking For
I'm trying to determine where and why the wrapper was destroyed. Usually the
NotSupportedExceptionis thrown because aJava.Lang.Objectinstance is e.g.Dispose()d of, and then Java invokes a method which is overridden in managed code. This virtual method invocation requires that an instance exist to process the virtual method, and if a pre-existing instance doesn't exist, we attempt to create one. When we can't create one, theNotSupportedExceptionis thrown.GC Bug?
Another possibility is that this is a GC bug. Follow the link for a description of how to use the legacy GC bridge implementation.
If this is a GC bug, please let us know. We've been trying unsuccessfully for ages to find a decent fix for that bug. Perhaps it requires a specific set of hardware?
JonDouglas commentedon May 21, 2018
I am closing this issue due to no further information being provided. See the need-info tag for more information.
tuyen-vuduc commentedon May 21, 2018
Hi,
I just faced this issue on Nexus 4, Android 19.
The code is
And the error
JonDouglas commentedon May 21, 2018
@tuyen-vuduc Your issue has a different class that is not being found on the dex list and thus I believe is different than this issue. Please open up a new issue with a respective reproduction project. Thank you!
Bump to xamarin/monodroid@04b0423 (#5240)
softsan commentedon Feb 28, 2022
I came across this issue but it is happened when the sample is run on Android 7. As stated in Sample and also Android docs that PIP mode only support Android 8 (API 26) and later. It runs fine on those OS. So if anyone testing please make sure you use proper OS with Android device.
JosiYosi commentedon May 18, 2022
I know this issue is an old one. For those who wants to resolve the issue, check android version of a device before running PIP as the following: