Reference
I am using Plugin.MediaManager.Forms for playing audio. It is working fine in android and ios. But in windows, the app is breaking with System.NotImplementedException..
Version Details:
Plugin.MediaManager.Forms: 1.0.7
Xamarin Forms: 4.8.0.1821
Visual Studio: 16.8.3
Windows Target version: Windows 10 version 1903(10.0; Build 18362)
Windows Min Version: Windows 10 Fall Creators Update(10.0; Build 16299)
Also, I have added the "Background Media Playback", "Internet", "Music Library" and "Videos Library" in the Package.appxmanifest under capabilities.
What else I am missing?
Plugin.MediaManager.Forms is not working in xamarin uwp
It looks a bug for Plugin.MediaManager.Forms, Please try to reduce Plugin.MediaManager.Forms version to 0.9.6. And call CrossMediaManager.Current.Init(); in UWP client project like the following. It will work.
if (rootFrame == null)
{
// Create a Frame to act as the navigation context and navigate to the first page
rootFrame = new Frame();
rootFrame.NavigationFailed += OnNavigationFailed;
Xamarin.Forms.Forms.Init(e);
CrossMediaManager.Current.Init();
ApplicationView.PreferredLaunchViewSize = new Size(600, 900);
ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;
if (e.PreviousExecutionState == ApplicationExecutionState.Terminated)
{
//TODO: Load state from previously suspended application
}
// Place the frame in the current Window
Window.Current.Content = rootFrame;
}
I already saw your issue on github and now saw this stack question.
I fixed this problem in my Pull Request. When the PR gets merged you can update to the newest version. You have to use UWP 10.0.18362.0(Version 1903) min by the way.
The Target Version was downgraded from uap 10.0.18362.0(Version 1903) to 10.0.17763(Version 1809) from version 0.9.7 to 0.9.9. For now, you have to use v. 0.9.7.
Related
We have a VB windows application project using Cefsharp to display browser screen to display some data.
As part of Angular upgrade we have migrated our current cefsharp version from 75.1.142 to 98.1.21.
Reason for not updating to latest cefsharp version is when we did the update the application layout is completely affected, font size reduced, controls broken. So we forced to use lower versions.
We used nuget package manager to update the current version.
It is working fine in our local machine, but after deploying the changes to deployment machine we are getting this
Cefsharp.BrowserSubprocess has stopped working
A problem caused the program to stop working...
Please Note: when we compare the .csproj after the update to 98.1.21 we can see that Cefsharp.Winform is now missing in our latest changes under the imported project lists
Please Note: currently we are using cefsharp in our 2 projects and Target Framework used of these 2 projects are 4.6.2
This is what we have in our CefSettings initialization method
Dim settings As CefSettings = New CefSettings()
settings.remotedebuggingport = findafreetcpport()
settings.cefcommandlineargs.add("disable-gpu", "1")
settings.logfile = ceflogfilename
settings.logseverity = logsiviertity.error
cefsharp.cef.initialize(settings)
And my ChromiumBrowser is initialized like this
_chromeBrowser = new ChromiumWebBrowser(url)
_chromeBrowser.JavascriptObjectRepository.Settings.LedgacyBindingEnabled = True
_chromeBrowser.JavascriptObjectRepository.register("bond", new ChromiumWebBrowserEventHandler(Me),True,BindingOptions.DefaultBinder)
Please note: i haven't provided any BrowserSubProcesssPath during my cefsettings
And in my both .csproj files I have this
<cefsharpanycpusupport>true</cefsharpanycpusupport>
please let me know if you need to know how is my .csproj is configured with cefsharp dll paths.
we also tried different versions but same error is popping out
Any idea why i am facing this problem
Finally after many days of nail biting I managed to solve this problem by doing this steps..
Updated Cefsharp version with Cefsharp 107.1.121 (latest version was affecting our current windows application layouts. So we forced to stick with this version)
Moved LedgacyBindingEnabled = True from my cefsettings to ChromiumWebBrowser initialization section like below
_chromeBrowser = new ChromiumWebBrowser(url)
_chromeBrowser.JavascriptObjectRepository.Settings.LedgacyBindingEnabled = True
_chromeBrowser.JavascriptObjectRepository.register("bond", new
ChromiumWebBrowserEventHandler(Me),True,BindingOptions.DefaultBinder)
Modified cefsettings section by removing the LedgacyBindingEnabled = True code
Then set this broswersubprocess path to absolute (Important) one like this
Dim assemblyPath = System.IO.Path.GetDirectoryName(System.reflection.assembly.GetExecutingAssembly.Location)
If assemblyPath.EndsWith("\") == False Then
assemblyPath = assemblyPath & "\"
End If
Settings.BrowserSubProcesssPath = assemblyPath &
"Cefsharp.BrowserSubprocess.exe"
Hope it helps to someone who updates ur Angular version and stuck because of CefSharp version change.
I am using Xamarin.Firebase.iOS.DynamicLinks 2.3.1.1 for dynamic links, Earlier it was working fine but recently it is not working. While trying to extract the short link, long link getting null. Is anyone knows why it is not working?
I have updated to the latest version (4.0.1) and its working fine. It not working any of the previous version of NuGet packages.
To answer your question. The Dynamic links are not working either on Firebase's end who choose to discontinue their old library or due to the newest IOS update 13.3. I say this because my app that is in production had its links working fine then they suddenly stopped working.
My current solution was to update Xamarin.Firebase.iOS.DynamicLinks to (4.0.1) and I was able to once again process the long url with its parameters.
A few things to note if you have other libraries such as Firestore, Analytics, Notifications etc.
You might run into linker failed exceptions. They occur because
Xamarin.Firebase.iOS.DynamicLinks (3.0.2.1) and prior depended on
Xamarin.Firebase.iOS.Core (>= 5.1.3) and the working
Xamarin.Firebase.iOS.DynamicLinks (4.0.1.1) references
Xamarin.Firebase.iOS.Core (>= 6.1.0.1) Somehow they reference methods that are no longer available.
The linking failed is fixed by checking each of your nuGets and manually installing their respective nuGets that reference ...iOS.Core (>= 6.1.0.1) : For example:
if you use Xamarin.Firebase.iOS.Storage (2.0.0) manually install
Xamarin.Firebase.iOS.Storage (3.4.0.1) because
Xamarin.Firebase.iOS.Storage (2.0.0) references
Xamarin.Firebase.iOS.Storage (>= 3.0.2) which in turn references:
Xamarin.Firebase.iOS.Core (>= 5.1.3) and it will cause native linking failed
And lastly, in my case Xamarin.Firebase.iOS.DynamicLinks (4.0.1.1) will make your method for generating ShortLinks, stop working too:
In Xamarin.Firebase.iOS.DynamicLinks (3.0.2.1) you would build your
DynamicLinkComponents with:
var shareLink = DynamicLinkComponents.FromLink(linkParameters,
"YOUR_DOMAIN.page.link");
Xamarin.Firebase.iOS.DynamicLinks (4.0.1.1) recomends you use
DynamicLinkComponents.Create(YOURlinkParameters, "YOUR_DOMAIN.page.link");
but it would return a null DynamicLinkComponents so i fixed by doing:
var shareLink = new DynamicLinkComponents();
shareLink.Link = YOURlinkParameters;
shareLink.Domain = "https://YOUR_DOMAIN.page.link";
I spent a week trying to troubleshoot this error and really hope others are able to see this and save you valuable time.
A work around to get Xamarin.Firebase.iOS.DynamicLinks 3.0.2.1 working (should work on 2.3.1.1 as well) is to have the IOS device open the link in the browser which will then redirect them back to the app.
The flow is Dynamic link > App [short link] > Browser > App with [long link].
Dynamic links are formatted "domain.page.link/ShortSequence" and long links parameters have "domain.page.link/?". You can look for the '?' to decide weather to process url or to redirect user as follows:
public override bool ContinueUserActivity(UIApplication application,
NSUserActivity userActivity, UIApplicationRestorationHandler completionHandler)
{
if (userActivity.ActivityType == NSUserActivityType.BrowsingWeb)
{
var sharedLink = userActivity.WebPageUrl;
if (!sharedLink.ToString().Contains("domain.page.link/?")){
await Launcher.OpenAsync(new Uri(sharedLink.ToString()));
return;
}
var handled = DynamicLinks.SharedInstance.FromUniversalLinkUrl(sharedLink);
//Process your DynamicLink parameters
}
return true;
}
First up, I'm fairly new to .NET and C# and this is a project to learn C# and CEF at the same time.
I have followed a number of tutorials from the net as well as looking into the CefSharp examples to create a WinForms application.
I have installed CefSharp.WinForms 53.0.1 from NuGet, and my project is using Any CPU (CefSharp 51+ has Any CPU support).
To achieve this I largely followed the tutorial from Ourcode (http://ourcodeworld.com/articles/read/173/how-to-use-cefsharp-chromium-embedded-framework-csharp-in-a-winforms-application). I made the changes for Any CPU as suggested and included the basic code to load google.
Everything builds fine, but when the form displays there's no browser shown, just a blank form.
If I set the target to x64 or x86, then the browser displays as expected.
I notice in the Ourcode comments that user Edek Halon has had the same issue, but no solution seems to be provided. Edek, has the same setup as me, so I wonder if this is an issue in 53.0.1? Potentialy Joey De Vries in the comments has the same issue.
The addition of support for Any CPU in CefSharp is covered in this GitHub issue : https://github.com/cefsharp/CefSharp/issues/1714
There is a troubleshooting page for CefSharp (https://github.com/cefsharp/CefSharp/wiki/Trouble-Shooting) and it seems a bit contradictory. Under General Troubleshooting
1) Platform Target You must select either x86 or x64 when using the NuGet packages. If you select AnyCPU the NuGet magic won't work currently.
Does CefSharp need to be built from source for Any CPU to work?
Just if anyone is having difficulties with this, follow the Github Tutorial at the following link : https://github.com/cefsharp/CefSharp/issues/1714
Basically the code should be as follows (Winforms Example):
CefSharpSettings.SubprocessExitIfParentProcessClosed = true;
Cef.EnableHighDPISupport();
CefSettings settings = new CefSettings
{
CachePath = Path.Combine(Environment.GetFolderPath(Environment.SpecialFolder.LocalApplicationData), "CefSharp\\Cache"), //By default CefSharp will use an in-memory cache, you need to specify a Cache Folder to persist data
BrowserSubprocessPath = #"x86\CefSharp.BrowserSubprocess.exe"
};
Cef.Initialize(settings, performDependencyCheck: true, browserProcessHandler: null); // Initialize cef with the provided settings
chromeBrowser = new ChromiumWebBrowser("http://ourcodeworld.com"); // Create a browser component
this.Controls.Add(chromeBrowser); // Add it to the form and fill it to the form window.
chromeBrowser.Dock = DockStyle.Fill;
I am using the example code from the ZXing page .
Details are :
Windows 10 Pro N, Visual Studio Enterprise 2015 ,
Xamarin.Forms 2.3.1.114 , ZXing.Net.Mobile 2.1.47 ,
ZXing.Net.Mobile.Forms 2.1.4.7
I am using below code
btnScan.Clicked+=async(sender,e)=>{
var scanPage = new ZXingScannerPage ();
await Navigation.PushModalAsync (scanPage);
scanPage.OnScanResult += (result) =>
{
scanPage.IsScanning = false;
Device.BeginInvokeOnMainThread (async () =>
{
await Navigation.PopModalAsync ();
await DisplayAlert("Scanned Barcode", result.Text, "OK");
});
};
}
Also I have added the below line in the MainPage.xml file of the UWP project just before LoadApplication method call
ZXing.Net.Mobile.Forms.WindowsUniversal.ZXingBarcodeImageViewRenderer.Init();
Also I have provided access to the WebCam from the application manifest.
When I run the application in Debug or Release mode in the emulator then it opens the scanner but small black/white /red /green square comes and computer webcam is not accessed.
When I run it as windows 10 app then nothing comes, only blank screen comes.
When I run it in the real windows 10 mobile, then scanner opens but camera doesn't opens, the white screen with red line opens and camera doesn't activates.
The same thing happens with WIndows 8.1 also.
Any help would be deeply appreciated. I have wasted lot of time to explore the internet used almost every combination. If anyone have the solution please please provide me.
Note:
The above code works fine for Android and I am able to scan the bar code and QR code.
I have tried all options given by users in different forums, but none of them were working.
if you are also facing same issue then please check you camera. If you are using Windows Pro N or KN version, then you have to install the media feature pack to make camera working.
I installed the media fature pack for windows K and KN versions but still it was not working.
When I try to open the Camera App then also it was saying that Media Fature Pack Required for Windows K and KN versions.
Finally I installed Windows 10 Pro version (removed Pro N/KN version) and reinstalled VS 2015 and tried of of the solution given by user at xamarin forum
https://forums.xamarin.com/discussion/76035/zxing-scanner-camera-is-not-activating-in-uwp-and-wp-8-1#latest
But still I am still facing this issue for WP 8.1
I'm building a Windows 8 app, and now I want to use SQLite for this app. I installed SQLite for Windows Runtime through the Visual Studio 2013 extension manager, and I added sqlite-net to my project through NuGet.
I'm trying to create a database in my app.xaml.cs OnLaunched, but I get this exception when I run the project:
Unable to load DLL 'sqlite3': The specified module could not be found.
(Exception from HRESULT: 0x8007007E)
This is very strange because there is no error during compiling. Anyway, I think it tries to tell me that I need to reference an additional DLL: sqlite3.dll, but that doesn't work. I have 6 different DLLs on my file system: both debug and release versions of ARM, x64 and x86. I tried adding the x86 release version to my project but that results in this exception:
A reference to 'C:\Users\Leon\Documents\Visual Studio
2013\Projects\Googalytics\packages\SQLite\x86\sqlite3.dll' could not
be added. Please make sure that the file is accessible, and that it is
a valid assembly or COM component.
It's very sad that the documentation for sqlite-net sucks, it's very outdated (examples don't even work anymore), it's very incomplete and there is no mention of manually adding a DLL either. So I have 2 questions:
How do I fix this particular issue?
Where do I find up to date documentation for sqlite-net?
Edit: the code I use to create the DB is:
private void InitializeDatabase()
{
var db = new SQLiteConnection("Googalytics");
db.CreateTable<Account>();
db.CreateTable<WebProperty>();
db.CreateTable<Profile>();
}
I call that method from here:
InitializeDatabase();
if (rootFrame.Content == null)
{
// When the navigation stack isn't restored navigate to the first page,
// configuring the new page by passing required information as a navigation
// parameter
if (!rootFrame.Navigate(typeof(MainPage), args.Arguments))
{
throw new Exception("Failed to create initial page");
}
}
// Ensure the current window is active
Window.Current.Activate();
edit2: some more info about my setup:
Visual Studio 2013 RC
Windows 8.1 RTM
SQLite for Windows Runtime 3.8.0.2
sqlite-net 1.0.7
Your project has its build mode currently set to Any CPU, what is the default. Because the SqLite assembly is not build as AnyCPU you need to set your build mode to X86 and add the X86 SqLite reference.
When deploying your app you also need to create 3 packages instead of 1 AnyCPU package.
Because your project is AnyCPU you get the error message when trying to add the x86, x86 is not valid for AnyCPU.
UPDATE
I tried to replicate your problem. I installed the SQLite for Windows Runtime for Visual Studio Ultimate 2012, after that I created a Windows Store Project, then added the SqLite reference after that I added sqlite-net and last I added your code for DB creation.
I modified the code a little bit (path & tables). But my code gives no error at all.
I did not need to reference the SqLite assemblies myself. Because by installing the extension into Visual Studio you get the reference in your extension list (still need to select it, just not add the dlls):
But still like I said in my first answer, you need to set your build mode to something else than 'Any CPU'
My example is on my skydrive (when testing set configuration to x86).
UPDATE 2
Db path:
var dbPath = Path.Combine(Windows.Storage.ApplicationData.Current.LocalFolder.Path, "db.sqlite");
var db = new SQLite.SQLiteConnection(dbPath);