react-native-fast-image icon indicating copy to clipboard operation
react-native-fast-image copied to clipboard

[iOS] Use of undeclared identifier 'SDImageCodersManager'

Open Fedorrychkov opened this issue 4 years ago • 5 comments

Hi all! I have problem with "archive" build for ios. i have

#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // ...
    // Register WebP format support
    [SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder];
    // ...
}

but i get error: Use of undeclared identifier 'SDImageCodersManager'

Maybe anybody get the same error and can help me

Fedorrychkov avatar Feb 17 '21 19:02 Fedorrychkov

@Fedorrychkov , I just had this issue now and fixed it.

can you make sure you are not wrapping importing for the lib in if-else block? Just make sure you are including them in "release/production" build.

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

terfender avatar Aug 14 '21 11:08 terfender

@Fedorrychkov , I just had this issue now and fixed it.

can you make sure you are not wrapping importing for the lib in if-else block? Just make sure you are including them in "release/production" build.

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

@Terfender Hi! I no longer work on that project, but I remember that the imports were correct. Anyway, I got around this problem by using different modules for different image formats. Thanks for you answer!

Fedorrychkov avatar Aug 14 '21 13:08 Fedorrychkov

@Fedorrychkov , I just had this issue now and fixed it.

can you make sure you are not wrapping importing for the lib in if-else block? Just make sure you are including them in "release/production" build.

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

@Terfender how to include SDImageCodersManager.h to release/production build?

AustinZuniga avatar Jan 25 '22 15:01 AustinZuniga

@AustinZuniga ,

Add these headers to you AppDelegate.m file

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

And [SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder]; if the below method/function as done by Fedorrychkov

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // ...
    // Register WebP format support
    [SDImageCodersManager.sharedManager addCoder:SDImageWebPCoder.sharedCoder];
    // ...
}

terfender avatar Jan 25 '22 16:01 terfender

@Fedorrychkov , I just had this issue now and fixed it.

can you make sure you are not wrapping importing for the lib in if-else block? Just make sure you are including them in "release/production" build.

#import "SDImageCodersManager.h"
#import <SDWebImageWebPCoder/SDImageWebPCoder.h>

thanks you saved my day.

anuragfexle avatar Jul 11 '22 14:07 anuragfexle