react-native-in-app-utils: Build failed on tvOS

I get the following error:

error: no such file or directory: '/Users/Jeremy/Library/Developer/Xcode/DerivedData/myapp-eqgygqlzhxidzyclmlhhwylnuhyx/Build/Products/Debug-appletvos/libInAppUtils.a'

I’ve linked all the libraries per these instructions

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Comments: 23 (6 by maintainers)

Most upvoted comments

@euroclydon37 I appreciate all the help. It worked! The last piece I had to do was make sure that the new tvOS library was linked into the tvOS target for my application.

I have it working, but I haven’t been able to put a pull request together, yet, because of work. I just added a tvOS target and named it InAppUtils_tvOS. I then copied all of the .h and .m files into the resulting tvOS folder.

Then, I added an SKProductsRequest variable to the class. (I’m only lightly familiar with Objective C)

@implementation InAppUtils
{
    NSArray *products;
    NSMutableDictionary *_callbacks;
    SKProductsRequest *productsRequest;  # Added this line
}

Then I changed the loadProducts method to use that variable instead of a local one.

RCT_EXPORT_METHOD(loadProducts:(NSArray *)productIdentifiers
                  callback:(RCTResponseSenderBlock)callback)
{
    # Altered this line
    self -> productsRequest = [[SKProductsRequest alloc]
                                          initWithProductIdentifiers:[NSSet setWithArray:productIdentifiers]];
    productsRequest.delegate = self;
    _callbacks[RCTKeyForInstance(productsRequest)] = callback;
    [productsRequest start];
}

It’s a total hack, and not the final way it needs to be fixed. But I don’t have the time available to invest in a legit fix at the moment. I’m the only developer at this company. lol

I hope this helps you.

Sweet. I’m exploring this. Just an FYI, those are on lines 199, 229, and 258 for me. And all I’ve added are about 7 lines with requiresMainQueueSetup and some logging.

I’ve linked the libraries. I’ll tinker around with it and see if I can figure it out.