React-native-twitter-signin: символы ios Undefined для архитектуры x86_64, Edit: предпринята попытка входа в систему без действительной схемы URL-адреса twitter kit

Я выполняю эти шаги, чтобы иметь возможность использовать пакет в ios, и мне не повезло. В андроиде работает нормально:

https://github.com/GoldenOwlAsia/react-native-twitter-signin#prerequisites

Затем я добавляю twitter 3 sdk с какао-бобами:

https://github.com/twitter/twitter-kit-ios/wiki/Installation

Полная ошибка

Undefined symbols for architecture x86_64:
  "_OBJC_CLASS_$_Twitter", referenced from:
      objc-class-ref in libRNTwitterSignIn.a(RNTwitterSignIn.o)
ld: symbol(s) not found for architecture x86_64
clang: error: linker command failed with exit code 1 (use -v to see invocation)

Я подключил эту библиотеку. Я установил пакет SDK Cocopod Twitter 3, но все еще получаю сообщение об ошибке сборки.

# Uncomment the next line to define a global platform for your project
platform :ios, '9.0'

target 'app' do
  # Uncomment the next line if you're using Swift or would like to use dynamic frameworks
  # use_frameworks!

  # Pods for app

  pod 'Firebase/Core'
  pod 'Firebase/Auth'
  pod 'TwitterKit'

  target 'appTests' do
    inherit! :search_paths
    # Pods for testing
  end

end

Мой AppDelegate.m:

#import "AppDelegate.h"
#import <React/RCTBundleURLProvider.h>
#import <FBSDKCoreKit/FBSDKCoreKit.h>

// **********************************************
// *** DON'T MISS: THE NEXT LINE IS IMPORTANT ***
// **********************************************


// IMPORTANT: if you're getting an Xcode error that RCCManager.h isn't found, you've probably ran "npm install"
// with npm ver 2. You'll need to "npm install" with npm 3 (see https://github.com/wix/react-native-navigation/issues/1)

#import <Firebase.h>
#import "RCCManager.h"
#import <TwitterKit/TWTRKit.h>

#import <React/RCTRootView.h>


@implementation AppDelegate

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
  [FIRApp configure];

  [[FBSDKApplicationDelegate sharedInstance] application:application
                           didFinishLaunchingWithOptions:launchOptions];

  [[Twitter sharedInstance] startWithConsumerKey:@"dasdasdasasd" consumerSecret:@"dsadasdadasdasd"];


  NSURL *jsCodeLocation;
#ifdef DEBUG
  jsCodeLocation = [[RCTBundleURLProvider sharedSettings] jsBundleURLForBundleRoot:@"index" fallbackResource:nil];
#else
  jsCodeLocation = [[NSBundle mainBundle] URLForResource:@"main" withExtension:@"jsbundle"];
#endif

  self.window = [[UIWindow alloc] initWithFrame:[UIScreen mainScreen].bounds];
  self.window.backgroundColor = [UIColor whiteColor];
  [[RCCManager sharedInstance] initBridgeWithBundleURL:jsCodeLocation launchOptions:launchOptions];

  return YES;
}

- (BOOL)application:(UIApplication *)application
            openURL:(NSURL *)url
            options:(NSDictionary<NSString *,id> *)options {

  BOOL handled = [[FBSDKApplicationDelegate sharedInstance] application:application
                                                                openURL:url
                                                      sourceApplication:options[UIApplicationOpenURLOptionsSourceApplicationKey]
                                                             annotation:options[UIApplicationOpenURLOptionsAnnotationKey]
                  ];

  BOOL handledT = [[Twitter sharedInstance] application:application openURL:url options:options];
  // Add any custom logic here.
  return handled || handledT;
}


- (void)applicationDidBecomeActive:(UIApplication *)application {
  [FBSDKAppEvents activateApp];
}

@end

Мои этапы сборки:

введите здесь описание изображения

Мои настройки сборки для архитектур:

введите здесь описание изображения

Моя информация.plist

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd">
<plist version="1.0">
<dict>
  <key>CFBundleURLTypes</key>
  <array>
    <dict>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>twitterkit-XXXXXX</string>
        </array>
      </dict>
    </array>
    <key>LSApplicationQueriesSchemes</key>
    <array>
      <string>twitter</string>
      <string>twitterauth</string>
    </array>

    <key>CFBundleURLTypes</key>
    <array>
        <dict>
            <key>CFBundleURLSchemes</key>
            <array>
                <string>fbXXXX</string>
            </array>
        </dict>
    </array>
    <key>LSApplicationQueriesSchemes</key>
    <array>
        <string>fbapi</string>
        <string>fb-messenger-share-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
    </array>
    <key>NSCameraUsageDescription</key>
    <string>Camera Permissions</string>
    <key>NSPhotoLibraryUsageDescription</key>
    <string>Gallery Permissions</string>
    <key>UIAppFonts</key>
    <array>
        <string>Ionicons.ttf</string>
    </array>
    <key>CFBundleDevelopmentRegion</key>
    <string>en</string>
    <key>CFBundleDisplayName</key>
    <string>App</string>
    <key>CFBundleExecutable</key>
    <string>$(EXECUTABLE_NAME)</string>
    <key>CFBundleIdentifier</key>
    <string>org.reactjs.native.example.$(PRODUCT_NAME:rfc1034identifier)</string>
    <key>CFBundleInfoDictionaryVersion</key>
    <string>6.0</string>
    <key>CFBundleName</key>
    <string>$(PRODUCT_NAME)</string>
    <key>CFBundlePackageType</key>
    <string>APPL</string>
    <key>CFBundleShortVersionString</key>
    <string>1.0</string>
    <key>CFBundleSignature</key>
    <string>????</string>
    <key>CFBundleVersion</key>
    <string>1</string>
    <key>LSRequiresIPhoneOS</key>
    <true/>
    <key>UILaunchStoryboardName</key>
    <string>LaunchScreen</string>
    <key>UIRequiredDeviceCapabilities</key>
    <array>
        <string>armv7</string>
    </array>
    <key>UISupportedInterfaceOrientations</key>
    <array>
        <string>UIInterfaceOrientationPortrait</string>
        <string>UIInterfaceOrientationLandscapeLeft</string>
        <string>UIInterfaceOrientationLandscapeRight</string>
    </array>
    <key>UIViewControllerBasedStatusBarAppearance</key>
    <false/>
    <key>NSLocationWhenInUseUsageDescription</key>
    <string></string>
    <key>NSAppTransportSecurity</key>
    <dict>
        <key>NSExceptionDomains</key>
        <dict>
            <key>localhost</key>
            <dict>
                <key>NSExceptionAllowsInsecureHTTPLoads</key>
                <true/>
        <!--Include to allow subdomains-->
        <key>NSIncludesSubdomains</key>
        <true/>
        <!--Include to allow HTTP requests-->
        <key>NSTemporaryExceptionAllowsInsecureHTTPLoads</key>
        <true/>
        <!--Include to specify minimum TLS version-->
        <key>NSTemporaryExceptionMinimumTLSVersion</key>
        <string>TLSv1.1</string>
            </dict>
        </dict>
    </dict>
    <key>FacebookAppID</key>
    <string>XXXXXXXX</string>
    <key>FacebookDisplayName</key>
    <string>MyApp</string>
</dict>
</plist>

Уже пытался очистить проект, обновить кокоапод TwitterKit, очистить папку сборки, зайдя в параметры и удерживая кнопку alt, но ничего не работает. Помогите, в чем может быть проблема??


person Juan    schedule 22.04.2018    source источник
comment
Следующая ссылка может немного помочь. ССЫЛКА   -  person Pritish Vaidya    schedule 22.04.2018
comment
Эй, я только что попробовал это, но я получаю ту же ошибку. Если я удалю пакет, то TwitterKit сам скомпилируется, но как только я добавлю эту библиотеку, появятся эти ошибки об архитектуре, есть другие идеи?   -  person Juan    schedule 22.04.2018
comment
Нужно проверить это еще, также проверьте, добавили ли вы ключ в свой info.plist   -  person Pritish Vaidya    schedule 22.04.2018
comment
Я разместил свой информационный лист, и первая запись — это твиттер Api. Добавил в пост, если поможет   -  person Juan    schedule 22.04.2018
comment
Я закончил приложение, начиная все сначала, и оно компилируется, если я загружаю набор twitter 3 вручную вместо использования модуля, но теперь я получаю эту проблему github.com/GoldenOwlAsia/react-native-twitter-signin/issues/90 . ....   -  person Juan    schedule 22.04.2018


Ответы (1)


Я это исправил... В моем случае решение второй проблемы, о которой я упоминал в комментариях к Притишу Вайдье в Твиттере, жалующемся на то, что я пытаюсь войти в систему без схемы URL, заключалось в том, что мне пришлось унифицировать дубликаты ключей в info.plist. поскольку facebook и twitter имеют схемы URL-адресов, и вы не можете дублировать записи, вы должны поместить все это в один и тот же массив под одним ключом, и я также объединил LSApplicationQueriesSchemes в один. Как вы можете видеть в plist выше, он дублируется для обеих записей. Таким образом, две записи теперь в унифицированном формате будут такими:

<key>CFBundleURLTypes</key>
  <array>
    <dict>
      <key>CFBundleURLSchemes</key>
      <array>
        <string>twitterkit-key</string>
        <string>fbkey</string>
        </array>
      </dict>
    </array>
  <key>LSApplicationQueriesSchemes</key>
    <array>
    <string>twitter</string>
    <string>twitterauth</string>
        <string>fbapi</string>
        <string>fb-messenger-share-api</string>
        <string>fbauth2</string>
        <string>fbshareextension</string>
    </array>
person Juan    schedule 22.04.2018