Ionic 3 - Splash screen hides on home button press - splash-screen

I am developing an app in ionic 3.
Splash screen plugin is installed & it works perfectly in normal case.
But during splash if I press home or recent button in android & come back again then splash doesn't show again. Only white screen is there until page load.
Preferences for splash:
<preference name="SplashMaintainAspectRatio" value="true"/>
<preference name="FadeSplashScreen" value="false"/>
<preference name="SplashShowOnlyFirstTime" value="false"/>
<preference name="orientation" value="portrait"/>
<preference name="SplashScreen" value="screen"/>
<preference name="AutoHideSplashScreen" value="false"/>
<preference name="SplashScreenDelay" value="70000"/>
Ionic Info:
Cordova CLI: 6.5.0
Ionic Framework Version: 3.0.1
Ionic CLI Version: 2.2.2
Ionic App Lib Version: 2.2.1
Ionic App Scripts Version: 1.3.0
ios-deploy version: Not installed
ios-sim version: Not installed
OS: macOS Sierra
Node Version: v6.10.2
Xcode version: Xcode 8.3.1 Build version 8E1000a

These was problem in plugin. In onPause splash was removed. I removed that code.
Now onPause look like:
#Override
public void onPause(boolean multitasking) {
if (HAS_BUILT_IN_SPLASH_SCREEN) {
return;
}
}

Related

The Module DLL C:\Program Files\IIS\Asp.Net Core Module\V2\apnetcorev2.dll failed to load. The data is the error

I have recently update an aspnetcore project from .NET Core 2.1 to .NET 6.0.
Since the update, the application will not run in IIS 10.0.
When I attempt to run the application, the application pool exits, and I see the following error in the Event Viewer:
Log Name: Application
Source: Microsoft-Windows-IIS-W3SVC-WP
Date: 1/18/2023 10:37:14 AM
Event ID: 2280
Task Category: None
Level: Error
Keywords: Classic
User: N/A
Computer: MACHINENAME.dev.oati.local
Description:
The Module DLL C:\Program Files\IIS\Asp.Net Core Module\V2\apnetcorev2.dll failed to load. The data is the error.
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
<System>
<Provider Name="Microsoft-Windows-IIS-W3SVC-WP" Guid="{670080D9-742A-4187-8D16-41143D1290BD}" EventSourceName="W3SVC-WP" />
<EventID Qualifiers="49152">2280</EventID>
<Version>0</Version>
<Level>2</Level>
<Task>0</Task>
<Opcode>0</Opcode>
<Keywords>0x80000000000000</Keywords>
<TimeCreated SystemTime="2023-01-18T16:37:14.436510400Z" />
<EventRecordID>368815</EventRecordID>
<Correlation />
<Execution ProcessID="0" ThreadID="0" />
<Channel>Application</Channel>
<Computer>MACHINENAME.dev.oati.local</Computer>
<Security />
</System>
<EventData>
<Data Name="ModuleDll">C:\Program Files\IIS\Asp.Net Core Module\V2\apnetcorev2.dll</Data>
<Binary>7E000000</Binary>
</EventData>
</Event>
I have installed the relevant Windows Hosting Bundle:
I have installed the relevant Microsoft Visual C++ Redistributable:
I'm not sure what to check next. I have gone through multiple similar stackoverflow questions, as well as the aspnetcore github issues list and have not gotten a good idea of what to look at next to debug the issue.
EDIT:
Here is the Jexus Manager output for the application --
So it says ASP.NET Core module version 2 is not installed properly.
It is not clear to me why that would be the case, or how to remedy it.

.net core Windows Service Wix install Window service issue : The application to execute does not exist

I am using VS 2019 and .NET Core 3.1.
I have converted windows service to .NET Core 3.1 and tried to create the msi installer using WIX.
I have created the installer, and while trying to start the application I am getting the error like
The application to execute does not exist: 'C:\Program Files (x86)\DRAProcessorServiceFolder\Django_DRAProcessorService.dll'.
My product.wxs code is below
<File Id="Django_DRAProcessorService" Name="Django_DRAProcessorService.exe" Source="..\Django_DRAProcessorService\bin\Release\netcoreapp3.1\win10-x64\Django_DRAProcessorService.exe" Vital="yes" KeyPath="yes" />
<ServiceInstall
Id="ServiceInstaller"
Type="ownProcess"
Vital="yes"
Name="WorkingService2"
DisplayName="Django_DRAProcessorService"
Description="Django_DRAProcessorService"
Account="NT AUTHORITY\LocalService"
Start="auto"
Interactive="no"
ErrorControl="normal"
/>
<ServiceControl
Id="ServiceInstaller"
Start="install"
Stop="both"
Remove="uninstall"
Name="Django_DRAProcessorService"
Wait="yes" />
If anybody knows any solution please help me.

Xamarin.Forms + Xamarin.ios Entityframework Core 2.1.1 build error

I'm working on Xamarin.ios application with Microsoft.EntityframeworkCore.Sqlite version 2.1.1 with Xamarin.forms .NetStandard 2.0 version. I'm unable to build the application on iPhone, getting the below error:
MTOUCH: Error MT3001: Could not AOT the assembly 'project_name/iOS/obj/iPhone/Debug/device-builds/iphone10.2-11.0.2/mtouch-cache/Build/Microsoft.EntityFrameworkCore.dll' (MT3001) (project_name.iOS)
Could any one please help me to get through the error, I tried to downgrade the entityframework version to 2.0.0 and also downgrade the Microsoft.extension.* version to 2.0.0.
Linker behavior : Don't Link/ Link SDK only
SDK Version: 11.0
I had a similar error when implementing EntityFrameworkCore in the project I am working on. The solution for me was to add a file to my iOS project, and have these contents. Also, I am running Microsoft.EntityFrameworkCore.Sqlite version 2.0.2 currently with no problems.
<?xml version="1.0" encoding="utf-8" ?>
<linker>
<!-- LinkDescription.xml. File added to iOS project by #cwrea for adaptation to EF Core.
Prevents runtime errors when reflection is used for certain types that are not otherwise referenced
directly in the project, and that would be removed by the Xamarin linker.
These kinds of runtime errors do occur in particular when using Entity Framework Core on iOS. EF Core's
query parser does reference certain .NET methods _only_ via reflection, and it is those reflection-only
instances that we need to guard against by ensuring the linker includes them. For the curious, search
for mentions of "GetRuntimeMethod" at https://github.com/aspnet/EntityFramework. Use of EF Core more
advanced than this sample may require additional types/methods added to those below.
Include the following in the project build settings under "Additional mtouch arguments":
[hyphen][hyphen]xml=${ProjectDir}/LinkDescription.xml
There is supposed to be a "LinkDescription" build action for this linker config file so the step above
shouldn't be necessary, but at time of writing Visual Studio 2017 for PC doesn't show that build action
in iOS projects, even though it is an option within iOS projects on Visual Studio 2017 for Mac.
-->
<assembly fullname="mscorlib">
<type fullname="System.String">
<method name="Compare"></method>
<method name="CompareTo"></method>
<method name="ToUpper"></method>
<method name="ToLower"></method>
</type>
</assembly>
<assembly fullname="System.Core">
<type fullname="System.Linq.Expressions.Expression`1"></type>
<type fullname="System.Linq.Queryable"></type>
</assembly>
</linker>
You will also need to set that files Build Action to LinkDescription. Also, you don't need to copy that file to the output directory. It is only used during the build.
In your project settings for the iOS project, you will need to put --xml=${ProjectDir}/LinkDescription.xml in the Additional mtouch arguments section in iOS Build.
Hope this helps!

Adding Windows Runtime Component (wraps Class library) in Windows 10 Cordova Project via cmd line by defining it custom plugin's xml doesn't work

I created a Windows universal project with cordova cmd line. (create a new project, added platform windows)
Built the project and run it from cmd line. Works fine.
My requirement is to create my own custom plugin and install it via npm cmd line.
My project also need to access native code with Windows Runtime Component.
I opened the above project CordovaApp in Visual Studio 2015.
Then I added a Windows Runtime Component also I added Newtonsoft library (link here why I added Newtonsoft manually). I added a following Service class:
public sealed class Service
{
public IAsyncOperation<string> Open(string param)
{
return OpenHelper(param).AsAsyncOperation();
}
private async Task<string> OpenHelper(string param)
{
try
{
JObject jObj = JObject.Parse(JArray.Parse(param)[0].ToString());
string message = jObj["message"].ToString();
return message;
}
catch (Exception ex)
{
return "fail";
}
}
}
I wanted to add its dll or winmd file when installing my custom plugin via cmd line. So I copied my .winmd file from bin\x86\MyRuntime.winmd and place it inside my custom plugin folder (\src\windows\lib).
My custom plugin.xml is below:
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-test-plugin"
version="0.1.0">
<name>Launcher</name>
<description>PhoneGap Plugin</description>
<license>MIT</license>
<keywords>phonegap,launcher</keywords>
<js-module src="www/launcher.js" name="Launcher">
<clobbers target="window.launcher" />
</js-module>
<!-- windows -->
<platform name="windows">
<js-module src="src/windows/Launcher.js" name="LauncherProxy">
<merges target="" />
</js-module>
<framework src="src/windows/lib/MyRuntime.winmd" custom="true" />
</platform>
</plugin>
I have launcher.js file in my cordova plugin from where native runtime component is called like below:
Launcher.js
cordova.commandProxy.add("LauncherProxy", {
open: function(successCallback, errorCallback, pluginParam) {
var service = MyRuntime.Service();
service.open(JSON.stringify(pluginParam)).then(function(data) {
successCallback(data);
});
}
});
require("cordova/exec/proxy").add("Launcher", module.exports);
In my index.js, I have this method call on device ready event:
launcher.openFile(function (message) {
Windows.UI.Popups.MessageDialog(message).showAsync();
console.log(message);
}, function () {
});
FYI: Also launcher.js inside the **\www** of my custom plugin has following code structure:
cordova.define("cordova-test-plugin.Launcher", function(require, exports, module) {
var objWindowsLauncher = {
openFile: function(successCallback, errorCallback) {
cordova.exec(
successCallback,
errorCallback,
'LauncherProxy',
'open',
[{
"message": "Hello test message"
}]
);
}
}
module.exports = objWindowsLauncher;
});
Till now it works well. It pop up's Hello test message when app is run.
Now I added a new Class library project for SQLite. Installed sqlite-net (include SQLite.cs and SQLiteAsync.cs files from old project), added Newtonsoft.json dll, SQlite for Universal Windows Platform, Visual C++ 2015 Runtime for Universal Windows Platfrom.
Added this SQLite reference (Class library) to my previous Runtime Component project by right clicking on the Reference and selecting SQLite project.
By doing this, now I can do sqlite operation in runtime component. I build this runtime component and hence its new .winmd file is generated inside bin\x86\Debug. I copied this winmd file and place it inside my custom plugin folder like above.
I removed the plugin and re-added the plugin (cmd line installation) just like above. This time also, the project should work same as previous, but doesn't work.
It throws an exception.
System.IO.FileNotFoundException: Could not load file or assembly 'SQLite, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
at MyRuntime.Service.<OpenHelper>d__1.MoveNext()
at System.Runtime.CompilerServices.AsyncTaskMethodBuilder 1.Start[TStateMachine](TStateMachine& stateMachine)
Another case:
Sometimes, I get this exception with the exact above process:
Could not load file or assembly 'Newtonsoft.Json, Version=9.0.0.0, Culture=neutral, PublicKeyToken=30ad4fe6b2a6aeed' or one of its dependencies
INFO
All the project build configuration is under x86.
Newtonsoft version is: 9.0.1, 10.x.x
Cordova Windows 10 project, Runtime Component and Class Library has: 10.0.14393.0 (Target Version) and 10.0.10240.0 (Min Version)
Cordova version: 7.0.1
Cordova Windows version: 5.0.0
Plugin installation and remove cmd:
cordova plugin remove cordova-test-plugin
cordova plugin add ..\plugins\cordova-test-plugin
I have shared the complete project with custom plugin here in onedrive.
P.S. I can add the Runtime component reference manually and make it work but I want to do with cmd line interface, install pluigns, build and generate packages from cmd line interface without interacting with Visual Studio.
Please let me know your views, I remember when I started to work few months back, it used to work. (adding reference from cmd line by defining .winmd file in plugin.xml (<framework src="src/windows/lib/MyRuntime.winmd" custom="true" />)). It used to work fine. But recently I'm facing above problem.
UPDATE 1
I tried as #Elvis Xia suggested. This seems to load the runtime component as expected. I included all these:
<framework src="src/windows/lib/SQLite.dll" custom="true"/>
<framework src="src/windows/lib/MyRuntime.winmd" custom="true" />
<framework src="src/windows/lib/Newtonsoft.Json.dll" custom="true"/>
in my plugin.xml and installed the plugin via cmd line. There is still some bug while creating SQLite database. I faced system.dllnotfoundexception unable to load dll 'sqlite3' error as:
The problem is, SQLite.dll and NewtonJson.dll should also be added as reference in your plugin. So your plugin.xml should look like this:
<?xml version="1.0" encoding="UTF-8"?>
<plugin xmlns="http://apache.org/cordova/ns/plugins/1.0"
id="cordova-test-plugin"
version="0.1.0">
<name>Launcher</name>
<description>PhoneGap Plugin</description>
<license>MIT</license>
<keywords>phonegap,launcher</keywords>
<js-module src="www/launcher.js" name="Launcher">
<clobbers target="window.launcher" />
</js-module>
<!-- windows -->
<platform name="windows">
<js-module src="src/windows/Launcher.js" name="LauncherProxy">
<merges target="" />
</js-module>
<!-- <framework src="src/windows/lib/MyRuntime.winmd" custom="true" /> -->
<framework src="src/windows/lib/SQLite.dll" custom="true"/>
<framework src="src/windows/lib/MyRuntime.winmd" custom="true" />
<framework src="src/windows/lib/Newtonsoft.Json.dll" custom="true"/>
</platform>
</plugin>
And copy SQLite.dll and Newtonsoft.Json.dll under bin\x86\debug\ folder to your plugin's src/windows/lib/. Then it will works fine.

custom splashscreen not showing with ionic and phonegap build (3.5.0)

I'm referring to phonegap doc here:
http://docs.build.phonegap.com/en_US/configuring_icons_and_splash.md.html
yet can't have the splashscreen to show after building ( build via phonegap build service, not locally )
relevant ( I suppose ) config.xml lines:
<gap:plugin name="org.apache.cordova.splashscreen" />
<gap:splash src="splash.png" />
<preference name="webviewbounce" value="false"/>
<preference name="UIWebViewBounce" value="false"/>
<preference name="DisallowOverscroll" value="true"/>
<preference name="BackupWebStorage" value="none"/>
<preference name="SplashScreen" value="screen" />
<preference name="SplashScreenDelay" value="3000" />
splash.png is in the root, as is config.xml, is a 480x800 PNG (32-bit color)
I'm building with phonegap 3.5.0 selected; pulling from the git for the ionic project ( so no local 'platforms' dir in the way, since it's in ionic .gitignore.
I also tried the
<gap:splash src="res/screen/android/screen-ldpi-portrait.png" gap:platform="android" gap:qualifier="port-ldpi" />
options to no result ('res/screen... dirs also starting from the root where config resides')
I have made no specific splash show/hide code in the app, is this mandatory ? I just want the splash to show for a fixed bunch of seconds...
My advice is twofold:
First, use PGB 3.6.3. Not only is 3.5 outdated, it also has a security flaw in Android that means apps will be removed from the Past Store.
Second (re: your problem). Go back to basics - follow the PGB docs on splash screens in the simplest way possible.
I don't know what the issue, it looks OK to me, but there are a few preferences you have that I don't use and it works fine for me. I'd expand more but I'm on a mobile. I'll check it out in detail later.

Resources