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

Issue !TARGET_OS_TV React Native, cannot compile to iOS, and i have remove this code to make it works. #12746

Closed
primayudantra opened this issue Mar 6, 2017 · 11 comments
Labels
Resolution: Locked This issue was locked by the bot.

Comments

@primayudantra
Copy link

I got this error :
react-native/React/Profiler/RCTProfile.m:386:57: Incompatible block pointer types assigning to 'UIActivityViewControllerCompletionWithItemsHandler _Nullable' (aka 'void (^)(NSString * _Nullable __strong, BOOL, NSArray * _Nullable __strong, NSError * _Nullable __strong)') from 'int ((^)(void))'

when i compiled with XCODE i got this error and i must remove this code.

#if !TARGET_OS_TV
      UIActivityViewController *activityViewController = [[UIActivityViewController alloc] initWithActivityItems:@[[NSURL fileURLWithPath:outFile]]
                                                                                           applicationActivities:nil];
      activityViewController.completionWithItemsHandler = ^(__unused UIActivityType activityType,
                                                            __unused BOOL completed,
                                                            __unused NSArray *items,
                                                            __unused NSError *error) {
        RCTProfileControlsWindow.hidden = NO;
      };
      RCTProfileControlsWindow.hidden = YES;
      dispatch_async(dispatch_get_main_queue(), ^{
        [[[[[UIApplication sharedApplication] delegate] window] rootViewController] presentViewController:activityViewController
                                                                                                 animated:YES
                                                                                               completion:nil];
      });

#endif

why?

@hramos
Copy link
Contributor

hramos commented Mar 6, 2017

This issue looks like a question that would be best asked on StackOverflow.

StackOverflow is amazing for Q&A: it has a reputation system, voting, the ability to mark a question as answered. Because of the reputation system it is likely the community will see and answer your question there. This also helps us use the GitHub bug tracker for bugs only.

Will close this as this is really a question that should be asked on StackOverflow.

@hramos hramos closed this as completed Mar 6, 2017
@ekimlinger
Copy link

I don't believe that this is an issue with his system alone. I too was receiving the same error today when attempting to run. @primayudantra Were you ever able to figure this out?

@hramos
Copy link
Contributor

hramos commented Mar 7, 2017

Feel free to open a new issue if you believe there is something actionable that can be solved with a PR. Can you make sure to fill out the template if you do so?

@ayyoobcastro
Copy link

ayyoobcastro commented Mar 7, 2017

I also get this error when i create a new project

did you know any solutions

@kesjien
Copy link

kesjien commented Mar 7, 2017

same for me

@tk1cntt
Copy link

tk1cntt commented Mar 8, 2017

+1 same issue

@ayyoobcastro
Copy link

any Updates for the issue

@hramos
Copy link
Contributor

hramos commented Mar 8, 2017

This issue is closed and metoo comments aren't helpful. I suggest opening a new issue, making sure to fill out the template with all the required information.

@disparu86
Copy link

+1 same

@akashdmahali
Copy link

@hramos the issue is within the react native source code as can be seen from the source file path "react-native/React/Profiler/RCTProfile.m" . I too faced this issue.

After digging bit deeper, it seems in RN version 0.42.0 a change was made at the exact same location where this issue is occurring. Here is the commit for your reference. GitHub commit. Moreover this started occurring only after upgrading to version 0.42.0.

As @primayudantra mentioned , after commenting out the said code, the Xcode project complied and ran properly, however changing the source files of RN is definitely not a solution here.

Also i do understand that this issue has been closed, but since many people are facing this issue, I wanted to share my view here. @hramos we would appreciate any inputs from your side.

@hramos
Copy link
Contributor

hramos commented Mar 8, 2017

Thanks for opening a new issue with all the necessary information.

@facebook facebook locked and limited conversation to collaborators Mar 8, 2017
@react-native-bot react-native-bot added the Resolution: Locked This issue was locked by the bot. label Jul 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Resolution: Locked This issue was locked by the bot.
Projects
None yet
Development

No branches or pull requests

9 participants