React-native: [RN 0.48.3 Xcode 9] RCTImageStoreManager: Semantic Issue

Created on 23 Sep 2017  路  15Comments  路  Source: facebook/react-native

Is this a bug report?

Yes

Have you read the Contributing Guidelines?

Yes

Environment

Environment:
OS: macOS Sierra 10.12.6
Node: 8.4.0
Yarn: Not Found
npm: 5.4.2
Watchman: 4.7.0
Xcode: Xcode 9.0 Build version 9A235
Android Studio: 2.1 AI-143.3101438

Packages: (wanted => installed)
react: 16.0.0-alpha.12 => 16.0.0-alpha.12
react-native: ^0.48.3 => 0.48.3

Steps to Reproduce

  1. react-native init test
  2. Install latest xcode version
  3. Open ~/test/ios/test.xcodeproj (xcode)
  4. Update to recommended settings (for all xcodeproj)
  5. Build

Expected Behavior

The project started with the old version of xcode.

Actual Behavior

"This block declaration is not a prototype"

screen shot 2017-09-21 at 02 18 13
screen shot 2017-09-21 at 02 39 03

Reproducible Demo

https://github.com/delef/rn-xcode9

Bug Help Wanted iOS

Most helpful comment

I got my code to compile. The offending code is the prototype for the blocks argument to the removeImageForTag method in RCTImaeStoreManager.h and RCTImaeStoreManager.m node_modules/react-native/Libraries/Image.

The compiler appears to no longer treat empty arguments to a method as a warning. The fix is to make the empty argument void.

Original code:

- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)())block
 ```
working code
  • (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block
    ```
    I don't know if this is a general fix, but it worked for me.

All 15 comments

Facing similar issue

Having this issue as well. RN 0.48.4, RCT 16.0.0-rc.3.

Having this issue as well.

Also having this issue. Can't get it to run on a device. Build fails with the above error.

I got my code to compile. The offending code is the prototype for the blocks argument to the removeImageForTag method in RCTImaeStoreManager.h and RCTImaeStoreManager.m node_modules/react-native/Libraries/Image.

The compiler appears to no longer treat empty arguments to a method as a warning. The fix is to make the empty argument void.

Original code:

- (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)())block
 ```
working code
  • (void)removeImageForTag:(NSString *)imageTag withBlock:(void (^)(void))block
    ```
    I don't know if this is a general fix, but it worked for me.

doesnt work for me. RN 0.43.3
When I try @glebovitz 's solution I am getting this error;
Conflicting parameter types in implementation of 'removeImageForTag:withBlock:': 'void (^__strong)()' vs 'void (^__strong)(void)'

@tolgaduzenli - did you make the change to both the RCTImaeStoreManager.h and RCTImaeStoreManager.m files. Looks like you changed only the header file.

@glebovitz thank you so much man, now my build is successful.

@glebovitz thankyou man

@glebovitz thank you! i solved the problem

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Maybe the issue has been fixed in a recent release, or perhaps it is not affecting a lot of people. If you think this issue should definitely remain open, please let us know why. Thank you for your contributions.

We need a global solution to the problem

Same problem after upgrade to XCode 10.1

Is there somebody who could send a Pull Request with a fix for this problem?

Was this page helpful?
0 / 5 - 0 ratings