Closed benediktveith closed 3 years ago
Could you create a simple repro project ? Would make it easier to fix. Thanks
I will try to create a sample project later today.
Error is maybe linked to: https://github.com/NativeScript/NativeScript/issues/8869#issuecomment-696418668 ?
@benediktveith dont think so. I think it is related to the place holder native image not being retained.
Have literally the same issue with latest SDWebImage
and this plugin on iOS as well.
@benediktveith dont think so. I think it is related to the place holder native image not being retained.
Hmm, I debugged my project via XCode with Zombie Objects active and the reason for crashing is *** -[OS_xpc_uuid retain]: message sent to deallocated instance 0x600007a1c930
(see image where the crash happens)
@farfromrefug
@romandragan using placeholder too?
@farfromrefug The crash also happens if no placeholder / failure image is used
@farfromrefug, nope, just regular NSImg
with src
property.
@romandragan @benediktveith using the v8 runtime? If so can you try with tns-ios
?
@farfromrefug, with latest nativescript-ios
V8 runtime, yes. Can't try unfortunately on my side :( We already switched to V8 in our production app, so had to disable images caching temporarily.
@romandragan ok you can try locally if you have time. It is as simple as changing the devDep, removing platforms and runing npm i
@farfromrefug
Test Repo: https://github.com/benediktveith/ui-image-crash-radlistview
Just build the project and scroll down fast as soon as the images appear. (works best directly in XCode .workspace). After crashing you have to reinstall the app, otherwise it won't crash anymore (strangely this happens in my real project too, as soon as all images were loaded once from the plugin they work as expected without any further crashes). Btw. I think adding more images and decreasing the cell height will increase the crash occurrences.
And yes V8 runtime. A week ago this plugin worked fine (v3.0.3 it was I think), but since upgrading to the latest NativeScript the crash occurs. I did not change any logic inside my project.
@farfromrefug Any updates?
@benediktveith sorry guys had a lot of work. running it right now
@romandragan @benediktveith for now i cant reproduce it. Are you seeing it too on sim? I dont have a device in 14. And why are downloading images on the side and not let the plugin handle it?
@romandragan @benediktveith for now i cant reproduce it. Are you seeing it too on sim? I dont have a device in 14
@farfromrefug, I do can reproduce it on simulator (iOS 14) and real device (iOS 14).
Don't quite remember if the same was on iOS 13, but it's more likely it was.
OK so first thing is the app is crazy slow doing it the way you do it. SDWebImage comes with cache feature. So you should put those images directly as src and not download them on created. The app is 10 times smoother, animations on image load....
@farfromrefug
Hmm weird. I retested it right now. iPhone 6 (iOS 12) Simulator. As soon as the first image appears I scroll down. App crashes.
If I rebuild the project (ns run ios
) I can reproduce this procedure.
OK so first thing is the app is crazy slow doing it the way you do it. SDWebImage comes with cache feature. So you should put those images directly as src and not download them on created.
I know but this is just an example way of how I am doing it. In my production app I have following steps:
I do not have the possibility to download the images when they are shown, since we support offline network access and the images need to be present nevertheless.
FYI: I can reproduce the same crash with URLs as src in my production app. (Without downloading any images beforehand)
@benediktveith really weird then, I dont know why it works here. One thing i see is that in the package.json versions are not "fixed" so we might not have the same version :s. As i just installed it i might have newer packages versions. Maybe you can try to upgrade? YOu can find me on slack if you want to discuss that issue
@farfromrefug, could you please share your package-lock.json
?
@romandragan i dont use npm but pnpm. Here is my lock file pnpm-lock.yaml.txt
@farfromrefug So you can not reproduce this error inside the test project?
@benediktveith yes i am really sorry i want to fix it but it does not crash here. tried on sim 14 and 12. Also tried with XCode. We can chat on slack if you want will be easier
@farfromrefug, here is my package-lock.json
. If I'm not mistaken, the versions are the same as in yours pnpm one.
package-lock.json.txt
But it still crashing for me.
@romandragan crashing for you with the sample app from @benediktveith ? I am fighting to reproduce it
@farfromrefug, well I was not able to reproduce the issue in @benediktveith's repo, but I just made a fork of it with some adjustments and I do can reproduce it now.
https://github.com/romandragan/ui-image-crash-radlistview
Note v-if="loaded"
condition for ListView
. If you remove it – all fine, if you keep it – the app crashes: https://github.com/romandragan/ui-image-crash-radlistview/blob/master/app/components/Home.vue#L9
Crash:
@romandragan it does not crash either here :s Really i dont get it. Can you do me a favor and look at platforms/ios/Podfile.lock
and give me the version of your SDWebImage pod?
Thanks
@farfromrefug, here it is: Podfile.lock.txt
pod --version
: 1.9.3
And ns doctor
output as well:
✔ Your ANDROID_HOME environment variable is set and points to correct directory.
✔ Your adb from the Android SDK is correctly installed.
✔ The Android SDK is installed.
✔ A compatible Android SDK for compilation is found.
✔ Javac is installed and is configured properly.
✔ The Java Development Kit (JDK) is installed and is configured properly.
✔ Xcode is installed and is configured properly.
✔ xcodeproj is installed and is configured properly.
✔ CocoaPods are installed.
✔ CocoaPods update is not required.
✔ CocoaPods are configured properly.
✔ Your current CocoaPods version is newer than 1.0.0.
✔ Python installed and configured correctly.
✔ The Python 'six' package is found.
✔ Xcode version 12.0.0 satisfies minimum required version 10.
✔ Getting NativeScript components versions information...
⚠ Update available for component nativescript. Your current version is 7.0.9-rc.2 and the latest available version is 7.0.8.
✔ Component @nativescript/core has 7.0.9 version and is up to date.
✔ Component @nativescript/ios has 7.0.0 version and is up to date.
✔ Component @nativescript/android has 7.0.0 version and is up to date.
@romandragan we are not using the same version! this must be it! I am using SDWebImage 5.9.1 (because my cocoa pod repo is not up to date).
can you try to modify @nativescript-community/ui-image/platforms/ios/Podfile
to force version 5.9.1?
Almost sure it wont crash anymore.
@farfromrefug, still crashing for me with this Podfile.lock.txt
iPhone 11 (iOS 14) simulator.
@farfromrefug, BTW are you using Xcode 12 right?
@romandragan yes i am :s Really dont get this. I am pushing kind of a big update with important bug fixes (image auto measurement within layouts). It should not make a difference wiht your issue. BTW looking at the xcode screenshot i start to think it could be SDWebImage
@farfromrefug, @benediktveith, just wondering what Node version do you have? Mine is 10.19.0, maybe that's related...
Very strange @farfromrefug can't reproduce the issue even with https://github.com/romandragan/ui-image-crash-radlistview, so trying the more dumb thoughts here :)
Works fine with @nativescript/ios@7.0.6
.
@benediktveith could you try so that i know that we can close that issue?
@farfromrefug Can be closed. Seems to be working for me
Which platform(s) does your issue occur on?
Please, provide the following version numbers that your issue occurs with:
Please, tell us how to recreate the issue in as much detail as possible.
I have a RadListView containing 20-300 items. Each item can have an individual image, which are downloaded and stored inside the app's documents folder (e.g:
/Users/****/Library/Developer/CoreSimulator/Devices/419DBF9D-C909-4AC0-8090-6C5F4B759FA2/data/Containers/Data/Application/ED862927-3742-4C32-911D-62F2D7D8B00C/Documents/projects/11.jpg
) before the Controller with the RadListView is presented. As soon as I move to the RadListView and scroll the app crashes (see log below). This does not happen if I use the same image for each item!Is there any code involved?
This is the image part:
:src
thumbnail_url
is beforehand populated for each item with the following function(also notable to mention the data which each item has is stored inside the Vuex Store, nothing gets populated during rendering of the items / cells):Crash Log
The crash differs from time to time...