nativescript-cli
nativescript-cli copied to clipboard
The default Nativescript splash screen always loading on real iOS 11 device
From @mutazmq on October 14, 2017 18:33
I'm developing an iOS app but I'm still getting the Nativescript splash screen even though I did the following:
- Changed all images in
Assets.xcassets
folder - Removed iOS platform using
tns platform remove ios
and added it again (Just in case there was some caching) - Deleted the app from my iPhone several times
But still I'm getting the same default Nativescript image when the app is launched on my device! However iOS simulator doesn't have this problem and shows me the new image.
Using tns version 3.2.0:
"tns-android": {
"version": "3.2.0"
},
"tns-ios": {
"version": "3.2.0"
}
Copied from original issue: NativeScript/nativescript-angular#1041
@mutazmq confirming this as a bug. Tested with iOS11 real device.
Steps to reproduce (no sample application as the issue is reproducible only when changing the images of already installed application)
- create new application
tns create issue3159 --ng
- deploy it on your iOS 11 device
tns run ios --provision <provision-key>
- the default NativeScript launch screen will load as expected at this point.
- change some of the images in
app/App_Resources/iOS/Asset.xcassets/LaunchScreen.Center.imageset
- remove
platforms
folder and uninstall the application from the real device - rebuild the app
tns run ios --provision <provision-key>
Result: the defaultNativeScript splash screen is still here instead of the newly placed images.
Workaround
- remove
platforms
folder from your project - Uninstall the application from the real device
- Restart the real device so it will clear the cached images for this package ID.
- rebuild and deploy the application once again - the expected images will load.
are there any updates on this one?
For a newb like me trying to figure out how to change from the default splash screen to a custom one for the first time by following the instructions this bug is pretty frustrating ;) Thanks for posting the workaround though.
Thanks for the workaround. Can confirm this happens with any changes to images you may make post first installation. Might be worth putting a note on the "Creating App Icons and Launch Screens for iOS" about this as it took me sometime to find this solution.
Any updates on this issue because it still exists today, other than the work-around?
I confirm that this bug also exists on an iOS simulator. My image assets were replaced by the tns resources generate splashes
command but my iOS simulator still shows the original NativeScript splash screen.
Update: I find it almost impossible :)
- I ran a
tns platform clean ios
- I checked searched for all
.png
files inside my project folder and verified them one-by-one that I cannot see the default nativescript launchscreen - I closed and deleted the app from my iOS simulator
- Then I reran
tns run ios
And I still see the default NativeScript splash screen. I don't understand where is it coming from :)
** Update:**
I've also deleted the entire platform
directory as suggested in https://github.com/NativeScript/docs/pull/1496. I don't understand where is the builder pulling the blue NativeScript default splash screen :)
@etabakov @rosen-vladimirov Could you please tell me if I'm doing something wrong?
Ok, I confirm that this is a very weird thing (and maybe should be pointed out in the documentation?), I found a solution here:
https://stackoverflow.com/questions/33002829/ios-keeping-old-launch-screen-and-app-icon-after-update
TL;DR:
- I had to power off the real device, turn it on and redeploy the app.
- The same seemed to help with the Simulator, as well.
As a small disclosure: I also opened Xcode, rebuild and redeployed the project before powering down and it did not help at all. I saw the new images in Xcode, but the device was stuck with the old ones. I don't know if that could have an influence on things but definitely turning off/on helped.
UPDATE:
Maybe tns resources generate splashes
could rename the resource each time to a unique name. That is said to help in the stackoverflow post I'm referring to above.
Delete app and restart device is not a realistic solution because If Application live and user get update notification then he will just update the app and never going to follow the delete and restart device approach.
I have faced the same issue and find out a solution. Whenever you are going to update splash screen image , you need to change the file name as well. After this you need to change file name binding in LaunchScreen.story board file which is exist in AppResources folder.
Same thing will work for app icon as well.
Any updates on this issue because it still exists today, other than the work-around?
I was pulling hair from my head and in my case restarting a physical device (iphone11) was a key element I forgot. This is image is cached somewhere on the device.