Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[IOS]Crash when app backgrounded #104

Open
kjossendal opened this issue Mar 15, 2022 · 5 comments
Open

[IOS]Crash when app backgrounded #104

kjossendal opened this issue Mar 15, 2022 · 5 comments
Labels
can't reproduce help wanted Extra attention is needed

Comments

@kjossendal
Copy link

RN version: 0.66.0
RN-Filter-Kit version: 0.8.0
minimum ios version is 12

Have not checked on Android
Bare workflow with expo-modules installed

As soon as app is moved to background an NSException gets thrown.

Exception NSException * "*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]" 0x00000002838899b0

I've tracked via breakpoint in xCode to IFKImageFilter.m at line 171

Exception	NSException *	"*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]"	0x00000002838899b0
name	__NSCFConstantString *	"NSInvalidArgumentException"	0x00000001dbcc1298
reason	__NSCFString *	"*** -[__NSPlaceholderDictionary initWithObjects:forKeys:count:]: attempt to insert nil object from objects[0]"	0x0000000281917180
userInfo	void *	NULL	0x0000000000000000
reserved	void *	NULL	0x0000000000000000
acc	__NSDictionaryM *	7 key/value pairs	0x00000002833fb940
[0]	(null)	@"resizeCanvasTo" : 1 key/value pair	
[1]	(null)	@"hasColorManagement" : 1 key/value pair	
[2]	(null)	@"inputImage" : 1 key/value pair	
[3]	(null)	@"key" : @":[object Object]"	
[4]	(null)	@"swapImages" : 1 key/value pair	
[5]	(null)	@"name" : @"CIOverlayBlendMode"	
[6]	(null)	@"inputBackgroundImage" : 1 key/value pair	
key	__NSCFConstantString *	@"inputBackgroundImage"	0x00000001dbc99778
__NSCFString	__NSCFString	
idx	int	0
restImages	__NSSingleObjectArrayI *	@"1 element"	0x0000000283518f40
[0]	RCTImageView *	0x11fea12e0	0x000000011fea12e0

Our utilization in component is as follows

<OverlayBlend
        style={StyleSheet.absoluteFill}
        dstImage={
          <LinearGradient
            style={{ flex: 1 }}
            colors={[currentTrainer.secondary_color, currentTrainer.color]}
            start={{ y: '100h', x: '0w' }}
            end={{ x: 0, y: '0h' }}
            stops={[0, 1]}
          />
        }
        resizeCanvasTo={'dstImage'}
        srcImage={
          <ImageBackground
            style={{ width: '100%', height: '100%' }}
            resizeMode={'cover'}
            resizeMethod="resize"
            source={{
              uri: resolveLocalUrl(currentProgram.background_image_url),
            }}
          />
        }
      />
@kjossendal
Copy link
Author

      NSDictionary *completeConfig = [restImageNames reduce:^id(NSMutableDictionary *acc, NSString *key, int idx) {
        NSLog(@"Value on init %@", restImages[idx]);
        [acc setObject:@{@"image": [[CIImage alloc] initWithImage:[restImages[idx] image]]}
                forKey:key];

        return acc;
      } init:[NSMutableDictionary dictionaryWithDictionary:config]];

The above NSLog returns the following. My objective c knowledge is awful so if I'm looking at the complete wrong thing, please let me know.
Value on init <RCTImageView: 0x119c5c9f0; reactTag: 1203; frame = (0 0; 414 896); clipsToBounds = YES; layer = <CALayer: 0x280c79120>>

@iyegoroff
Copy link
Owner

I'm unable to reproduce this. If anyone meet similar issue, please create a minimal repro.

@Navipro70
Copy link

Navipro70 commented Aug 19, 2022

One more there, react native 0.69.1, latest version of image kit. Reproducible on simulator and on physical device

No expo, IOS 15.4

@kjossendal
Copy link
Author

kjossendal commented Oct 18, 2022

Still seeing this as well but I have little to add other than this appears to happen right after cache is cleared as I see ImageFilterKit: clear cache in xcode logs. It appears to happen when navigating from one screen with RNIFK to another screen also using RNIFK. Something isn't getting unloaded perhaps and causing conflicts. If I clear the navigation stack (ie using 'replace' instead of 'navigate' with react-navigation) when navigating between those two screens, I don't see the issue. I'll try to get a minimal reproduction app together but if you are running in to this, check your navigation.

@calebpanza
Copy link

Has there been any progress made on this? We've got a build working just fine on iOS 16 that isn't working on iOS 15

@iyegoroff iyegoroff added the help wanted Extra attention is needed label Mar 30, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
can't reproduce help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

4 participants