He incorporado SpatialIite
en un proyecto de Xcode que usa un archivo de cabecera de Proj.4
, solo un encabezado. Ambos son proyectos de Xcode y tienen objectives estáticos.
Intento migrar del submódulo de git a Cocoapods. Dado que los objectives estáticos parecen ser difíciles de usar con Cocoapods, solo quiero que el proyecto se construya de la forma habitual. Hice podspec para Proj.4
. Después de escribir podfile para SpatialLite
recibí las advertencias:
[!] The target `SpatialiteIOS [Debug]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'. - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The target `SpatialiteIOS [Debug]` overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Pods.xcconfig'. - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The target `SpatialiteIOS [Debug - Release]` overrides the `OTHER_LDFLAGS` build setting defined in `Pods/Pods.xcconfig'. - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The target `SpatialiteIOS [Debug - Release]` overrides the `HEADER_SEARCH_PATHS` build setting defined in `Pods/Pods.xcconfig'. - Use the `$(inherited)` flag, or - Remove the build settings from the target.
Leí este tema, pero no tengo ni idea de qué significan las advertencias y qué puedo hacer para solucionarlo.
Además, cuando abro el espacio de trabajo y abro el proyecto SpatiaLite, ambos están dirigidos a Mac OSX 64, cuando se supone que es un proyecto de iOS. Mi podfile dice “plataforma: ios”.
Esto definitivamente funciona la mayor parte del tiempo:
Vaya a la Configuración de comstackción deseada -> Otras banderas del enlazador -> haga doble clic. Agregue $(inherited)
a una nueva línea.
Si tiene un problema con “… el destino anula la configuración de comstackción GCC_PREPROCESSOR_DEFINITIONS definida en …”, entonces debe agregar $ (heredado) a su Configuración de comstackción de destino -> Macros de preprocesador
Existe un conflicto entre la configuración de tu comstackción y la configuración de comstackción predeterminada que Cocoapods quiere. Para ver la configuración de construcción de Cocoapods, vea el archivo en Pods / Pods.xcconfig en su proyecto. Para mí este archivo contiene:
GCC_PREPROCESSOR_DEFINITIONS = $(inherited) COCOAPODS=1 HEADER_SEARCH_PATHS = "${PODS_ROOT}/Headers" "${PODS_ROOT}/Headers/Commando" OTHER_LDFLAGS = -ObjC -framework Foundation -framework QuartzCore -framework UIKit PODS_ROOT = ${SRCROOT}/Pods
Si está satisfecho con la configuración de Cocoapods, vaya a Configuración de comstackción para su proyecto, encuentre la configuración adecuada y presione la tecla Suprimir. Esto usará la configuración de Cocoapods.
Por otro lado, si tiene una configuración personalizada que necesita usar, agregue $ (heredado) a esa configuración.
He visto estos 3 errores para el comando pod en la terminal
pod install
[!] El objective MY_APP [Debug / Release] anula el HEADER_SEARCH_PATHS …
[!] El objective MY_APP [Debug / Release] anula OTHER_LDFLAGS …
[!] El objective MY_APP [Debug / Release] anula GCC_PREPROCESSOR_DEFINITIONS …
Todos estos 3 errores desaparecerían al agregar $ (heredado) a
en Proyecto -> Destino -> Configuración de comstackción
Y ahora el comando se ejecutaría sin dar ningún error
pod install
En su proyecto, busque Target -> Build Settings -> Other Linker Flags
, seleccione Other Linker Flags
, presione delete
(Teclado Mac) / Backspace
(teclado normal) para recuperar la configuración. Esto funciona para mi.
Ejemplo:
antes de
Después
Acabo de tener un problema similar cuando ejecuté la pod install
, vi las siguientes advertencias / errores (relacionados con CLANG_CXX_LIBRARY
):
[!] The `Project [Debug]` target overrides the `CLANG_CXX_LIBRARY` build setting defined in `Pods/Target Support Files/Pods/Pods.debug.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target. [!] The `Project [Release]` target overrides the `CLANG_CXX_LIBRARY` build setting defined in `Pods/Target Support Files/Pods/Pods.release.xcconfig'. This can lead to problems with the CocoaPods installation - Use the `$(inherited)` flag, or - Remove the build settings from the target.
Project
para que pueda ver las Build Settings
. Target
( AppName
debajo de los Targets
) C++ Standard Library
(Probablemente estará en negrita : esto significa que está anulada). La línea ya no debe estar en negrita y si ejecuta la pod install
las advertencias / errores deberían haber desaparecido.
Si Xcode se queja al vincular, por ejemplo, la biblioteca no se encuentra para -lPods, no detecta las dependencias implícitas:
Vaya a Producto> Editar esquema Haga clic en Crear Agregar la biblioteca estática de Pods Limpie y vuelva a comstackr
La primera línea del enlace a continuación me salvó el día:
Para agregar valores a las opciones de la configuración de comstackción de su proyecto, anteponga la lista de valores con $ (heredado).
https://github.com/CocoaPods/CocoaPods/wiki/Creating-a-project-that-uses-CocoaPods#faq
Además, no olvides insertar esta línea al comienzo de tu archivo pod:
platform :iOS, '5.0'
Para mí, el problema fue con mis pruebas de objectives. Ya tenía el indicador $(inherited)
en el objective principal de mi aplicación.
Lo agregué a MyAppTests otros indicadores del enlazador. Después de eso, cuando ejecuté la pod install
el mensaje de advertencia desapareció.
Agregué $ (heredado) pero mi proyecto aún no se estaba comstackndo. Para mí, el problema era marcar “Crear solo para architecture activa”, tuve que configurarlo en SÍ.