[iOS] No matching function for call to 'transformImage'
ohayou12 opened this issue · 14 comments
run archive receive an error
error details:
No matching function for call to 'transformImage'
Candidate function not viable: no known conversion from 'NSNumber * _Nonnull const __strong' to 'BOOL' (aka 'signed char') for 8th argument
environment
"@bam.tech/react-native-image-resizer": "^3.0.3",
System:
OS: macOS 12.4
CPU: (8) x64 Intel(R) Core(TM) i7-4770HQ CPU @ 2.20GHz
Memory: 3.28 GB / 16.00 GB
Shell: 5.8.1 - /bin/zsh
Binaries:
Node: 14.17.0 - /var/folders/j5/mpyv7n8j7_x9cvfk07zk11hm0000gn/T/yarn--1666575782013-0.44907134180783537/node
Yarn: 1.22.19 - /var/folders/j5/mpyv7n8j7_x9cvfk07zk11hm0000gn/T/yarn--1666575782013-0.44907134180783537/yarn
npm: 6.14.13 - /usr/local/bin/npm
Watchman: Not Found
Managers:
CocoaPods: 1.11.3 - /Users/ohayou/.rvm/gems/ruby-3.1.2/bin/pod
SDKs:
iOS SDK:
Platforms: DriverKit 21.4, iOS 15.5, macOS 12.3, tvOS 15.4, watchOS 8.5
Android SDK: Not Found
IDEs:
Android Studio: 2020.3 AI-203.7717.56.2031.7935034
Xcode: 13.4.1/13F100 - /usr/bin/xcodebuild
Languages:
Java: 11.0.11 - /usr/bin/javac
npmPackages:
@react-native-community/cli: Not Found
react: 17.0.1 => 17.0.1
react-native: 0.64.1 => 0.64.1
react-native-macos: Not Found
npmGlobalPackages:
*react-native*: Not Found
variable keepMeta
need a Bool in 53 line, but receive a NSNumber
react-native-image-resizer/ios/ImageResizer.mm
Lines 330 to 338 in 2ab4fb4
react-native-image-resizer/ios/ImageResizer.mm
Lines 24 to 60 in 2ab4fb4
Hi @ohayou12 ,
Can you provide me an example.
This is what I tried on my side in the example project with last version :
let result = await ImageResizer.createResizedImage(
image.uri,
sizeTarget,
sizeTarget,
'JPEG',
100,
undefined,
undefined,
true // keepMeta true, same result with false
);
And I had no error ...
Hi @taboulot , I 've updated and getting the same error. Additionally, I copied the example you gave but the error remains.
any idea?
Hmmmm.
Can you provide me a repo with a reproducible example ?
i have resolve the probleme by changing in ImageResizer.m the type of keepMeta from (NSString *) to (BOOL)
in two line 19 and 24
for exemple in line 24
i changed
`
- (void)createResizedImage:(NSString *)uri width:(double)width height:(double)height format:(NSString *)format quality:(double)quality mode:(NSString *)mode onlyScaleDown:(BOOL)onlyScaleDown rotation:(nonnull NSNumber *)rotation outputPath:(NSString *)outputPath keepMeta:(nonnull NSString *)keepMeta resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {`
By
- (void)createResizedImage:(NSString *)uri width:(double)width height:(double)height format:(NSString *)format quality:(double)quality mode:(NSString *)mode onlyScaleDown:(BOOL)onlyScaleDown rotation:(nonnull NSNumber *)rotation outputPath:(NSString *)outputPath keepMeta:(BOOL)keepMeta resolve:(RCTPromiseResolveBlock)resolve reject:(RCTPromiseRejectBlock)reject {
Since the 3.x.x version the type is not (NSString *)
but (NSNumber *)
🧐
See :
react-native-image-resizer/ios/ImageResizer.mm
Lines 19 to 25 in 7548326
And Are you able to reproduce it in the example project of the repo?
i have the same problem, i fixed by changing the type of keepMeta by BOOL in line 19 and 24
@taboulot
in xcode, I run Product -> Archive
, then I receive this error. It is normal if yarn ios
is run.
keepMeta
is a Bool at line 337, but NSNumber at line 53, which I think is probably due to the xcode version. Then I change keepMeta
to true
or false
at line 53 and run Product -> Archive
again and it works fine.
same here.
@chj-damon Thank you for your contribution. Would you mind continuing the discussion in the PR ?
@robingullo updated.