Skip to content

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

@primayudantra

Description

@primayudantra

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?

Activity

hramos

hramos commented on Mar 6, 2017

@hramos
Contributor

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.

ekimlinger

ekimlinger commented on Mar 7, 2017

@ekimlinger

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

hramos commented on Mar 7, 2017

@hramos
Contributor

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

ayyoobcastro commented on Mar 7, 2017

@ayyoobcastro

I also get this error when i create a new project

did you know any solutions

kesjien

kesjien commented on Mar 7, 2017

@kesjien

same for me

tk1cntt

tk1cntt commented on Mar 8, 2017

@tk1cntt

+1 same issue

ayyoobcastro

ayyoobcastro commented on Mar 8, 2017

@ayyoobcastro

any Updates for the issue

hramos

hramos commented on Mar 8, 2017

@hramos
Contributor

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

disparu86 commented on Mar 8, 2017

@disparu86

+1 same

akashdmahali

akashdmahali commented on Mar 8, 2017

@akashdmahali

@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

hramos commented on Mar 8, 2017

@hramos
Contributor

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

locked and limited conversation to collaborators on Mar 8, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

      Development

      No branches or pull requests

        Participants

        @hramos@tk1cntt@kesjien@primayudantra@ekimlinger

        Issue actions

          Issue !TARGET_OS_TV React Native, cannot compile to iOS, and i have remove this code to make it works. · Issue #12746 · facebook/react-native