x86_64 showing react only objective for errors duplicate caracteristicas all _objc_class_ _cdvlogger objective-c xcode duplicates symbols

objective c - showing - símbolos duplicados para arquitecturas en Xcode



react native duplicate symbols for architecture x86_64 (8)

Aquí está el mensaje de error que recibo al compilar ...

Ld /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Products/Debug-iphonesimulator/MasterDetail.app/MasterDetail normal i386 cd /Users/ilia3546/Проекты/iDecide setenv IPHONEOS_DEPLOYMENT_TARGET 5.0 setenv PATH "/Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/usr/bin:/Applications/Xcode.app/Contents/Developer/usr/bin:/usr/bin:/bin:/usr/sbin:/sbin" /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin/clang -arch i386 -isysroot /Applications/Xcode.app/Contents/Developer/Platforms/iPhoneSimulator.platform/Developer/SDKs/iPhoneSimulator6.0.sdk -L/Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Products/Debug-iphonesimulator -F/Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Products/Debug-iphonesimulator -filelist /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetail.LinkFileList -Xlinker -objc_abi_version -Xlinker 2 -fobjc-link-runtime -Xlinker -no_implicit_dylibs -mios-simulator-version-min=5.0 -framework UIKit -framework Foundation -framework CoreGraphics -o /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Products/Debug-iphonesimulator/MasterDetail.app/MasterDetail duplicate symbol _main in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/main-E0BAF2CA88EDEE32.o duplicate symbol _OBJC_IVAR_$_MasterDetailAppDelegate._window in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailAppDelegate-C2C06F734ECE2E36.o duplicate symbol _OBJC_IVAR_$_MasterDetailAppDelegate._navigationController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailAppDelegate-C2C06F734ECE2E36.o duplicate symbol _OBJC_IVAR_$_MasterDetailAppDelegate._splitViewController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailAppDelegate-C2C06F734ECE2E36.o duplicate symbol _OBJC_CLASS_$_MasterDetailAppDelegate in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailAppDelegate-C2C06F734ECE2E36.o duplicate symbol _OBJC_METACLASS_$_MasterDetailAppDelegate in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailAppDelegate-C2C06F734ECE2E36.o duplicate symbol _OBJC_IVAR_$_MasterDetailDetailViewController._detailItem in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailDetailViewController-B3C32DC7B1BE4E38.o duplicate symbol _OBJC_IVAR_$_MasterDetailDetailViewController._TitleOfDetail in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailDetailViewController-B3C32DC7B1BE4E38.o duplicate symbol _OBJC_IVAR_$_MasterDetailDetailViewController._detailDescriptionLabel in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailDetailViewController-B3C32DC7B1BE4E38.o duplicate symbol _OBJC_IVAR_$_MasterDetailDetailViewController._masterPopoverController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailDetailViewController-B3C32DC7B1BE4E38.o duplicate symbol _OBJC_IVAR_$_MasterDetailDetailViewController.WebView in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailDetailViewController-B3C32DC7B1BE4E38.o duplicate symbol _OBJC_CLASS_$_MasterDetailDetailViewController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailDetailViewController-B3C32DC7B1BE4E38.o duplicate symbol _OBJC_METACLASS_$_MasterDetailDetailViewController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailDetailViewController-B3C32DC7B1BE4E38.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController._detailViewController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController._Controller1 in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController.listOfDecide in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController.listOfDecideOpis in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController.listOfGraph in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController.listOfGraphOpis in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController.listOfAbout in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_IVAR_$_MasterDetailMasterViewController.listOfAboutOpis in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_CLASS_$_MasterDetailMasterViewController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o duplicate symbol _OBJC_METACLASS_$_MasterDetailMasterViewController in: /Users/ilia3546/Library/Developer/Xcode/DerivedData/MasterDetail-fhgogwnbpzovbtaskgecptdnvgjs/Build/Intermediates/MasterDetail.build/Debug-iphonesimulator/MasterDetail.build/Objects-normal/i386/MasterDetailMasterViewController-A4C5EC1C14AE6E3A.o ld: 23 duplicate symbols for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

appdelegate.m -

#import "MasterDetailAppDelegate.h" #import "MasterDetailMasterViewController.h" #import "MasterDetailDetailViewController.h" @implementation MasterDetailAppDelegate @synthesize window = _window; @synthesize navigationController = _navigationController; @synthesize splitViewController = _splitViewController; - (void)dealloc { [_window release]; [_navigationController release]; [_splitViewController release]; [super dealloc]; } - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions { self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease]; // Override point for customization after application launch. if ([[UIDevice currentDevice] userInterfaceIdiom] == UIUserInterfaceIdiomPhone) { MasterDetailMasterViewController *masterViewController = [[[MasterDetailMasterViewController alloc] initWithNibName:@"MasterDetailMasterViewController_iPhone" bundle:nil] autorelease]; self.navigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; self.window.rootViewController = self.navigationController; } else { MasterDetailMasterViewController *masterViewController = [[[MasterDetailMasterViewController alloc] initWithNibName:@"MasterDetailMasterViewController_iPad" bundle:nil] autorelease]; UINavigationController *masterNavigationController = [[[UINavigationController alloc] initWithRootViewController:masterViewController] autorelease]; MasterDetailDetailViewController *detailViewController = [[[MasterDetailDetailViewController alloc] initWithNibName:@"MasterDetailDetailViewController_iPad" bundle:nil] autorelease]; UINavigationController *detailNavigationController = [[[UINavigationController alloc] initWithRootViewController:detailViewController] autorelease]; self.splitViewController = [[[UISplitViewController alloc] init] autorelease]; self.splitViewController.delegate = detailViewController; self.splitViewController.viewControllers = [NSArray arrayWithObjects:masterNavigationController, detailNavigationController, nil]; self.window.rootViewController = self.splitViewController; } [self.window makeKeyAndVisible]; return YES; } - (void)applicationWillResignActive:(UIApplication *)application { /* Sent when the application is about to move from active to inactive state. This can occur for certain types of temporary interruptions (such as an incoming phone call or SMS message) or when the user quits the application and it begins the transition to the background state. Use this method to pause ongoing tasks, disable timers, and throttle down OpenGL ES frame rates. Games should use this method to pause the game. */ } - (void)applicationDidEnterBackground:(UIApplication *)application { /* Use this method to release shared resources, save user data, invalidate timers, and store enough application state information to restore your application to its current state in case it is terminated later. If your application supports background execution, this method is called instead of applicationWillTerminate: when the user quits. */ } - (void)applicationWillEnterForeground:(UIApplication *)application { /* Called as part of the transition from the background to the active state; here you can undo many of the changes made on entering the background. */ } - (void)applicationDidBecomeActive:(UIApplication *)application { /* Restart any tasks that were paused (or not yet started) while the application was inactive. If the application was previously in the background, optionally refresh the user interface. */ } - (void)applicationWillTerminate:(UIApplication *)application { /* Called when the application is about to terminate. Save data if appropriate. See also applicationDidEnterBackground:. */ } @end

main.m -

// // main.m // MasterDetail // // Created by Wei-Meng Lee on 3/9/11. // Copyright (c) 2011 __MyCompanyName__. All rights reserved. // #import <UIKit/UIKit.h> #import "MasterDetailAppDelegate.h" int main(int argc, char *argv[]) { @autoreleasepool { return UIApplicationMain(argc, argv, nil, NSStringFromClass([MasterDetailAppDelegate class])); } }

Verifiqué la importación del archivo .m en lugar de .h, pero todo correctamente.


Aquí hay una situación en Xcode 7.0 con error de símbolos duplicados, en caso de que alguien más se encuentre con este escenario

.h file NSUserDefaults *defaults; // <----placing this above the @interface caused the issue @interface someViewController //...

Cambiar a

.h file @interface someViewController { NSUserDefaults *defaults; } //...


Aunque la siguiente no es la causa en el caso del OP, fue mía, así que la compartiré aquí para cualquier persona que enfrente el mismo error:

Si obtiene un error de enlazador en todas las variables globales, es posible que necesite agregar extern a sus declaraciones en los archivos de encabezado.

Si la falta de información externa generará este problema depende de la configuración de compilación, más específicamente de "No Common Blocks" en "Apple LLVM - Generación de código" (GCC_NO_COMMON_BLOCKS, -fno-common). Si se establece en sí, que es el predeterminado en las versiones más nuevas de Xcode, obtendrá un error del enlazador sin extern .

¿Por qué extern?

Las palabras clave extern convierten en una declaración solamente (es decir, no también una definición), que como es un archivo de encabezado es lo que desea. Algunos compiladores lo permiten sin extern y aún "hacen lo correcto", pero se desaconseja omitir extern. Esta es la razón por la que las versiones más nuevas de Xcode habilitan por defecto la advertencia.


En mi caso, el problema era que el archivo .m se incluyó dos veces.

PROBLEMA:

RAZÓN:

SOLUCIÓN: deje solo una referencia de archivo.


En sus fases de compilación, verifique que no esté compilando el mismo archivo más de una vez. es decir, si busca main.m, solo debería devolver un resultado.

Si ese no es el problema, ¿puedes agregar el código de tu main.m a la pregunta?


Esto podría suceder también cuando tienes la misma interfaz @ en diferentes archivos con diferentes implementaciones. Por ejemplo, tiene una clase de Jugador, en los archivos Player.h / m y tiene una clase Match (Match.h / m), y una coincidencia es entre dos jugadores, pero no el Jugador antes mencionado.

Player.h

@interface Player : NSObject @property (nonatomic) NSUInteger _id; @property (nonatomic, strong) NSString* firstName; @property (nonatomic, strong) NSString* lastName; @property (nonatomic, strong) NSString* username; @end

Match.h

@class Player @interface Match : NSObject @property (nonatomic, strong) Player* player1; @property (nonatomic, strong) Player* player2; @property (nonatomic) NSUInteger matchId; @end @interface Player : NSObject @property (nonatomic, strong) NSString* nickName; @property (nonatomic, strong) NSString* point; @property (nonatomic, strong) NSNumber* lastMove; @end

En este caso, el compilador ve dos implementaciones diferentes de clase de jugador. Necesita refactorizar la clase Player en el archivo Match.h para MatchPlayer.


Me encontré con un problema donde typedef no se agregó a una enum y el error de símbolo duplicado apareció entre 2 archivos.

enum <name> { ... } <name>;

Al agregar typedef antes de enum corrigió el símbolo duplicado.


Si esto ayuda a otros, ese era mi caso:

Quería declarar 2 clases pequeñas en un encabezado y archivo de implementación.

Clase 2 está usando Clase 1

Cuando recibí el error, esta era la situación:
archivo de encabezado - interfaz + implementación de clase 1, interfaz de clase 2
Archivo de implementación - implementación de clase 2

Después de mover la implementación de la clase 1 del archivo de encabezado al archivo de implementación, no hubo ningún error ni problema resuelto:
archivo de encabezado - interfaz de clase 1, interfaz de clase 2
Archivo de implementación - implementación de clase 1, implementación de clase 2


Verifique sus archivos de importación, es posible que esté importando un archivo .m .

#import "TimeModel.m"