Xamarin forms: Issue with epubreader.cross - xamarin.forms

I am using epubreader.cross NuGet package for parsing .epub files.
My Code:
string fileName = "SampleEPUB.epub";
var assembly = typeof(MainPage).GetTypeInfo().Assembly;
Stream stream = assembly.GetManifestResourceStream($"{assembly.GetName().Name}.{fileName}");
EpubBook epubBook = EpubReader.ReadBook(stream);
For some .epb files I am getting below exceptions:
System.AggregateException: 'One or more errors occurred. (Incorrect EPUB navigation page target: normal is incorrect value for page target type.)'
System.AggregateException: 'One or more errors occurred. (Incorrect EPUB spine: TOC is missing)'
All my .epub files are able to view using Adobe Digital Editions 4.5.11. So what will be the reason behind this issue?
I have added a sample project here having .epub files for the reference.

That project seems to be deprecated. However , it looks like that the root repo is active though . You could check the github project site .
You need to download the dll file manually from this link , choose the for .NET Standard one . Then add the dll file into forms project , just right click Dependencies - Add project reference - Browse - Select the download file

Related

Xamarin.Forms problems with Embedded Resources and Proguard

I have two different applications, both using files that I've included in my Xamarin.Forms project's root. The files are set as Embedded Resources under "Build Action" and then fetched using the code below.
var assembly = Assembly.GetExecutingAssembly();
Stream stream = assembly.GetManifestResourceStream("test.text.json");
This approach works just fine with all compilation options such as AoT and LLVM, except for when Proguard is involved. If the application is compiled using Proguard it will just instantly force close without being able to read the files.
So far I've tried making exceptions for the classes in the project using a custom proguard.cfg-file that is set as my "ProguardConfiguration" in VS 2017.
-dontobfuscate
-keep class com.companyname.test** { *; }
-keeppackagenames com.companyname.test**
This has not yielded any results. The application still crashes instantly. Every other application using Proguard is working just fine as long as it's not loading any files locally. Should I use a different way of loading files or can I exclude anything else in my Proguard configuration to make this work?
EDIT: Just updating this post to draw attention to the solution. It turns out I have solved this problem before but for some reason it seems to be back. Here is the log output:
android.view.InflateException: Binary XML file line #20: Binary XML file
line #20: Error inflating class android.support.v7.widget.FitWindowsFrameLayout
Which is something that I have already added to my general Proguard rules without me having to add a special Proguard configuration to my project. As a solution this time I simply added these two lines to my proguard.cfg file:
-keep public class android.support.v7.widget.** { *; }
-dontwarn android.support.**
Thanks Alen.Toma for pointing me in the right direction.

Seam 2.0.3.CR1 xcss file not getting picked up

I have an example Seam project that I am working with. I am trying to add a xcss file which I have added to the project under the resources folder org/jboss/seam/ui/richfaces/styles.xcss , I have included the following line in the template.xhtml file :
<a:loadStyle src="resource:///org/jboss/seam/ui/richfaces/styles.xcss"/>
but am confronted with the following exception :
org.ajax4jsf.resource.ResourceNotFoundException: Static resource not found for path /org/jboss/seam/ui/richfaces/styles.xcss
what am I missing?

Qt WinRT App cannot access file permission denied

I need to develop WinRT App using Qt and FFMPEG, I build the ffmpeg for WinRT based on the instruction here and I am able to link the library with my project. Now I need to open a video file using avformat_open_input but it always giving me the output
video decode error "Permission denied"
Below is the relevant part of the code,
int ret = avformat_open_input(&pFormatCtx, hls, NULL, NULL);
if(ret != 0)
{
char errbuf[128];
av_strerror(ret, errbuf, 128);
qDebug()<<"video decode error"<<QString::fromLatin1(errbuf);
}
From the above error it seems some permission issue, do I need to add any additional permission on AppxManifest.xml currently I am using default manifest which is created by Qt creator.
Try to add a file protocol to the manifest page, contains your file extension you want to access/ create or play with..
for example, .xml, .txt, .etc..
I always face this 'unknown' error when try to access files without adding the ext file protocol..
UPDATE:
More Information: https://msdn.microsoft.com/library/windows/apps/hh464906.aspx#file_activation
Do it by: Package.appxmanifest > Declarations > Add a 'File Type Association' > your type name and ext. is required.
Example in a code:
<Extensions>
<uap:Extension Category="windows.fileTypeAssociation">
<uap:FileTypeAssociation Name="myfile">
<uap:SupportedFileTypes>
<uap:FileType>.config</uap:FileType>
</uap:SupportedFileTypes>
</uap:FileTypeAssociation>
</uap:Extension>
</Extensions>
Change 'myfile' and '.config'
Good luck!

'bootstrap' is not a valid script name. The name must end in '.js'

I'm learning asp.net and so I'm trying to build up the project named "Wingtip Toys" from MSDN.
The project is developed on VS 2013 and I have VS 2012. When I try to add Bootstrap per the instruction from here I get the error on runtime in browser.
Server Error in '/' Application.
'bootstrap' is not a valid script name. The name must end in '.js'.
Description: An unhandled exception occurred during the execution of
the current web request. Please review the stack trace for more
information about the error and where it originated in the code.
Exception Details: System.InvalidOperationException: 'bootstrap' is
not a valid script name. The name must end in '.js'.
when I add the .js on the master page it shows me to another error:
The assembly 'System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not contain a Web resource that has the name 'bootstrap.js'. Make sure that the resource name is spelled correctly.
I also add the CSS file to Bundle.config but still the same result. I already have the NuGet package available, like for the jQuery.js error, but I'm unable to sort this out yet.
Here's what worked for me.
I added this to my BundleConfig.cs file:
ScriptManager.ScriptResourceMapping.AddDefinition("bootstrap", new ScriptResourceDefinition
{
Path = "~/scripts/bootstrap.min.js",
DebugPath = "~/scripts/bootstrap.js",
LoadSuccessExpression = "bootstrap"
});
Please go to Tools -> NuGet Package Manager -> Manage NuGet Packages for Solutions.
In Browse, search for: AspNet.ScriptManager.bootstrap
If your version of bootstrap is higher than AspNet.ScriptManager.bootstrap first uninstall bootstrap and then install AspNet.ScriptManager.bootstrap
go to:
Tools
NuGet Package Manager
Manage NuGet Packages for Solutions...
search for Bootstrap.css
install it
try to run your app

How to import dll from bin folder without adding reference in asp.net

As in my project i used some dll by referencing in my project bin folder which only works when i paste my dll in my "C:windows/system32/mydll.dll" but when i paste my dll in bin folder and then runs my website on server it will show me error...."file not found" .
and i also used this method [DllImport("~/bin/mydll.dll")] to import it....
but it still showing me the same error "file not found"
And if i used add reference method then it shows me "Invalid COM component" error.....
please do suggest some simple and useful solution...
Because your dll had added as COM composant in your reference explorer, not as simple assembly.
Nota : If you want register an assembly as COM you can use RegSvr32 tool
Link : http://msdn.microsoft.com/en-us/library/ms859484.aspx
Try in code:
if (!Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process).Contains(HttpRuntime.BinDirectory))
Environment.SetEnvironmentVariable("PATH", Environment.GetEnvironmentVariable("PATH", EnvironmentVariableTarget.Process) + ";" + HttpRuntime.BinDirectory, EnvironmentVariableTarget.Process);

Resources